Modelers

org.topcased.modeler.wizards
Class DiagramsPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.wizard.WizardPage
          extended by org.topcased.modeler.wizards.DiagramsPage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage

public abstract class DiagramsPage
extends org.eclipse.jface.wizard.WizardPage

This page displays the new file information inputs.
creation : 13 dec. 2004


Field Summary
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
DiagramsPage(java.lang.String pageName, org.eclipse.jface.viewers.IStructuredSelection selection)
          Deprecated. Use the constructor that enables to specify whether the Diagram may be initialized
DiagramsPage(java.lang.String pageName, org.eclipse.jface.viewers.IStructuredSelection selection, boolean allowDiagramInitialization)
          Constructor
 
Method Summary
 void createControl(org.eclipse.swt.widgets.Composite parent)
          Creation of the wizard page
protected  void createDestinationGroup(org.eclipse.swt.widgets.Composite parent)
          Create the Destination group
abstract  ComposedAdapterFactory getAdapterFactory()
          Subclasses must implement this method to return the ComposedAdapterFactory
abstract  java.lang.String getDefaultTemplateId()
          Subclasses must implement this IWizard method to perform any special finish processing for their wizard.
 EObject getDiagramEObject()
          Returns the selected EObject that will be associated with the diagrams file.
 java.lang.String getDiagramId()
          Returns the selected diagram id
abstract  java.lang.String getEditorID()
          Subclasses must implement this method to return the editorID on which the templates should be filtered
abstract  java.lang.String getFileExtension()
          Subclasses must implement this method to return the file extension
 java.lang.String getModelName()
          Returns the selected model name
protected  java.lang.String getModelNameWithoutExtension(java.lang.String fullName)
          Returns the name of the modelFile without extension
protected  ResourceSet getResourceSet()
          Return the ResourceSet used to store the model and diagram file.
 EObject getRootEObject()
          Returns the root EObject of the model file
 org.eclipse.core.resources.IContainer getSelectedIContainer()
          Returns the selected destination container
 java.lang.String getTemplateId()
          Returns the selected template id
protected  void handleDirectoryChoose()
          Handle the directory choice button action
protected  void handleModelChoose()
          Handle the model choice button action
protected  void handleRootModelObjectChanged()
          Handle the change of the root model object.
 boolean isInitialized()
          Returns if the diagram must be initialized with model objects
 boolean isNewModel()
          Return the choice of creation made by the user
protected  boolean loadModelFile()
          Load the modelFile selected and update the associated widgets
protected  boolean validatePage()
          Check if the informations contained in the page are OK
 
Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setButtonLayoutData, setControl, setMessage, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp, setVisible
 

Constructor Detail

DiagramsPage

public DiagramsPage(java.lang.String pageName,
                    org.eclipse.jface.viewers.IStructuredSelection selection)
Deprecated. Use the constructor that enables to specify whether the Diagram may be initialized

Constructor

Parameters:
pageName -
selection -

DiagramsPage

public DiagramsPage(java.lang.String pageName,
                    org.eclipse.jface.viewers.IStructuredSelection selection,
                    boolean allowDiagramInitialization)
Constructor

Parameters:
pageName - the page title
selection - the selected object
allowDiagramInitialization -
Method Detail

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)
Creation of the wizard page

See Also:
IDialogPage.createControl(org.eclipse.swt.widgets.Composite)

createDestinationGroup

protected void createDestinationGroup(org.eclipse.swt.widgets.Composite parent)
Create the Destination group

Parameters:
parent - the Composite

handleDirectoryChoose

protected void handleDirectoryChoose()
Handle the directory choice button action


handleModelChoose

protected void handleModelChoose()
Handle the model choice button action


handleRootModelObjectChanged

protected void handleRootModelObjectChanged()
Handle the change of the root model object. Update the available Diagrams


loadModelFile

protected boolean loadModelFile()
Load the modelFile selected and update the associated widgets

Returns:
true if the file was loaded successfully, return false otherwise.

getResourceSet

protected ResourceSet getResourceSet()
Return the ResourceSet used to store the model and diagram file. By default create a new ResourceSet.

Returns:
ResourceSet

validatePage

protected boolean validatePage()
Check if the informations contained in the page are OK

Returns:
true is OK

isInitialized

public boolean isInitialized()
Returns if the diagram must be initialized with model objects

Returns:
true if diagram must be initialized

getSelectedIContainer

public org.eclipse.core.resources.IContainer getSelectedIContainer()
Returns the selected destination container

Returns:
the selected container

getModelName

public java.lang.String getModelName()
Returns the selected model name

Returns:
the model name. Returns null if no model file name is set.

getRootEObject

public EObject getRootEObject()
Returns the root EObject of the model file

Returns:
the EObject

getDiagramEObject

public EObject getDiagramEObject()
Returns the selected EObject that will be associated with the diagrams file. If no object is selected, returns the rootEObject of the model

Returns:
the EObject

getModelNameWithoutExtension

protected java.lang.String getModelNameWithoutExtension(java.lang.String fullName)
Returns the name of the modelFile without extension

Parameters:
fullName - the name with (or without) extension
Returns:
the name of the modelFile without extension

getTemplateId

public java.lang.String getTemplateId()
Returns the selected template id

Returns:
the selected template id. Returns null if none found

getDiagramId

public java.lang.String getDiagramId()
Returns the selected diagram id

Returns:
the selected diagram id. Returns null if none found

isNewModel

public boolean isNewModel()
Return the choice of creation made by the user

Returns:
true if the model file is not created

getEditorID

public abstract java.lang.String getEditorID()
Subclasses must implement this method to return the editorID on which the templates should be filtered

Returns:
the string that represent an editorID

getFileExtension

public abstract java.lang.String getFileExtension()
Subclasses must implement this method to return the file extension

Returns:
the string that represent the model file extension

getAdapterFactory

public abstract ComposedAdapterFactory getAdapterFactory()
Subclasses must implement this method to return the ComposedAdapterFactory

Returns:
the ComposedAdapterFactory

getDefaultTemplateId

public abstract java.lang.String getDefaultTemplateId()
Subclasses must implement this IWizard method to perform any special finish processing for their wizard.

Returns:
the ComposedAdapterFactory

Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.