Class ShowAnnotationsMenu
java.lang.Object
org.eclipse.jface.action.ContributionItem
org.apache.uima.caseditor.editor.contextmenu.ShowAnnotationsMenu
- All Implemented Interfaces:
org.eclipse.jface.action.IContributionItem
public class ShowAnnotationsMenu
extends org.eclipse.jface.action.ContributionItem
Creates the show annotations context sub menu.
-
Constructor Summary
ConstructorDescriptionShowAnnotationsMenu
(TypeSystem typeSystem, Collection<Type> shownTypes) Initializes a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(IShowAnnotationsListener listener) Adds the listener.void
fill
(org.eclipse.swt.widgets.Menu menu, int index) Fills the menu with type entries.Gets the selected types.protected void
insertAction
(Type type, org.eclipse.swt.widgets.Menu parentMenu) Implementing classes must implement this method to insert actions into the type menu.void
removeListener
(IShowAnnotationsListener listener) Removes the listener.void
setEditorAnnotationMode
(Type newMode) Sets the editor annotation mode.void
setSelectedType
(Type type, boolean isShown) Sets the selected type.void
setSelectedTypes
(Collection<Type> types) Sets the selected types.Methods inherited from class org.eclipse.jface.action.ContributionItem
dispose, fill, fill, fill, getId, getParent, isDirty, isDynamic, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update
-
Constructor Details
-
ShowAnnotationsMenu
Initializes a new instance.- Parameters:
typeSystem
- the type systemshownTypes
- the shown types
-
-
Method Details
-
insertAction
Implementing classes must implement this method to insert actions into the type menu.- Parameters:
type
- the typeparentMenu
- the parent menu
-
getSelectedTypes
Gets the selected types.- Returns:
- the selected types
-
setSelectedType
Sets the selected type.- Parameters:
type
- the typeisShown
- the is shown
-
setSelectedTypes
Sets the selected types.- Parameters:
types
- the new selected types
-
setEditorAnnotationMode
Sets the editor annotation mode.- Parameters:
newMode
- the new editor annotation mode
-
fill
public void fill(org.eclipse.swt.widgets.Menu menu, int index) Fills the menu with type entries.- Specified by:
fill
in interfaceorg.eclipse.jface.action.IContributionItem
- Overrides:
fill
in classorg.eclipse.jface.action.ContributionItem
- Parameters:
menu
- the menuindex
- the index