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

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by org.eclipse.mtl.ide.ui.wizards.newfile.MTLNewTemplatesWizard
All Implemented Interfaces:
org.eclipse.jface.wizard.IWizard, org.eclipse.ui.INewWizard, org.eclipse.ui.IWorkbenchWizard
Direct Known Subclasses:
MTLNewProjectWizard

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

This is a 'new' wizard 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 is opened, it will accept it as the target container. The wizard creates one file with the extension "mtl".


Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
MTLNewTemplatesWizard()
          Constructor.
 
Method Summary
 void addPages()
          
 void createPageControls(org.eclipse.swt.widgets.Composite pageContainer)
          
protected  void createTemplate(CreateTemplateData data, org.eclipse.core.runtime.IProgressMonitor monitor)
          Creates a template using the given configuration.
 void dispose()
          
 java.util.List<IMTLExampleStrategy> getExampleStrategies()
          Gets all the example strategies existing in the current Eclipse instance.
 java.util.List<MTLNewTemplateWizardPage> getTemplatePages()
          Get templates pages.
 void init(org.eclipse.ui.IWorkbench workbench, org.eclipse.jface.viewers.IStructuredSelection aSelection)
          
 boolean performFinish()
          
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, canFinish, 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, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer
 

Constructor Detail

MTLNewTemplatesWizard

public MTLNewTemplatesWizard()
Constructor.

Method Detail

getTemplatePages

public java.util.List<MTLNewTemplateWizardPage> getTemplatePages()
Get templates pages. There is one page for each template to create.

Returns:
templates pages

createPageControls

public void createPageControls(org.eclipse.swt.widgets.Composite pageContainer)

Specified by:
createPageControls in interface org.eclipse.jface.wizard.IWizard
Overrides:
createPageControls in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.createPageControls(org.eclipse.swt.widgets.Composite)

dispose

public void dispose()

Specified by:
dispose in interface org.eclipse.jface.wizard.IWizard
Overrides:
dispose in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.dispose()

init

public void init(org.eclipse.ui.IWorkbench workbench,
                 org.eclipse.jface.viewers.IStructuredSelection aSelection)

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

addPages

public void addPages()

Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.addPages()

getExampleStrategies

public java.util.List<IMTLExampleStrategy> getExampleStrategies()
Gets all the example strategies existing in the current Eclipse instance. An internal extension point is defined to specify multiple example strategies. It is often used to initialize automatically a template file from an example in the MTL project.

Returns:
all the example strategies

performFinish

public boolean performFinish()

Specified by:
performFinish in interface org.eclipse.jface.wizard.IWizard
Specified by:
performFinish in class org.eclipse.jface.wizard.Wizard
See Also:
Wizard.performFinish()

createTemplate

protected void createTemplate(CreateTemplateData data,
                              org.eclipse.core.runtime.IProgressMonitor monitor)
Creates a template using the given configuration.

Parameters:
data - is the new template configuration
monitor - is the monitor

Copyright 2008 Obeo
All Rights Reserved.