ExperimentEditor Class Reference

Inheritance diagram for ExperimentEditor:
Collaboration diagram for ExperimentEditor:

List of all members.

Detailed Description

A FormEditor (multipage) for editing chains. Contains different pages as different views on the XML chain. The XML editor is the central interface between the model and the representation on disk. Only the XML editor is actually saved to disk, the others all manipulate the model object representation (the Chain instance), from which the XML editors content is refreshed when saving.

TODO sometimes, after opening, the editor is dirty

sschwieb, fsteeg

Public Methods

IDocument getDocument ()
void init (IEditorSite site, IEditorInput input) throws PartInitException
boolean updateDocumentFromModel ()
boolean updateModelFromDocument ()
void doSave (IProgressMonitor monitor)
void initSelectionListener ()
void doSaveAs ()
boolean isSaveAsAllowed ()
void selectConfigurationEditor (ComponentEntity component)
void selectVisualEditor ()
void selectXMLEditor ()
void selectMetadataEditor ()
Helper getHelper ()
GraphicalChainEditor getGraphicalEditor ()
boolean autoConnect ()
boolean autoLayout ()
void checkDirty (boolean useModel)
void setDirty (boolean dirty)
boolean isDirty ()
void fireModified ()
Experiment getExperiment ()
void setExperiment (Experiment experiment)

Public Static Fields

static final String ID = "de.uni_koeln.spinfo.tesla.client.ui.editors.ExperimentEditor"
static final int META_EDITOR = 0

Protected Methods

void pageChange (int newPageIndex)
void addPages ()

Protected Attributes

final TeslaXMLEditor xmlEditor = new TeslaXMLEditor(true, this)
Helper helper
Experiment experiment

Package Attributes

static final int VISUAL_EDITOR = 1
static final int CONFIG_EDITOR = 2
static final int XML_EDITOR = 3
GraphicalChainEditor graphicalEditor

Method Details

void addPages ( ) [protected]
See also:
boolean autoConnect ( )
boolean autoLayout ( )
void checkDirty ( boolean  useModel) [virtual]

Checks for both kinds of editors if the document is different from the model. If it is, the editor is marked dirty.

useModelIf true, the model objects are compared against the file on disk, else the XML content in the editor is used for comparison with the file on disk.

Implements TeslaEditor.

void doSave ( IProgressMonitor  monitor)
See also:
void doSaveAs ( )
See also:
void fireModified ( ) [inherited]
IDocument getDocument ( )
Returns the IDocument associated with the XML editor
Experiment getExperiment ( ) [inherited]
Returns the actual model element edited by the editor.
GraphicalChainEditor getGraphicalEditor ( )
Helper getHelper ( )
The helper
void init ( IEditorSite  site,
IEditorInput  input 
) throws PartInitException

Instantiates the model (the Chain instance) from the editor input (the XML file).

See also:
org.eclipse.ui.forms.editor.FormEditor.init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
void initSelectionListener ( )

See also:

boolean isDirty ( ) [inherited]
boolean isSaveAsAllowed ( )
See also:
void pageChange ( int  newPageIndex) [protected]
See also:
void selectConfigurationEditor ( ComponentEntity  component)
void selectMetadataEditor ( )

Sets the active page to the editor

void selectVisualEditor ( )

Sets the active page to the editor

void selectXMLEditor ( )

Sets the active page to the editor

void setDirty ( boolean  dirty) [inherited]
void setExperiment ( Experiment  experiment) [inherited]
boolean updateDocumentFromModel ( ) [virtual]

Sets the XML editor's content to current model.

Return true if the XML editors content was replaced.

Implements TeslaEditor.

boolean updateModelFromDocument ( )

Updates the model object (Chain) from the content of the XML editor

Returns true if the update was successful.

Field Details

final int CONFIG_EDITOR = 2 [package]
Experiment experiment [protected, inherited]

The model we're working on.

Helper helper [protected]
final String ID = "de.uni_koeln.spinfo.tesla.client.ui.editors.ExperimentEditor" [static]
final int META_EDITOR = 0 [static]
final int VISUAL_EDITOR = 1 [package]
final int XML_EDITOR = 3 [package]
final TeslaXMLEditor xmlEditor = new TeslaXMLEditor(true, this) [protected]

This is the actual interface between the model and the representation on disk. This is the editor that is actually saved.