public abstract class AbstractOfficeFloorEditor<M extends Model,C>
extends org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
implements org.eclipse.gef.EditPartFactory
GraphicalEditor
for the Office Floor items to
edit.Modifier and Type | Field and Description |
---|---|
protected org.eclipse.gef.palette.PaletteRoot |
paletteRoot
PaletteRoot . |
Constructor and Description |
---|
AbstractOfficeFloorEditor()
Initiate the edit domain and the command stack.
|
Modifier and Type | Method and Description |
---|---|
org.eclipse.gef.EditPart |
createEditPart(org.eclipse.gef.EditPart context,
Object model)
Use the model type to
EditPart map to create the appropriate
EditPart via its default constructor. |
org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy |
createGraphicalEditPolicy()
Creates the
GraphicalEditPolicy to be installed. |
org.eclipse.gef.editpolicies.LayoutEditPolicy |
createLayoutEditPolicy()
Creates the
LayoutEditPolicy to be installed. |
protected abstract C |
createModelChanges(M model)
Creates the
Model change functionality. |
void |
doSave(org.eclipse.core.runtime.IProgressMonitor monitor) |
void |
doSaveAs() |
M |
getCastedModel()
Obtains the
Model . |
C |
getModelChanges()
Obtains the
Model change functionality. |
protected org.eclipse.gef.ui.palette.FlyoutPaletteComposite.FlyoutPreferences |
getPalettePreferences() |
protected org.eclipse.gef.palette.PaletteRoot |
getPaletteRoot() |
org.eclipse.gef.RootEditPart |
getRootEditPart()
Obtains the
RootEditPart . |
protected void |
initialiseContextMenu()
Initialises the context menu.
|
protected void |
initialisePaletteRoot()
Override to initialise the
PaletteRoot . |
protected void |
initializeGraphicalViewer() |
boolean |
isSaveAsAllowed() |
protected void |
loadEditPartTypes()
Allows sub classes to trigger the population of the
EditPart
types. |
void |
messageError(org.eclipse.core.runtime.IStatus status)
Displays the
IStatus error. |
void |
messageError(String message)
Displays the message as an error
MessageDialog . |
void |
messageError(String message,
Throwable cause)
Displays the message and its cause as an error
MessageDialog . |
void |
messageError(Throwable error)
Displays the
Throwable error details as an error
MessageDialog . |
void |
messageStatus(org.eclipse.core.runtime.IStatus status,
String title)
Displays a
Dialog for the IStatus . |
void |
messageWarning(String message)
Displays the message as a warning
MessageDialog . |
protected abstract void |
populateEditPartTypes(Map<Class<?>,Class<? extends org.eclipse.gef.EditPart>> map)
Populates the
EditPart types for their respective model. |
protected abstract void |
populateGraphicalEditPolicy(OfficeFloorGraphicalNodeEditPolicy policy)
Populates the
OfficeFloorGraphicalNodeEditPolicy . |
protected abstract void |
populateLayoutEditPolicy(OfficeFloorLayoutEditPolicy policy)
Populates the
OfficeFloorLayoutEditPolicy . |
protected abstract void |
populateOperations(List<Operation> list)
Populates the listing of
Operation instances. |
protected abstract M |
retrieveModel(ConfigurationItem configuration)
Retrieves the Model.
|
protected void |
setCastedModel(M model)
Specifies the Model.
|
protected void |
setInput(org.eclipse.ui.IEditorInput input) |
protected abstract void |
storeModel(M model,
ConfigurationItem configuration)
Stores the Model.
|
createPaletteComposite, createPalettePage, createPaletteViewerProvider, createPartControl, getAdapter, getGraphicalControl, getPaletteViewerProvider, setEditDomain
commandStackChanged, configureGraphicalViewer, createActions, createGraphicalViewer, dispose, firePropertyChange, getActionRegistry, getCommandStack, getEditDomain, getGraphicalViewer, getPropertyActions, getSelectionActions, getSelectionSynchronizer, getStackActions, hookGraphicalViewer, init, initializeActionRegistry, isDirty, selectionChanged, setActionRegistry, setFocus, setGraphicalViewer, updateActions
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, setPartName
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public AbstractOfficeFloorEditor()
protected void setCastedModel(M model)
model
- Model.public org.eclipse.gef.RootEditPart getRootEditPart()
RootEditPart
.RootEditPart
.public C getModelChanges()
Model
change functionality.Model
change functionality.public void messageError(Throwable error)
Throwable
error details as an error
MessageDialog
.error
- Error.public void messageError(String message)
MessageDialog
.message
- Error message.public void messageError(String message, Throwable cause)
MessageDialog
.message
- Error message.cause
- Cause of error.public void messageWarning(String message)
MessageDialog
.message
- Warning messagepublic void messageError(org.eclipse.core.runtime.IStatus status)
IStatus
error.status
- IStatus
error.public void messageStatus(org.eclipse.core.runtime.IStatus status, String title)
Dialog
for the IStatus
.status
- IStatus
.title
- Title for Dialog
.public org.eclipse.gef.editpolicies.LayoutEditPolicy createLayoutEditPolicy()
LayoutEditPolicy
to be installed.LayoutEditPolicy
to be installed.protected abstract void populateLayoutEditPolicy(OfficeFloorLayoutEditPolicy policy)
OfficeFloorLayoutEditPolicy
.policy
- OfficeFloorLayoutEditPolicy
.public org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy createGraphicalEditPolicy()
GraphicalEditPolicy
to be installed.GraphicalEditPolicy
to be installed.protected abstract void populateGraphicalEditPolicy(OfficeFloorGraphicalNodeEditPolicy policy)
OfficeFloorGraphicalNodeEditPolicy
.policy
- OfficeFloorGraphicalNodeEditPolicy
.protected void initializeGraphicalViewer()
initializeGraphicalViewer
in class org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
protected void initialiseContextMenu()
protected abstract void populateOperations(List<Operation> list)
Operation
instances.list
- Listing to add Operation
instances.public org.eclipse.gef.EditPart createEditPart(org.eclipse.gef.EditPart context, Object model)
EditPart
map to create the appropriate
EditPart
via its default constructor.createEditPart
in interface org.eclipse.gef.EditPartFactory
protected void loadEditPartTypes()
EditPart
types.protected abstract void populateEditPartTypes(Map<Class<?>,Class<? extends org.eclipse.gef.EditPart>> map)
EditPart
types for their respective model.map
- Registry to load the mappings.protected void setInput(org.eclipse.ui.IEditorInput input)
setInput
in class org.eclipse.ui.part.EditorPart
protected abstract C createModelChanges(M model)
Model
change functionality.protected abstract M retrieveModel(ConfigurationItem configuration) throws Exception
configuration
- Configuration of the Model.Exception
- If fails to obtain the Model.public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
doSave
in interface org.eclipse.ui.ISaveablePart
doSave
in class org.eclipse.ui.part.EditorPart
protected abstract void storeModel(M model, ConfigurationItem configuration) throws Exception
model
- Model to be stored.configuration
- Configuration of the Model.Exception
- If fails to store the Model.public void doSaveAs()
doSaveAs
in interface org.eclipse.ui.ISaveablePart
doSaveAs
in class org.eclipse.gef.ui.parts.GraphicalEditor
public boolean isSaveAsAllowed()
isSaveAsAllowed
in interface org.eclipse.ui.ISaveablePart
isSaveAsAllowed
in class org.eclipse.gef.ui.parts.GraphicalEditor
protected org.eclipse.gef.ui.palette.FlyoutPaletteComposite.FlyoutPreferences getPalettePreferences()
getPalettePreferences
in class org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
protected org.eclipse.gef.palette.PaletteRoot getPaletteRoot()
getPaletteRoot
in class org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette
protected void initialisePaletteRoot()
PaletteRoot
.getPaletteRoot()
Copyright © 2005–2016. All rights reserved.