Package net.officefloor.eclipse.section
Class SectionEditor
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.ui.part.WorkbenchPart
-
- org.eclipse.ui.part.EditorPart
-
- org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor
-
- net.officefloor.eclipse.ide.editor.AbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
-
- net.officefloor.eclipse.section.SectionEditor
-
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable
,org.eclipse.core.runtime.IExecutableExtension
,org.eclipse.ui.IEditorPart
,org.eclipse.ui.ISaveablePart
,org.eclipse.ui.IWorkbenchPart
,org.eclipse.ui.IWorkbenchPart2
,org.eclipse.ui.IWorkbenchPart3
,org.eclipse.ui.part.IWorkbenchPartOrientation
- Direct Known Subclasses:
SectionEditorMain
public class SectionEditor extends AbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
SectionModel
editor.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.eclipse.ide.editor.AbstractIdeEclipseEditor
AbstractIdeEclipseEditor.OutsideWorkbenchLauncher
-
-
Constructor Summary
Constructors Constructor Description SectionEditor()
Default instantiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
editorStyle()
Allows overriding the editor styling.java.lang.String
fileName()
Obtains the default file name for the editor.protected void
init(AbstractItem.ConfigurableContext<SectionModel,SectionChanges> context)
Allows overriding to initialise theAbstractIdeEclipseEditor
.static <M extends Model,E extends java.lang.Enum<E>,I>
voidlaunchConfigurer(AbstractConfigurableItem<SectionModel,SectionModel.SectionEvent,SectionChanges,M,E,I> configurableItem, java.util.function.Consumer<M> prototypeDecorator)
Convenience method to launchAbstractConfigurableItem
outside workbench.protected void
loadParents(java.util.List<AbstractConfigurableItem<SectionModel,SectionModel.SectionEvent,SectionChanges,?,?,?>> parents)
Loads theAbstractConfigurableItem
instances.protected SectionModel
loadRootModel(ConfigurationItem configurationItem)
Creates the rootModel
from theConfigurationItem
.static void
main(java.lang.String[] args)
Test editor.java.lang.String
paletteIndicatorStyle()
Allows overriding the palette indicator styling.java.lang.String
paletteStyle()
Allows overriding the palette styling.SectionModel
prototype()
Obtains root prototype.void
saveRootModel(SectionModel model, WritableConfigurationItem configurationItem)
Writes the rootModel
to theWritableConfigurationItem
.-
Methods inherited from class net.officefloor.eclipse.ide.editor.AbstractIdeEclipseEditor
activate, createOperations, dispose, doSave, doSaveAs, getCanvas, getContentViewer, getEditorStyleId, getOsgiBridge, getPaletteIndicatorStyleId, getPaletteStyleId, getParents, hookViewers, isSaveAsAllowed, launch, launch, launchOutsideWorkbench, setInput, setSelectOnly, setSite, translateStyle
-
Methods inherited from class org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor
createActions, createPartControl, deactivate, disposeActions, getAdapter, getDomain, init, isDirty, markNonDirty, setFocus, unhookViewers
-
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, setPartName
-
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setTitle, setTitleImage, setTitleToolTip, showBusy
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
Test editor.- Parameters:
args
- Command line arguments.- Throws:
java.lang.Exception
- If fails to run.
-
launchConfigurer
public static <M extends Model,E extends java.lang.Enum<E>,I> void launchConfigurer(AbstractConfigurableItem<SectionModel,SectionModel.SectionEvent,SectionChanges,M,E,I> configurableItem, java.util.function.Consumer<M> prototypeDecorator)
Convenience method to launchAbstractConfigurableItem
outside workbench.- Type Parameters:
M
-Model
type.E
-Model
event type.I
- Item type.- Parameters:
configurableItem
-AbstractConfigurableItem
.prototypeDecorator
- Optional prototype decorator.
-
init
protected void init(AbstractItem.ConfigurableContext<SectionModel,SectionChanges> context)
Description copied from class:AbstractIdeEclipseEditor
Allows overriding to initialise theAbstractIdeEclipseEditor
.- Overrides:
init
in classAbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
- Parameters:
context
-AbstractItem.ConfigurableContext
.
-
paletteStyle
public java.lang.String paletteStyle()
Description copied from class:AbstractIdeEclipseEditor
Allows overriding the palette styling.- Overrides:
paletteStyle
in classAbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
- Returns:
- Palette styling. May be
null
for default styling.
-
paletteIndicatorStyle
public java.lang.String paletteIndicatorStyle()
Description copied from class:AbstractIdeEclipseEditor
Allows overriding the palette indicator styling.- Overrides:
paletteIndicatorStyle
in classAbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
- Returns:
- Palette indicator styling. May be
null
for default styling.
-
editorStyle
public java.lang.String editorStyle()
Description copied from class:AbstractIdeEclipseEditor
Allows overriding the editor styling.- Overrides:
editorStyle
in classAbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
- Returns:
- Editor styling. May be
null
for defaulting styling.
-
fileName
public java.lang.String fileName()
Description copied from class:AbstractIdeEclipseEditor
Obtains the default file name for the editor.- Specified by:
fileName
in classAbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
- Returns:
- Default file name for the editor.
- See Also:
AbstractNewWizard
-
prototype
public SectionModel prototype()
Description copied from class:AbstractIdeEclipseEditor
Obtains root prototype.- Specified by:
prototype
in classAbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
- Returns:
- Root prototype.
-
loadParents
protected void loadParents(java.util.List<AbstractConfigurableItem<SectionModel,SectionModel.SectionEvent,SectionChanges,?,?,?>> parents)
Description copied from class:AbstractIdeEclipseEditor
Loads theAbstractConfigurableItem
instances.- Specified by:
loadParents
in classAbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
- Parameters:
parents
-List
to be populated with theAbstractConfigurableItem
instances.
-
loadRootModel
protected SectionModel loadRootModel(ConfigurationItem configurationItem) throws java.lang.Exception
Description copied from class:AbstractIdeEclipseEditor
Creates the rootModel
from theConfigurationItem
.- Specified by:
loadRootModel
in classAbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
- Parameters:
configurationItem
-ConfigurationItem
containing the configuration of theModel
.- Returns:
- Root
Model
within theConfigurationItem
. - Throws:
java.lang.Exception
- If fails to load the rootModel
from theConfigurationItem
.
-
saveRootModel
public void saveRootModel(SectionModel model, WritableConfigurationItem configurationItem) throws java.lang.Exception
Description copied from class:AbstractIdeEclipseEditor
Writes the rootModel
to theWritableConfigurationItem
.- Specified by:
saveRootModel
in classAbstractIdeEclipseEditor<SectionModel,SectionModel.SectionEvent,SectionChanges>
- Parameters:
model
- RootModel
to be saved.configurationItem
-WritableConfigurationItem
.- Throws:
java.lang.Exception
- If fails to save the rootModel
into theWritableConfigurationItem
.
-
-