org.eclipse.cdt.managedbuilder.ui.wizards
Class MBSCustomPageManager

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager

public final class MBSCustomPageManager
extends java.lang.Object

This class is responsible for managing the use of custom pages in the Managed Build System's New Project wizards. This class is a singleton.


Field Summary
static java.lang.String ID
          ID attribute for wizardPage
static java.lang.String NATURE
          nature element
static java.lang.String NATURE_ID
          ID attribute of nature element
static java.lang.String OPERATION_CLASS
          attribute for the operation that is run for a wizardPage during the wizard's DoRunEpilogue() method
static java.lang.String PAGE_CLASS
          attribute for the class associated witha wizardPage element
static java.lang.String PAGE_ID
           
static java.lang.String PROJECT_TYPE
          project type element
static java.lang.String PROJECT_TYPE_ID
          ID attribute of projectType element
static java.lang.String TOOLCHAIN
          toolchain element
static java.lang.String TOOLCHAIN_ID
          ID attribute of toolchain element
static java.lang.String VERSIONS_SUPPORTED
          versions supported attribute of toolchain element
static java.lang.String WIZARD_PAGE
          element for a custom wizard page
 
Method Summary
static void addPageProperty(java.lang.String pageID, java.lang.String key, java.lang.Object data)
          Publishes a piece of data associated with a wizard page.
static void addStockPage(org.eclipse.jface.wizard.IWizardPage page, java.lang.String pageID)
          Adds an entry for a stock page into the manager.
static org.eclipse.jface.wizard.IWizardPage[] getCustomPages()
          Gets all custom pages that the page manager knows about.
static org.eclipse.jface.wizard.IWizardPage getNextPage(java.lang.String currentPageID)
          Gets the next page that should appear in the wizard.
static org.eclipse.jface.operation.IRunnableWithProgress[] getOperations()
          Gets all operations that should be run during the wizard's DoRunEpilogue() method.
static MBSCustomPageData getPageData(java.lang.String pageID)
           
static boolean getPageHideStatus(java.lang.String Id)
           
static java.lang.Object getPageProperty(java.lang.String pageID, java.lang.String key)
          Retrieves a previously published piece of data associated with a wizard page.
static org.eclipse.jface.wizard.IWizardPage[] getPages()
          Gets the pages that the page manager knows about.
static org.eclipse.jface.wizard.IWizardPage getPreviousPage(java.lang.String currentPageID)
          Gets the previous page that should appear in the wizard.
static void init()
          Initializes the manager.
static boolean isPageVisible(java.lang.String pageID)
           
static void loadExtensions()
          Looks for contributions to the extension point org.eclipse.cdt.managedbuilder.ui.newWizardPages and adds all pages to the manager.
static void setPageHideStatus(java.lang.String Id, boolean status)
          Ability to hide pages explicitly, not depending of nature/projecttype filter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAGE_ID

public static final java.lang.String PAGE_ID
See Also:
Constant Field Values

NATURE_ID

public static final java.lang.String NATURE_ID
ID attribute of nature element

See Also:
Constant Field Values

VERSIONS_SUPPORTED

public static final java.lang.String VERSIONS_SUPPORTED
versions supported attribute of toolchain element

See Also:
Constant Field Values

TOOLCHAIN_ID

public static final java.lang.String TOOLCHAIN_ID
ID attribute of toolchain element

See Also:
Constant Field Values

PROJECT_TYPE_ID

public static final java.lang.String PROJECT_TYPE_ID
ID attribute of projectType element

See Also:
Constant Field Values

NATURE

public static final java.lang.String NATURE
nature element

See Also:
Constant Field Values

TOOLCHAIN

public static final java.lang.String TOOLCHAIN
toolchain element

See Also:
Constant Field Values

PROJECT_TYPE

public static final java.lang.String PROJECT_TYPE
project type element

See Also:
Constant Field Values

PAGE_CLASS

public static final java.lang.String PAGE_CLASS
attribute for the class associated witha wizardPage element

See Also:
Constant Field Values

OPERATION_CLASS

public static final java.lang.String OPERATION_CLASS
attribute for the operation that is run for a wizardPage during the wizard's DoRunEpilogue() method

See Also:
Constant Field Values

ID

public static final java.lang.String ID
ID attribute for wizardPage

See Also:
Constant Field Values

WIZARD_PAGE

public static final java.lang.String WIZARD_PAGE
element for a custom wizard page

See Also:
Constant Field Values
Method Detail

loadExtensions

public static void loadExtensions()
                           throws BuildException
Looks for contributions to the extension point org.eclipse.cdt.managedbuilder.ui.newWizardPages and adds all pages to the manager.

Throws:
BuildException
Since:
3.0

getPageData

public static MBSCustomPageData getPageData(java.lang.String pageID)
Parameters:
pageID - - The unique ID of the page to search for.
Returns:
- The MBSCustomPageData corresponding to the page, or null if not found.
Since:
3.0

isPageVisible

public static boolean isPageVisible(java.lang.String pageID)
Parameters:
pageID - - The unique ID of the page to be tested.
Returns:
true if the page is visible given the currently selected project type, nature, and toolchain. false otherwise.
Since:
3.0

addPageProperty

public static void addPageProperty(java.lang.String pageID,
                                   java.lang.String key,
                                   java.lang.Object data)
Publishes a piece of data associated with a wizard page. Clients (e.g. other wizard pages) can retrieve the values of these pieces of data later given the proper page ID and key.

Parameters:
pageID - - The unique ID of the page for which the data is being added.
key - - A unique name by which the data is referred to.
data - - The data to be stored. No assumptions are made about the type of data stored. It is up to the contributor of a given page to establish their own contract as to what type of data is stored.
Since:
3.0
See Also:
getPageProperty(String, String)

getPageProperty

public static java.lang.Object getPageProperty(java.lang.String pageID,
                                               java.lang.String key)
Retrieves a previously published piece of data associated with a wizard page.

Parameters:
pageID - - The unique ID of the page for which the data should be retrieved.
key - - The unique name of the data to be retrieved.
Returns:
The data that was stored for the given key. No assumptions are made about the type of data stored. It is up to the contributor of a given page to establish their own contract as to what type of data is stored. There are certain well known pieces of data published by the stock wizard pages provided by the Managed Build System. See org.eclipse.cdt.maangedbuilder.ui.wizards.CProjectPlatformPage.
Since:
3.0
See Also:
org.eclipse.cdt.maangedbuilder.ui.wizards.CProjectPlatformPage, addPageProperty(String, String, Object)

getNextPage

public static org.eclipse.jface.wizard.IWizardPage getNextPage(java.lang.String currentPageID)
Gets the next page that should appear in the wizard. This takes into account the selected project type, project nature, and toolchains.

Parameters:
currentPageID - - The unique ID of the page the wizard is currently displaying.
Returns:
The next page that should be displayed in the wizard, or null if at the end of the wizard.
Since:
3.0

addStockPage

public static void addStockPage(org.eclipse.jface.wizard.IWizardPage page,
                                java.lang.String pageID)
Adds an entry for a stock page into the manager. This is used for pages provided by the Managed Build System that are not loaded via the extension point mechanism.

Parameters:
page - - The IWizardPage to add.
pageID - - A unique ID to associate with this page. This ID will be used to refer to the page by the rest of the system.
Since:
3.0

getPreviousPage

public static org.eclipse.jface.wizard.IWizardPage getPreviousPage(java.lang.String currentPageID)
Gets the previous page that should appear in the wizard. This takes into account the selected project type, project nature, and toolchains. Stock pages can be returned by this method as well as custom pages.

Parameters:
currentPageID - - The unique ID of the page currently being displayed in the wizard.
Returns:
- The IWizardPage that corresponds to the previous page to be displayed in the wizard, or null if at the start of the wizard.
Since:
3.0

getPages

public static org.eclipse.jface.wizard.IWizardPage[] getPages()
Gets the pages that the page manager knows about.

Returns:
An array of IWizardPage objects corresponding to all pages the manager knows about. Pages are returned in the order they appear in the wizard, and include both stock and custom pages.
Since:
3.0
See Also:
getCustomPages()

getCustomPages

public static org.eclipse.jface.wizard.IWizardPage[] getCustomPages()
Gets all custom pages that the page manager knows about.

Returns:
An array of IWizardPage objects corresponding to all custom pages the manager knows about. Pages are returned in the order they appear in the wizard. Stock pages are not included.
Since:
3.0
See Also:
getPages()

getOperations

public static org.eclipse.jface.operation.IRunnableWithProgress[] getOperations()
Gets all operations that should be run during the wizard's DoRunEpilogue() method. Only operations for visible pages are returned.

Returns:
array of type Runnable[] corresponding to the operations.
Since:
3.0

init

public static void init()
Initializes the manager. This method should be called before any other operations are performed using this class, and should be called every time pages are added to the wizard.

Since:
3.0

setPageHideStatus

public static void setPageHideStatus(java.lang.String Id,
                                     boolean status)
Ability to hide pages explicitly, not depending of nature/projecttype filter

Parameters:
p - - page to hide
status - - true means hidden

getPageHideStatus

public static boolean getPageHideStatus(java.lang.String Id)