org.eclipse.cdt.ui.wizards
Class CWizardHandler

java.lang.Object
  extended by org.eclipse.cdt.ui.wizards.CWizardHandler
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
MBSWizardHandler

public class CWizardHandler
extends java.lang.Object
implements java.lang.Cloneable

This class is basic implementation for ICWizardHandler interface. It is independent of managed build system, and, so, almost useless It creates "empty" project with no specific. Its descendants should overwrite some methods, including createProject() and handleSelection() This object is created per each Project type on the left pane of New Project Wizard page It is responsible for: - corresponding line in left pane of 1st wizard page - whole view of right pane - processing preferred items, if any. - providing data for ConfigPage - processing data received from config page


Constructor Summary
CWizardHandler(org.eclipse.swt.widgets.Composite _parent, java.lang.String _head, java.lang.String _name)
           
 
Method Summary
 boolean canFinich()
           
 java.lang.Object clone()
           
 void createProject(org.eclipse.core.resources.IProject proj, boolean defaults)
          Creates project
 void createProject(org.eclipse.core.resources.IProject proj, boolean defaults, boolean onFinish)
          Creates project
 java.lang.String getErrorMessage()
           
 java.lang.String getHeader()
           
 java.lang.String getName()
           
 org.eclipse.jface.wizard.IWizardPage getSpecificPage()
           
 void handleSelection()
          Called when user selects corresponding item in wizard tree
 void handleUnSelection()
          Called when user leaves corresponding item in wizard tree
 void initialize(EntryDescriptor data)
          Initializes the handler to be used for the specified entry
 boolean isApplicable(EntryDescriptor data)
          Checks whether this item can be added to Wizard tree
 boolean isChanged()
           
 void postProcess(org.eclipse.core.resources.IProject proj)
          Called when Finish button pressed, even if project was created before.
static java.lang.String removeSpaces(java.lang.String s)
           
 void saveState()
          Stores current internal settings
 void setSupportedOnly(boolean supp)
          Defines whether only supported project types and toolchains are displayed
 boolean supportedOnly()
           
 boolean supportsPreferred()
           
 void updatePreferred(java.util.List prefs)
          Asks handler to update its data according to preferred list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CWizardHandler

public CWizardHandler(org.eclipse.swt.widgets.Composite _parent,
                      java.lang.String _head,
                      java.lang.String _name)
Method Detail

handleSelection

public void handleSelection()
Called when user selects corresponding item in wizard tree


handleUnSelection

public void handleUnSelection()
Called when user leaves corresponding item in wizard tree


getHeader

public java.lang.String getHeader()
Returns:
text for label above handler-specific pane

getName

public java.lang.String getName()
Returns:
text for label in left tree

getErrorMessage

public java.lang.String getErrorMessage()
Returns:
null if data is consistent else returns error message

setSupportedOnly

public void setSupportedOnly(boolean supp)
Defines whether only supported project types and toolchains are displayed

Parameters:
supp -

supportedOnly

public boolean supportedOnly()
Returns:
true if only supported project types and toolchains are displayed

supportsPreferred

public boolean supportsPreferred()
Returns:
true if handler is able to process preferred toolchains

getSpecificPage

public org.eclipse.jface.wizard.IWizardPage getSpecificPage()
Returns:
1st handler-specific page

updatePreferred

public void updatePreferred(java.util.List prefs)
Asks handler to update its data according to preferred list. Usually, marks preferred toolchains somehow (icon, font etc)

Parameters:
prefs - - list of strings (preferred Toolchain IDs)

createProject

public void createProject(org.eclipse.core.resources.IProject proj,
                          boolean defaults)
                   throws org.eclipse.core.runtime.CoreException
Creates project

Parameters:
proj - - simple project to be used as base
defaults - - true if called from 1st Wizard page
Throws:
org.eclipse.core.runtime.CoreException

createProject

public void createProject(org.eclipse.core.resources.IProject proj,
                          boolean defaults,
                          boolean onFinish)
                   throws org.eclipse.core.runtime.CoreException
Creates project

Parameters:
proj - - simple project to be used as base
defaults - - true if called from 1st Wizard page
onFinish - - true when the project creation is performed on finish. false -otherwise false means that the project created is actually a temporary one that can be removed in case cancell is pressed
Throws:
org.eclipse.core.runtime.CoreException

isChanged

public boolean isChanged()
Returns:
true if settings were changed since last call to saveState()

saveState

public void saveState()
Stores current internal settings


postProcess

public void postProcess(org.eclipse.core.resources.IProject proj)
Called when Finish button pressed, even if project was created before.

Parameters:
proj -

isApplicable

public boolean isApplicable(EntryDescriptor data)
Checks whether this item can be added to Wizard tree

Parameters:
data - - Wizard Item data to be added as child to current Wizard item
Returns:
- true if item can be added.

initialize

public void initialize(EntryDescriptor data)
                throws org.eclipse.core.runtime.CoreException
Initializes the handler to be used for the specified entry

Parameters:
data - - Wizard Item data to be handled
Throws:
org.eclipse.core.runtime.CoreException

canFinich

public boolean canFinich()

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

removeSpaces

public static java.lang.String removeSpaces(java.lang.String s)