com.actionbarsherlock.internal.view
Class StandaloneActionMode

java.lang.Object
  extended by com.actionbarsherlock.view.ActionMode
      extended by com.actionbarsherlock.internal.view.StandaloneActionMode
All Implemented Interfaces:
MenuBuilder.Callback

public class StandaloneActionMode
extends ActionMode
implements MenuBuilder.Callback


Nested Class Summary
 
Nested classes/interfaces inherited from class com.actionbarsherlock.view.ActionMode
ActionMode.Callback
 
Constructor Summary
StandaloneActionMode(android.content.Context context, ActionBarContextView view, ActionMode.Callback callback, boolean isFocusable)
           
 
Method Summary
 void finish()
          Finish and close this action mode.
 android.view.View getCustomView()
          Returns the current custom view for this action mode.
 Menu getMenu()
          Returns the menu of actions that this action mode presents.
 MenuInflater getMenuInflater()
          Returns a MenuInflater with the ActionMode's context.
 CharSequence getSubtitle()
          Returns the current subtitle of this action mode.
 CharSequence getTitle()
          Returns the current title of this action mode.
 void invalidate()
          Invalidate the action mode and refresh menu content.
 boolean isUiFocusable()
          Returns whether the UI presenting this action mode can take focus or not.
 void onCloseMenu(MenuBuilder menu, boolean allMenusAreClosing)
           
 void onCloseSubMenu(SubMenuBuilder menu)
           
 boolean onMenuItemSelected(MenuBuilder menu, MenuItem item)
          Called when a menu item is selected.
 void onMenuModeChange(MenuBuilder menu)
          Called when the mode of the menu changes (for example, from icon to expanded).
 boolean onSubMenuSelected(SubMenuBuilder subMenu)
           
 void setCustomView(android.view.View view)
          Set a custom view for this action mode.
 void setSubtitle(CharSequence subtitle)
          Set the subtitle of the action mode.
 void setSubtitle(int resId)
          Set the subtitle of the action mode.
 void setTitle(CharSequence title)
          Set the title of the action mode.
 void setTitle(int resId)
          Set the title of the action mode.
 
Methods inherited from class com.actionbarsherlock.view.ActionMode
getTag, setTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandaloneActionMode

public StandaloneActionMode(android.content.Context context,
                            ActionBarContextView view,
                            ActionMode.Callback callback,
                            boolean isFocusable)
Method Detail

setTitle

public void setTitle(CharSequence title)
Description copied from class: ActionMode
Set the title of the action mode. This method will have no visible effect if a custom view has been set.

Specified by:
setTitle in class ActionMode
Parameters:
title - Title string to set
See Also:
ActionMode.setTitle(int), ActionMode.setCustomView(View)

setSubtitle

public void setSubtitle(CharSequence subtitle)
Description copied from class: ActionMode
Set the subtitle of the action mode. This method will have no visible effect if a custom view has been set.

Specified by:
setSubtitle in class ActionMode
Parameters:
subtitle - Subtitle string to set
See Also:
ActionMode.setSubtitle(int), ActionMode.setCustomView(View)

setTitle

public void setTitle(int resId)
Description copied from class: ActionMode
Set the title of the action mode. This method will have no visible effect if a custom view has been set.

Specified by:
setTitle in class ActionMode
Parameters:
resId - Resource ID of a string to set as the title
See Also:
ActionMode.setTitle(CharSequence), ActionMode.setCustomView(View)

setSubtitle

public void setSubtitle(int resId)
Description copied from class: ActionMode
Set the subtitle of the action mode. This method will have no visible effect if a custom view has been set.

Specified by:
setSubtitle in class ActionMode
Parameters:
resId - Resource ID of a string to set as the subtitle
See Also:
ActionMode.setSubtitle(CharSequence), ActionMode.setCustomView(View)

setCustomView

public void setCustomView(android.view.View view)
Description copied from class: ActionMode
Set a custom view for this action mode. The custom view will take the place of the title and subtitle. Useful for things like search boxes.

Specified by:
setCustomView in class ActionMode
Parameters:
view - Custom view to use in place of the title/subtitle.
See Also:
ActionMode.setTitle(CharSequence), ActionMode.setSubtitle(CharSequence)

invalidate

public void invalidate()
Description copied from class: ActionMode
Invalidate the action mode and refresh menu content. The mode's ActionMode.Callback will have its ActionMode.Callback.onPrepareActionMode(ActionMode, Menu) method called. If it returns true the menu will be scanned for updated content and any relevant changes will be reflected to the user.

Specified by:
invalidate in class ActionMode

finish

public void finish()
Description copied from class: ActionMode
Finish and close this action mode. The action mode's ActionMode.Callback will have its ActionMode.Callback.onDestroyActionMode(ActionMode) method called.

Specified by:
finish in class ActionMode

getMenu

public Menu getMenu()
Description copied from class: ActionMode
Returns the menu of actions that this action mode presents.

Specified by:
getMenu in class ActionMode
Returns:
The action mode's menu.

getTitle

public CharSequence getTitle()
Description copied from class: ActionMode
Returns the current title of this action mode.

Specified by:
getTitle in class ActionMode
Returns:
Title text

getSubtitle

public CharSequence getSubtitle()
Description copied from class: ActionMode
Returns the current subtitle of this action mode.

Specified by:
getSubtitle in class ActionMode
Returns:
Subtitle text

getCustomView

public android.view.View getCustomView()
Description copied from class: ActionMode
Returns the current custom view for this action mode.

Specified by:
getCustomView in class ActionMode
Returns:
The current custom view

getMenuInflater

public MenuInflater getMenuInflater()
Description copied from class: ActionMode
Returns a MenuInflater with the ActionMode's context.

Specified by:
getMenuInflater in class ActionMode

onMenuItemSelected

public boolean onMenuItemSelected(MenuBuilder menu,
                                  MenuItem item)
Description copied from interface: MenuBuilder.Callback
Called when a menu item is selected.

Specified by:
onMenuItemSelected in interface MenuBuilder.Callback
Parameters:
menu - The menu that is the parent of the item
item - The menu item that is selected
Returns:
whether the menu item selection was handled

onCloseMenu

public void onCloseMenu(MenuBuilder menu,
                        boolean allMenusAreClosing)

onSubMenuSelected

public boolean onSubMenuSelected(SubMenuBuilder subMenu)

onCloseSubMenu

public void onCloseSubMenu(SubMenuBuilder menu)

onMenuModeChange

public void onMenuModeChange(MenuBuilder menu)
Description copied from interface: MenuBuilder.Callback
Called when the mode of the menu changes (for example, from icon to expanded).

Specified by:
onMenuModeChange in interface MenuBuilder.Callback
Parameters:
menu - the menu that has changed modes

isUiFocusable

public boolean isUiFocusable()
Description copied from class: ActionMode
Returns whether the UI presenting this action mode can take focus or not. This is used by internal components within the framework that would otherwise present an action mode UI that requires focus, such as an EditText as a custom view.

Overrides:
isUiFocusable in class ActionMode
Returns:
true if the UI used to show this action mode can take focus


Copyright © 2012-2013. All Rights Reserved.