EGF Engine
Release 0.1.0

org.eclipse.egf.core.ui.wizard.page
Class AbstractModelElementWizardPage

java.lang.Object
  extended by WizardPage
      extended by org.eclipse.egf.common.ui.wizard.page.AbstractWizardPage
          extended by org.eclipse.egf.core.ui.wizard.page.AbstractModelElementWizardPage
Direct Known Subclasses:
AbstractDomainWizardPage, AbstractPatternLibrarySequenceWizardPage, ContextElementKeyWizardPage, ContextElementReferenceWizardPage, ContextElementValueWizardPage, ContextElementWizardPage, ContractElementReferenceWizardPage, ContractElementTypeWizardPage, ContractElementWizardPage, EditFactoryComponentWizardPage, FactoryComponentInvocationWizardPage, MappingWizardPage, PatternLibraryWizardPage, PatternWizardPage, TaskFactoryHolderWizardPage

public abstract class AbstractModelElementWizardPage
extends AbstractWizardPage

Base class to implement wizard pages for EGF model element objects.


Constructor Summary
AbstractModelElementWizardPage(String pageName_p)
          Constructor.
AbstractModelElementWizardPage(String pageName_p, String title_p, ImageDescriptor titleImage_p)
          Constructor.
 
Method Summary
protected  void bindTextToAttribute(Text text_p, EAttribute feature_p, NamedModelElementWithId modelElement_p, UpdateWizardPage featureValueChangeListener_p)
          Create a data binding between given Text control and a given attribute for given model element.
protected  void bindTextToAttribute(Text text_p, String propertyName_p, Object modelElement_p, UpdateWizardPage featureValueChangeListener_p)
          Create a data binding between given Text control and a given property name for given model element.
protected  AdapterFactory getAdapterFactory()
          Return the adapter factory to use in EMF-based label and content provider.
protected  Bundle getHostingBundle()
          Return the bundle of the hosting project #getBundle().
protected  String getHostingPluginId()
          Return the id of the plug-in that hosts model element parent object.
protected  IJavaProject getHostingProject()
          Return the project that hosts model element parent object.
protected  ClassLoader getHostingProjectClassLoader()
          Return the class loader of the hosting project getHostingProject().
protected  NamedModelElementWithId getModelElement()
          Get the model element object displayed in this page.
protected  AbstractModelElementWizard getModelElementWizard()
          Return the wizard that contains this page as an AbstractModelElementWizard instance.
protected  String getPageDescription()
          Get the page description.
protected  NamedModelElementWithId getParent()
          Get the parent object of the handled model element.
protected  boolean handleFieldEditorValidation(org.eclipse.egf.common.ui.toolkit.fields.IFieldEditor[] fieldEditors_p)
          Validate given field editors
protected  boolean isReadOnly()
          Handle page read only mode.
protected  void showErrorMessage(org.eclipse.egf.common.ui.toolkit.fields.CStringFieldEditor fieldEditor_p, String errorMessage_p)
          Set and show an error for given CStringFieldEditor instance.
 
Methods inherited from class org.eclipse.egf.common.ui.wizard.page.AbstractWizardPage
createControl, createPageArea, getCompleteStatus, getContentNumColumn, getHelpContextId, getPageTitle, handlePageLayout, initialize, isPageComplete, performHelp, updateButtons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractModelElementWizardPage

public AbstractModelElementWizardPage(String pageName_p)
Constructor.

Parameters:
pageName_p -
modelElement_p -

AbstractModelElementWizardPage

public AbstractModelElementWizardPage(String pageName_p,
                                      String title_p,
                                      ImageDescriptor titleImage_p)
Constructor.

Parameters:
pageName_p -
title_p -
titleImage_p -
modelElement_p -
Method Detail

getModelElement

protected NamedModelElementWithId getModelElement()
Get the model element object displayed in this page.

Returns:
the modelElement

getParent

protected NamedModelElementWithId getParent()
Get the parent object of the handled model element.

Returns:

getModelElementWizard

protected AbstractModelElementWizard getModelElementWizard()
Return the wizard that contains this page as an AbstractModelElementWizard instance.

Returns:

isReadOnly

protected boolean isReadOnly()
Description copied from class: AbstractWizardPage
Handle page read only mode.

Specified by:
isReadOnly in class AbstractWizardPage
See Also:
AbstractWizardPage.isReadOnly()

handleFieldEditorValidation

protected boolean handleFieldEditorValidation(org.eclipse.egf.common.ui.toolkit.fields.IFieldEditor[] fieldEditors_p)
Validate given field editors

Parameters:
fieldEditors_p -
Returns:
true means all field editors are valid; false otherwise.

getPageDescription

protected String getPageDescription()
Description copied from class: AbstractWizardPage
Get the page description.

Specified by:
getPageDescription in class AbstractWizardPage
Returns:
See Also:
AbstractWizardPage.getPageDescription()

showErrorMessage

protected void showErrorMessage(org.eclipse.egf.common.ui.toolkit.fields.CStringFieldEditor fieldEditor_p,
                                String errorMessage_p)
Set and show an error for given CStringFieldEditor instance.

Parameters:
fieldEditor_p -
errorMessage_p -

bindTextToAttribute

protected void bindTextToAttribute(Text text_p,
                                   EAttribute feature_p,
                                   NamedModelElementWithId modelElement_p,
                                   UpdateWizardPage featureValueChangeListener_p)
Create a data binding between given Text control and a given attribute for given model element.

Parameters:
text_p - the control.
event_p - event type to register for change events.
feature_p - the observed feature.
modelElement_p - the object.
featureValueChangeListener_p - if provided, it is registered to the created IObservableValue object based on feature_p.

bindTextToAttribute

protected void bindTextToAttribute(Text text_p,
                                   String propertyName_p,
                                   Object modelElement_p,
                                   UpdateWizardPage featureValueChangeListener_p)
Create a data binding between given Text control and a given property name for given model element.

Parameters:
text_p - the control.
event_p - event type to register for change events
propertyName_p - the observed property name.
modelObject_p - the object.
featureValueChangeListener_p - if provided, it is registered to the created IObservableValue object based on feature_p.

getHostingProject

protected IJavaProject getHostingProject()
Return the project that hosts model element parent object.

Returns:
null if the project is not found (the model element is located in an installed plug-in).

getHostingPluginId

protected String getHostingPluginId()
Return the id of the plug-in that hosts model element parent object.

Returns:
null if not found.

getHostingProjectClassLoader

protected ClassLoader getHostingProjectClassLoader()
Return the class loader of the hosting project getHostingProject().

Returns:
a class loader or null if an error occurs.

getHostingBundle

protected Bundle getHostingBundle()
Return the bundle of the hosting project #getBundle().

Returns:
a bundle or null.

getAdapterFactory

protected AdapterFactory getAdapterFactory()
Return the adapter factory to use in EMF-based label and content provider.

Returns:
a not null AdapterFactory instance.

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.