Package org.eclipse.jdt.ui.actions
Class MemberFilterActionGroup
java.lang.Object
org.eclipse.ui.actions.ActionGroup
org.eclipse.jdt.ui.actions.MemberFilterActionGroup
public class MemberFilterActionGroup
extends org.eclipse.ui.actions.ActionGroup
Action Group that contributes filter buttons for a view parts showing
methods and fields. Contributed filters are: hide fields, hide static
members hide non-public members and hide local types.
The action group installs a filter on a structured viewer. The filter is connected to the actions installed in the view part's toolbar menu and is updated when the state of the buttons changes.
This class may be instantiated; it is not intended to be subclassed.
- Since:
- 2.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionMemberFilterActionGroup(org.eclipse.jface.viewers.StructuredViewer viewer, String viewerId) Creates a newMemberFilterActionGroup.MemberFilterActionGroup(org.eclipse.jface.viewers.StructuredViewer viewer, String viewerId, boolean inViewMenu) Creates a newMemberFilterActionGroup.MemberFilterActionGroup(org.eclipse.jface.viewers.StructuredViewer viewer, String viewerId, boolean inViewMenu, int availableFilters) Creates a newMemberFilterActionGroup. -
Method Summary
Modifier and TypeMethodDescriptionvoidcontributeToToolBar(org.eclipse.jface.action.IToolBarManager tbm) Adds the filter actions to the given tool barvoidcontributeToViewMenu(org.eclipse.jface.action.IMenuManager menu) Adds the filter actions to the given menu manager.voiddispose()voidfillActionBars(org.eclipse.ui.IActionBars actionBars) booleanhasMemberFilter(int filterProperty) Returnstrueif the given filter is installed.voidrestoreState(org.eclipse.ui.IMemento memento) Restores the state of the filter actions from a memento.voidsaveState(org.eclipse.ui.IMemento memento) Saves the state of the filter actions in a memento.voidsetMemberFilter(int filterProperty, boolean set) Sets the member filters.Methods inherited from class org.eclipse.ui.actions.ActionGroup
fillContextMenu, getContext, setContext, updateActionBars
-
Field Details
-
FILTER_NONPUBLIC
public static final int FILTER_NONPUBLIC- See Also:
-
FILTER_STATIC
public static final int FILTER_STATIC- See Also:
-
FILTER_FIELDS
public static final int FILTER_FIELDS- See Also:
-
FILTER_LOCALTYPES
public static final int FILTER_LOCALTYPES- Since:
- 3.0
- See Also:
-
ALL_FILTERS
public static final int ALL_FILTERS- Since:
- 3.0
- See Also:
-
-
Constructor Details
-
MemberFilterActionGroup
Creates a newMemberFilterActionGroup.- Parameters:
viewer- the viewer to be filteredviewerId- a unique id of the viewer. Used as a key to to store the last used filter settings in the preference store
-
MemberFilterActionGroup
public MemberFilterActionGroup(org.eclipse.jface.viewers.StructuredViewer viewer, String viewerId, boolean inViewMenu) Creates a newMemberFilterActionGroup.- Parameters:
viewer- the viewer to be filteredviewerId- a unique id of the viewer. Used as a key to to store the last used filter settings in the preference storeinViewMenu- iftruethe actions are added to the view menu. Iffalsethey are added to the toolbar.- Since:
- 2.1
-
MemberFilterActionGroup
public MemberFilterActionGroup(org.eclipse.jface.viewers.StructuredViewer viewer, String viewerId, boolean inViewMenu, int availableFilters) Creates a newMemberFilterActionGroup.- Parameters:
viewer- the viewer to be filteredviewerId- a unique id of the viewer. Used as a key to to store the last used filter settings in the preference storeinViewMenu- iftruethe actions are added to the view menu. Iffalsethey are added to the toolbar.availableFilters- Specifies which filter action should be contained.FILTER_NONPUBLIC,FILTER_STATIC,FILTER_FIELDSandFILTER_LOCALTYPESor a combination of these constants are possible values. UseALL_FILTERSto select all available filters.- Since:
- 3.0
-
-
Method Details
-
setMemberFilter
public void setMemberFilter(int filterProperty, boolean set) Sets the member filters.- Parameters:
filterProperty- the filter to be manipulated. Valid values areFILTER_FIELDS,FILTER_PUBLICFILTER_PRIVATEandFILTER_LOCALTYPES_ACTIONas defined by this action groupset- iftruethe given filter is installed. Iffalsethe given filter is removed .
-
hasMemberFilter
public boolean hasMemberFilter(int filterProperty) Returnstrueif the given filter is installed.- Parameters:
filterProperty- the filter to be tested. Valid values areFILTER_FIELDS,FILTER_PUBLIC,FILTER_PRIVATEandFILTER_LOCALTYPESas defined by this action group- Returns:
- returns
trueif the given filter is installed
-
saveState
public void saveState(org.eclipse.ui.IMemento memento) Saves the state of the filter actions in a memento.- Parameters:
memento- the memento to which the state is saved
-
restoreState
public void restoreState(org.eclipse.ui.IMemento memento) Restores the state of the filter actions from a memento.Note: This method does not refresh the viewer.
- Parameters:
memento- the memento from which the state is restored
-
fillActionBars
public void fillActionBars(org.eclipse.ui.IActionBars actionBars) - Overrides:
fillActionBarsin classorg.eclipse.ui.actions.ActionGroup
-
contributeToToolBar
public void contributeToToolBar(org.eclipse.jface.action.IToolBarManager tbm) Adds the filter actions to the given tool bar- Parameters:
tbm- the tool bar to which the actions are added
-
contributeToViewMenu
public void contributeToViewMenu(org.eclipse.jface.action.IMenuManager menu) Adds the filter actions to the given menu manager.- Parameters:
menu- the menu manager to which the actions are added- Since:
- 2.1
-
dispose
public void dispose()- Overrides:
disposein classorg.eclipse.ui.actions.ActionGroup
-