org.eclipse.gmt.weaver.wizards
Class WeaverWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by org.eclipse.gmt.weaver.wizards.WeaverWizard
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard, org.eclipse.ui.INewWizard, org.eclipse.ui.IWorkbenchWizard

public class WeaverWizard
extends org.eclipse.jface.wizard.Wizard
implements org.eclipse.ui.INewWizard

Wizard of the weaver

Since:
1.0

Field Summary
protected  java.util.List activeEditors
           
protected  WeaverFirstWizardPage pageOne
           
protected  WeaverThirdWizardPage pageThree
           
protected  WeaverSecondWizardPage pageTwo
           
protected  java.util.List wModelRefNames
           
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
WeaverWizard()
          Creates a new weaver wizard
 
Method Summary
 void addPages()
          Adding the pages to the wizard.
protected  java.util.List getActiveEditors()
           
protected  java.util.Collection getMetamodelExtensionNames()
           
 WeaverFirstWizardPage getPageOne()
           
 WeaverThirdWizardPage getPageThree()
           
 WeaverSecondWizardPage getPageTwo()
           
 org.eclipse.emf.ecore.resource.Resource getWeavingMetamodel()
          returns weaving metamodel when metamodel extensions are selected
protected  java.lang.String[] getWeavingPanelExtensionNames()
           
 java.util.List getWModelNames()
           
protected  java.util.List getWovenPanelExtensionNames()
           
 void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection selection)
          We will accept the selection in the workbench to see if we can initialize from it.
 void initializeWeavingResource(java.util.Collection extensionsSelected, java.util.Collection localExtensionsSelected, org.eclipse.core.runtime.IProgressMonitor monitor, boolean isEcore, java.lang.String ecoreMetamodel)
          Initializes wizard pages :
- WMODEL combo with the WMODEL name found in metamodel extensions selected
- WMODELREF combo with the WMODELREF name found in metamodel extensions selected
- Model name with name of association in metamodel extensions selected
 void initializeWModelRef(java.lang.String wModel)
          Initializes wizard pages :
- WMODEL combo with the WMODEL name found in metamodel extensions selected
- WMODELREF combo with the WMODELREF name found in metamodel extensions selected
- Model name with name of association in metamodel extensions selected
 boolean isOverwriteFile()
           
 boolean performFinish()
          This method is called when 'Finish' button is pressed in the wizard.
 void setOverwriteFile(boolean overwriteFile)
           
 void setWeavingMetamodel(org.eclipse.emf.ecore.resource.Resource weavingMetamodel)
           
 void setWModelNames(java.util.List modelNames)
           
 boolean validateModel(java.lang.String modelFile, java.lang.String metamodelFile)
          Validates if model is in conformity with metamodel
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, canFinish, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.wizard.IWizard
canFinish, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer
 

Field Detail

pageOne

protected WeaverFirstWizardPage pageOne

pageTwo

protected WeaverSecondWizardPage pageTwo

pageThree

protected WeaverThirdWizardPage pageThree

activeEditors

protected java.util.List activeEditors

wModelRefNames

protected java.util.List wModelRefNames
Constructor Detail

WeaverWizard

public WeaverWizard()
Creates a new weaver wizard

Method Detail

addPages

public void addPages()
Adding the pages to the wizard.

Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard

performFinish

public boolean performFinish()
This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.

Specified by:
performFinish in interface org.eclipse.jface.wizard.IWizard
Specified by:
performFinish in class org.eclipse.jface.wizard.Wizard
Returns:

init

public void init(org.eclipse.ui.IWorkbench workbench,
                 org.eclipse.jface.viewers.IStructuredSelection selection)
We will accept the selection in the workbench to see if we can initialize from it.

Specified by:
init in interface org.eclipse.ui.IWorkbenchWizard
See Also:
IWorkbenchWizard.init(IWorkbench, IStructuredSelection)

initializeWeavingResource

public void initializeWeavingResource(java.util.Collection extensionsSelected,
                                      java.util.Collection localExtensionsSelected,
                                      org.eclipse.core.runtime.IProgressMonitor monitor,
                                      boolean isEcore,
                                      java.lang.String ecoreMetamodel)
                               throws WeaverException
Initializes wizard pages :
- WMODEL combo with the WMODEL name found in metamodel extensions selected
- WMODELREF combo with the WMODELREF name found in metamodel extensions selected
- Model name with name of association in metamodel extensions selected

Parameters:
extensionsSelected -
monitor -
Throws:
WeaverException

initializeWModelRef

public void initializeWModelRef(java.lang.String wModel)
                         throws WeaverException
Initializes wizard pages :
- WMODEL combo with the WMODEL name found in metamodel extensions selected
- WMODELREF combo with the WMODELREF name found in metamodel extensions selected
- Model name with name of association in metamodel extensions selected

Parameters:
extensionsSelected -
monitor -
Throws:
WeaverException

validateModel

public boolean validateModel(java.lang.String modelFile,
                             java.lang.String metamodelFile)
                      throws WeaverException
Validates if model is in conformity with metamodel

Parameters:
modelFile -
metamodelFile -
Returns:
Throws:
WeaverException

getPageOne

public WeaverFirstWizardPage getPageOne()
Returns:
Returns the pageOne.

getPageThree

public WeaverThirdWizardPage getPageThree()
Returns:
Returns the pageThree.

getPageTwo

public WeaverSecondWizardPage getPageTwo()
Returns:
Returns the pageTwo.

getActiveEditors

protected java.util.List getActiveEditors()
Returns:
Returns the activeEditor.

getMetamodelExtensionNames

protected java.util.Collection getMetamodelExtensionNames()
Returns:
Returns the metamodelExtensionNames.

getWovenPanelExtensionNames

protected java.util.List getWovenPanelExtensionNames()
Returns:
Returns the wovenPanelExtensionNames.

getWeavingPanelExtensionNames

protected java.lang.String[] getWeavingPanelExtensionNames()
Returns:
Returns the weavingPanelExtensionNames.

getWModelNames

public java.util.List getWModelNames()
Returns:
Returns the wModelNames.

setWModelNames

public void setWModelNames(java.util.List modelNames)
Parameters:
modelNames - The wModelNames to set.

isOverwriteFile

public boolean isOverwriteFile()
Returns:
Returns the overwriteFile.

setOverwriteFile

public void setOverwriteFile(boolean overwriteFile)
Parameters:
overwriteFile - The overwriteFile to set.

getWeavingMetamodel

public org.eclipse.emf.ecore.resource.Resource getWeavingMetamodel()
returns weaving metamodel when metamodel extensions are selected

Returns:
Returns the weavingMetamodel.

setWeavingMetamodel

public void setWeavingMetamodel(org.eclipse.emf.ecore.resource.Resource weavingMetamodel)
Parameters:
weavingMetamodel - The weavingMetamodel to set.