org.eclipse.mtl.ide.ui.wizards.newfile
Class MTLNewTemplateWizardPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.wizard.WizardPage
          extended by org.eclipse.mtl.ide.ui.wizards.newfile.MTLNewTemplateWizardPage
All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage

public class MTLNewTemplateWizardPage
extends org.eclipse.jface.wizard.WizardPage

This is a 'new' wizard page for MTL templates. Its role is to create a new MTL file resource in the provided container. If the container resource (a folder or a project) is selected in the workspace when the wizard page is opened, it will accept it as the target container. The wizard page creates one file with the extension "mtl".


Field Summary
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
MTLNewTemplateWizardPage(org.eclipse.core.resources.IContainer selectedContainer, int num)
          Constructor.
 
Method Summary
 void createControl(org.eclipse.swt.widgets.Composite parent)
          
 java.lang.String getMetamodelType()
          Returns the main metamodel type.
 java.lang.String getMetamodelURI()
          Returns the metamodel URI.
 java.lang.String getTemplateContainer()
          Gets the path of the container (workspace relative path).
 java.lang.String getTemplateExample()
          Gets the path of the example file (workspace relative path).
 IMTLExampleStrategy getTemplateExampleStrategy()
          Gets the selected example strategy.
 java.lang.String getTemplateName()
          Gets the template name (without extension).
 void handleNewTemplatePageChanging(org.eclipse.jface.wizard.WizardPage previousPage)
          One listener is notified when the current page of a wizard is changing.
 
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

MTLNewTemplateWizardPage

public MTLNewTemplateWizardPage(org.eclipse.core.resources.IContainer selectedContainer,
                                int num)
Constructor.

Parameters:
selectedContainer - is the containing resource path in the workspace (can be null)
num - is the number of this 'template' page in the wizard (1-based index)
Method Detail

handleNewTemplatePageChanging

public void handleNewTemplatePageChanging(org.eclipse.jface.wizard.WizardPage previousPage)
One listener is notified when the current page of a wizard is changing. This method is called when a new 'template' page is opened.

Parameters:
previousPage - is the previous page of the wizard

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)

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

getTemplateContainer

public java.lang.String getTemplateContainer()
Gets the path of the container (workspace relative path).

Returns:
the path of the container

getTemplateName

public java.lang.String getTemplateName()
Gets the template name (without extension).

Returns:
the template name

getTemplateExample

public java.lang.String getTemplateExample()
Gets the path of the example file (workspace relative path).

Returns:
the path of the example file

getTemplateExampleStrategy

public IMTLExampleStrategy getTemplateExampleStrategy()
Gets the selected example strategy. It will be used to initialize automatically the template content from the example. The default behavior is to copy the content of the example in a simple template, but the automation can be more powerfull.

Returns:
the selected example strategy, or null if selection is empty

getMetamodelURI

public java.lang.String getMetamodelURI()
Returns the metamodel URI.

Returns:
the metamodel URI

getMetamodelType

public java.lang.String getMetamodelType()
Returns the main metamodel type.

Returns:
the main metamodel type

Copyright 2008 Obeo
All Rights Reserved.