de.cau.cs.kieler.klots.wizards
Class NewSJFileWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by de.cau.cs.kieler.klots.wizards.NewSJFileWizard
All Implemented Interfaces:
IWizard, INewWizard, IWorkbenchWizard

public class NewSJFileWizard
extends Wizard
implements INewWizard

This is a sample new wizard. Its role is to create a new 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 "java". If a sample multi-page editor (also available as a template) is registered for the same extension, it will be able to open it.

Rating red

Field Summary
static String ID
           
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
NewSJFileWizard()
          Constructor for SampleNewWizard.
 
Method Summary
 void addPages()
          Adding the page to the wizard.
 void init(IWorkbench workbench, IStructuredSelection sel)
          
protected static InputStream openContentStream(String projectName, String fileName)
          We will initialize file contents with a sample text.
 boolean performFinish()
          This method is called when 'Finish' button is pressed in the wizard.
 
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

ID

public static final String ID
See Also:
Constant Field Values
Constructor Detail

NewSJFileWizard

public NewSJFileWizard()
Constructor for SampleNewWizard.

Method Detail

addPages

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

Specified by:
addPages in interface IWizard
Overrides:
addPages in class 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 IWizard
Specified by:
performFinish in class Wizard
Returns:
boolean

openContentStream

protected static InputStream openContentStream(String projectName,
                                               String fileName)
We will initialize file contents with a sample text.

Parameters:
projectName -
fileName -
Returns:
InputStream

init

public void init(IWorkbench workbench,
                 IStructuredSelection sel)

Specified by:
init in interface IWorkbenchWizard