|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.action.ContributionItem
org.eclipse.ui.actions.CompoundContributionItem
org.eclipse.emf.mint.ui.AbstractOpenGeneratedMenu
public abstract class AbstractOpenGeneratedMenu
Abstract base for dynamic menu contributions that provide actions to open generated artifacts related to the current selection, whatever it may be.
Clients may extend this class.
Nested Class Summary | |
---|---|
protected static class |
AbstractOpenGeneratedMenu.DescriptorComparator
Default comparator used for sorting java element descriptors. |
Field Summary | |
---|---|
protected org.eclipse.emf.common.notify.AdapterFactory |
adapterFactory
Cached adapter factory reference. |
protected IServiceLocator |
serviceLocator
Reference to the service locator obtained in initialize(IServiceLocator) . |
Constructor Summary | |
---|---|
protected |
AbstractOpenGeneratedMenu()
Default constructor. |
protected |
AbstractOpenGeneratedMenu(String id)
Constructs this menu with the given identifier. |
Method Summary | |
---|---|
protected IAction |
createAction(IItemJavaElementDescriptor descriptor,
Object target)
Creates an action for opening a particular generated artifact for a given target object. |
protected org.eclipse.emf.common.notify.AdapterFactory |
createAdapterFactory(Object target)
Creates an instance of an adapter factory suitable for the given target. |
protected Comparator<? super IItemJavaElementDescriptor> |
createDescriptorComparator(Object target)
Creates a comparator used for sorting the menu items. |
void |
dispose()
|
protected org.eclipse.emf.common.notify.AdapterFactory |
getAdapterFactory(Object target)
Returns the adapter factory suitable for the given object. |
protected IContributionItem[] |
getContributionItems()
|
protected int |
getMinCategoryItems()
Returns the minimum number of menu items per category. |
protected Object |
getTarget(ISelection selection)
Given the selection, returns the object whose generated artifacts to include in the menu. |
void |
initialize(IServiceLocator serviceLocator)
|
Methods inherited from class org.eclipse.ui.actions.CompoundContributionItem |
---|
fill, isDirty, isDynamic, setParent |
Methods inherited from class org.eclipse.jface.action.ContributionItem |
---|
fill, fill, fill, getId, getParent, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setVisible, toString, update, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected IServiceLocator serviceLocator
initialize(IServiceLocator)
.
protected org.eclipse.emf.common.notify.AdapterFactory adapterFactory
Constructor Detail |
---|
protected AbstractOpenGeneratedMenu()
protected AbstractOpenGeneratedMenu(String id)
id
- menu identifierMethod Detail |
---|
public void initialize(IServiceLocator serviceLocator)
initialize
in interface IWorkbenchContribution
protected final IContributionItem[] getContributionItems()
getContributionItems
in class CompoundContributionItem
protected Object getTarget(ISelection selection)
selection
- current selection
protected org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory(Object target)
createAdapterFactory(Object)
the first time
this method is called, caches the result in adapterFactory
and
returns it on every subsequent call (regardless of the target).
target
- object for which to get the adapter factory
protected org.eclipse.emf.common.notify.AdapterFactory createAdapterFactory(Object target)
target
- object for which to create the adapter factory
protected Comparator<? super IItemJavaElementDescriptor> createDescriptorComparator(Object target)
AbstractOpenGeneratedMenu.DescriptorComparator
.
target
- object for which to create the comparator
protected int getMinCategoryItems()
protected IAction createAction(IItemJavaElementDescriptor descriptor, Object target)
descriptor
- descriptor representing the artifact to opentarget
- object whose artifact to open
public void dispose()
dispose
in interface IContributionItem
dispose
in class ContributionItem
|
Copyright 2008, 2009 Ecliptical Software Inc. and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |