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, wait
dispose, getCreatedElementType
public AbstractWizardContributor()
getParameters()
and getScopes()
won't return null.public final java.lang.String getLabel()
IWizardContributor
getLabel
in interface IWizardContributor
public final void setLabel(java.lang.String label)
setLabel
in interface IWizardContributor
label
- this contribution label.public final java.lang.String getInformation()
IWizardContributor
This text is displayed in the panel header. Must be short (one line). Must be I18n'ed.
getInformation
in interface IWizardContributor
public final void setInformation(java.lang.String information)
IWizardContributor
This text is displayed in the panel header.
setInformation
in interface IWizardContributor
information
- the short explanation.public final java.lang.String getHelpUrl()
IWizardContributor
getHelpUrl
in interface IWizardContributor
public final void setHelpUrl(java.lang.String helpUrl)
setHelpUrl
in interface IWizardContributor
helpUrl
- the help URLpublic final java.lang.String getDetails()
IWizardContributor
getDetails
in interface IWizardContributor
public final void setDetails(java.lang.String details)
IWizardContributor
setDetails
in interface IWizardContributor
details
- a textual explanationpublic final ImageDescriptor getIconDescriptor()
IWizardContributor
getIconDescriptor
in interface IWizardContributor
public final void setIconDescriptor(ImageDescriptor iconDescriptor)
IWizardContributor
setIconDescriptor
in interface IWizardContributor
iconDescriptor
- 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 IWizardContributor
parameters
- the wizard parameterspublic java.util.List<ElementScope> getScopes()
IWizardContributor
#accept(MObject)
and IWizardContributor.actionPerformed(ModelElement, String, String)
getScopes
in interface IWizardContributor
public final void setScopes(java.util.List<ElementScope> scopes)
setScopes
in interface IWizardContributor
scopes
- the wizard scopepublic boolean accept(ModelElement main)
accept
in interface IWizardContributor
main
- 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 IWizardContributor
diagramContext
- 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()
IWizardContributor
getModule
in interface IWizardContributor
public final void setModule(IModule module)
setModule
in interface IWizardContributor
module
- the module that provides this wizard contribution.public final ImageDescriptor getPreviewImage()
IWizardContributor
getPreviewImage
in interface IWizardContributor
public 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()
IWizardContributor
getWizardPanel
in interface IWizardContributor
public final void setPreviewImage(ImageDescriptor previewDescriptor)
setPreviewImage
in interface IWizardContributor
previewDescriptor
- a descriptor for the wizard preview imagepublic final java.lang.String getModelViewTemplateId()
IWizardContributor
IModelViewTemplate
. Optional, empty string means no creator defined.getModelViewTemplateId
in interface IWizardContributor
public final void setModelViewTemplateId(java.lang.String id)
IWizardContributor
IModelViewTemplate
.setModelViewTemplateId
in interface IWizardContributor
protected 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