public abstract class AbstractWizardContributor extends java.lang.Object implements IWizardContributor
Note to contributor implementors:
By inheriting from this abstract class you only have to provide implementations for the two abstract methods:
| Constructor and Description |
|---|
AbstractWizardContributor()
Default constructor that ensure
getParameters() and getScopes() won't return null. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(ModelElement main)
Default implementation that deals with checking the scopes and requires an abstract delegated method to be provided by implementors.
|
abstract MObject |
actionPerformed(ModelElement diagramContext,
java.lang.String diagramName,
java.lang.String diagramDescription)
Execute the creation action.
|
protected abstract boolean |
checkCanCreateIn(ModelElement owner)
Called by
#accept(MObject) to check whether the given object has sufficient rights to create the wizard new element. |
Stereotype |
findStereotypeFromSpec(MClass metaclass,
java.lang.String stereotypeSpec)
Find the stereotype from a stereotype specification.
|
java.lang.String |
getDetails()
Get a complete textual explanation of the contributior's role or function.
|
java.lang.String |
getHelpUrl()
Get a URL to some 'help' or 'documentation' page about the behavior and usage of the contributor.
|
ImageDescriptor |
getIconDescriptor()
The contributor's icon.
|
Image |
getIconImage()
Default implementation returning
null. |
java.lang.String |
getInformation()
Get a short textual explanation of the contributor's role or function.
|
java.lang.String |
getLabel()
Get the label to be displayed for the contributor by the Creation Wizard in its "type" browser.
|
java.lang.String |
getModelViewTemplateId()
Get the id of the creator that is used by this contributor
IModelViewTemplate. |
IModule |
getModule()
Get the module that is providing this contributor.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters() |
ImageDescriptor |
getPreviewImage()
Get the preview image of this contributor.
|
java.util.List<ElementScope> |
getScopes()
Get the valid scopes for this contributor, ie the (metaclass+stereotype) combinations which are accepted as 'context' in
#accept(MObject) and IWizardContributor.actionPerformed(ModelElement, String, String) |
IPanelProvider |
getWizardPanel()
Get the GUI panel to display in the wizard.
|
void |
setDetails(java.lang.String details)
Set a textual explanation of the contribution's role or function.
|
void |
setHelpUrl(java.lang.String helpUrl) |
void |
setIconDescriptor(ImageDescriptor iconDescriptor)
Sets the contributor icon.
|
void |
setInformation(java.lang.String information)
Get a short textual explanation of the contribution's role or function.
|
void |
setLabel(java.lang.String label) |
void |
setModelViewTemplateId(java.lang.String id)
Sets the id of the creator that is used by this contributor
IModelViewTemplate. |
void |
setModule(IModule module) |
void |
setParameters(java.util.Map<java.lang.String,java.lang.String> parameters) |
void |
setPreviewImage(ImageDescriptor previewDescriptor) |
void |
setScopes(java.util.List<ElementScope> scopes) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdispose, getCreatedElementTypepublic AbstractWizardContributor()
getParameters() and getScopes() won't return null.public final java.lang.String getLabel()
IWizardContributorgetLabel in interface IWizardContributorpublic final void setLabel(java.lang.String label)
setLabel in interface IWizardContributorlabel - this contribution label.public final java.lang.String getInformation()
IWizardContributorThis text is displayed in the panel header. Must be short (one line). Must be I18n'ed.
getInformation in interface IWizardContributorpublic final void setInformation(java.lang.String information)
IWizardContributorThis text is displayed in the panel header.
setInformation in interface IWizardContributorinformation - the short explanation.public final java.lang.String getHelpUrl()
IWizardContributorgetHelpUrl in interface IWizardContributorpublic final void setHelpUrl(java.lang.String helpUrl)
setHelpUrl in interface IWizardContributorhelpUrl - the help URLpublic final java.lang.String getDetails()
IWizardContributorgetDetails in interface IWizardContributorpublic final void setDetails(java.lang.String details)
IWizardContributorsetDetails in interface IWizardContributordetails - a textual explanationpublic final ImageDescriptor getIconDescriptor()
IWizardContributorgetIconDescriptor in interface IWizardContributorpublic final void setIconDescriptor(ImageDescriptor iconDescriptor)
IWizardContributorsetIconDescriptor in interface IWizardContributoriconDescriptor - this wizard contribution iconpublic final java.util.Map<java.lang.String,java.lang.String> getParameters()
public final void setParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
setParameters in interface IWizardContributorparameters - the wizard parameterspublic java.util.List<ElementScope> getScopes()
IWizardContributor#accept(MObject) and IWizardContributor.actionPerformed(ModelElement, String, String)getScopes in interface IWizardContributorpublic final void setScopes(java.util.List<ElementScope> scopes)
setScopes in interface IWizardContributorscopes - the wizard scopepublic boolean accept(ModelElement main)
accept in interface IWizardContributormain - the model element to check.true if the element is accepted.public abstract MObject actionPerformed(ModelElement diagramContext, java.lang.String diagramName, java.lang.String diagramDescription)
Note : a model transaction is already open by the caller.
actionPerformed in interface IWizardContributordiagramContext - the model element on which the wizard is rundiagramName - the name of the element to create.diagramDescription - the description of the element to create.public final IModule getModule()
IWizardContributorgetModule in interface IWizardContributorpublic final void setModule(IModule module)
setModule in interface IWizardContributormodule - the module that provides this wizard contribution.public final ImageDescriptor getPreviewImage()
IWizardContributorgetPreviewImage in interface IWizardContributorpublic final Stereotype findStereotypeFromSpec(MClass metaclass, java.lang.String stereotypeSpec)
The stereotype specification may have one of the following formats:
metaclass - the metaclass to look fromstereotypeSpec - the stereotype specificationpublic IPanelProvider getWizardPanel()
IWizardContributorgetWizardPanel in interface IWizardContributorpublic final void setPreviewImage(ImageDescriptor previewDescriptor)
setPreviewImage in interface IWizardContributorpreviewDescriptor - a descriptor for the wizard preview imagepublic final java.lang.String getModelViewTemplateId()
IWizardContributorIModelViewTemplate. Optional, empty string means no creator defined.getModelViewTemplateId in interface IWizardContributorpublic final void setModelViewTemplateId(java.lang.String id)
IWizardContributorIModelViewTemplate.setModelViewTemplateId in interface IWizardContributorprotected abstract boolean checkCanCreateIn(ModelElement owner)
#accept(MObject) to check whether the given object has sufficient rights to create the wizard new element.owner - the new element owner.public Image getIconImage()
null.getIconImage in interface IWizardContributor