org.openoffice.ide.eclipse.core.editors.utils
Class AbstractSection<ModelType extends IModel>

java.lang.Object
  extended by org.eclipse.ui.forms.AbstractFormPart
      extended by org.eclipse.ui.forms.SectionPart
          extended by org.openoffice.ide.eclipse.core.editors.utils.AbstractSection<ModelType>
Type Parameters:
ModelType - the type of the model object for the section
All Implemented Interfaces:
org.eclipse.ui.forms.IFormPart, IModelChangedListener
Direct Known Subclasses:
IntegrationSection, LocalizedSection, MirrorsSection

public abstract class AbstractSection<ModelType extends IModel>
extends org.eclipse.ui.forms.SectionPart
implements IModelChangedListener

Abstract section class providing mechanisms to suspend the dirty state change notifications.

Author:
Cédric Bosdonnat

Constructor Summary
AbstractSection(org.eclipse.swt.widgets.Composite pParent, org.eclipse.ui.forms.editor.FormPage pPage, int pStyle)
          The SectionPart constructor.
 
Method Summary
 ModelType getModel()
           
 boolean isDirty()
          
abstract  void loadData()
          Load the non-localized data from the model into the fields.
 void modelChanged()
          Marks the editor as non dirty.
 void modelSaved()
          Marks the editor as saved.
 void setModel(ModelType pModel)
           
 
Methods inherited from class org.eclipse.ui.forms.SectionPart
expansionStateChanged, expansionStateChanging, getSection, hookListeners, setFocus
 
Methods inherited from class org.eclipse.ui.forms.AbstractFormPart
commit, dispose, getManagedForm, initialize, isStale, markDirty, markStale, refresh, setFormInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSection

public AbstractSection(org.eclipse.swt.widgets.Composite pParent,
                       org.eclipse.ui.forms.editor.FormPage pPage,
                       int pStyle)
The SectionPart constructor.

Parameters:
pParent - the parent composite
pPage - the form page to use
pStyle - the SectionPart style
Method Detail

getModel

public ModelType getModel()
Returns:
the data model for the section

setModel

public void setModel(ModelType pModel)
Parameters:
pModel - the new data model for the section

isDirty

public boolean isDirty()

Specified by:
isDirty in interface org.eclipse.ui.forms.IFormPart
Overrides:
isDirty in class org.eclipse.ui.forms.AbstractFormPart

modelSaved

public void modelSaved()
Marks the editor as saved.

Specified by:
modelSaved in interface IModelChangedListener

modelChanged

public void modelChanged()
Marks the editor as non dirty.

Specified by:
modelChanged in interface IModelChangedListener

loadData

public abstract void loadData()
Load the non-localized data from the model into the fields.