public class ModuleMultiVariantPropertyPanel extends java.lang.Object implements IModulePropertyCustomPanel
IPanelProvider
instances associated to selection conditions.IPanelProvider
instance to be used for a given element are made of two criteria:
ElementScope
criterion where the given element must satisfy the ElementScope.isMatching(MObject)
methodIElementFilter
where the given element must satisfy the the IElementFilter.accept(MObject)
methodIPanelProvider
instances are registered along with their applicability conditions in a map where they are looked up for when the setInput(Object)
is called. The ModuleMultiVariantPropertyPanel chooses the
first condition matching IPanelProvider
which becomes the activePanelProvider
that is in charge of displaying the element properties.
When no matching IPanelProvider
is found a statically predefined "empty" panel provider is used EMPTYPANELPROVIDER
that simply display an empty GUI.Constructor and Description |
---|
ModuleMultiVariantPropertyPanel(IModule module,
java.lang.String name,
java.lang.String label,
java.lang.String icon)
Constructors of this property page.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
createPanel(Composite parent)
From interface IPanelProvider
Create the GUI for the ModuleMultiVariantPropertyPanel.
|
void |
dispose()
From IPanelProvider
|
protected IPanelProvider |
getActivePanelProvider() |
java.lang.String |
getHelpTopic()
From interface IPanelProvider.
|
java.nio.file.Path |
getIcon()
Get the icon path for this property page.
|
java.lang.Object |
getInput()
From interface IPanelProvider
|
java.lang.String |
getLabel()
from IModulePropertyPanel
|
IModule |
getModule()
from IModulePropertyPanel
|
java.lang.String |
getName()
from IModulePropertyPanel
|
java.lang.Object |
getPanel()
From interface IPanelProvider
|
boolean |
isRelevantFor(java.lang.Object proposedInput)
From interface IPanelProvider.
|
void |
register(IPanelProvider panelProvider,
ElementScope scope)
Register an
IPanelProvider for the given scope. |
void |
register(IPanelProvider panelProvider,
ElementScope scope,
IElementFilter filter)
Register an
IPanelProvider for the given scope and under the additional filter condition. |
void |
setInput(java.lang.Object input)
From interface IPanelProvider.
|
void |
setLabel(java.lang.String label)
from IModulePropertyPanel
|
void |
setModule(IModule mdac)
from IModulePropertyPanel
|
void |
setName(java.lang.String name)
from IModulePropertyPanel
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRelevance
public ModuleMultiVariantPropertyPanel(IModule module, java.lang.String name, java.lang.String label, java.lang.String icon)
module
- module that is associated to the property pagename
- the name of the property page.label
- the label of the property page.icon
- a relative path to the image to display for the property page.public java.lang.Object createPanel(Composite parent)
public void dispose()
public java.lang.String getHelpTopic()
public java.lang.Object getInput()
public java.lang.String getLabel()
getLabel
in interface IModulePropertyPanel
public IModule getModule()
getModule
in interface IModulePropertyPanel
public java.lang.String getName()
getName
in interface IModulePropertyPanel
public java.lang.Object getPanel()
public boolean isRelevantFor(java.lang.Object proposedInput)
public void register(IPanelProvider panelProvider, ElementScope scope)
IPanelProvider
for the given scope.panelProvider
- the IPanelProvider
to register. Cannot be null.scope
- the scope for which the panel provider is applicable. Cannot be null.public void register(IPanelProvider panelProvider, ElementScope scope, IElementFilter filter)
IPanelProvider
for the given scope and under the additional filter condition.panelProvider
- the IPanelProvider
to register. Cannot be null.scope
- the scope for which the panel provider is applicable. Cannot be null.filter
- the additional filter the element must pass once its scope has been approved. Cannot be null.public void setInput(java.lang.Object input)
public void setLabel(java.lang.String label)
setLabel
in interface IModulePropertyPanel
label
- the text that will be displayed in the property page's label.public void setModule(IModule mdac)
setModule
in interface IModulePropertyPanel
mdac
- the module owning this property page.public void setName(java.lang.String name)
setName
in interface IModulePropertyPanel
name
- the name of the property page.public java.nio.file.Path getIcon()
IModulePropertyPanel
Modelio is in charge of loading/disposing this image along with the property page itself.
getIcon
in interface IModulePropertyPanel
null
.protected final IPanelProvider getActivePanelProvider()