From 21f564232c8f4d1af5abbb2308b3e1fbdf4bf310 Mon Sep 17 00:00:00 2001 From: Chris Recoskie Date: Thu, 8 Jun 2006 19:31:05 +0000 Subject: update to MBS extensibility guide for custom wizard page support --- doc/org.eclipse.cdt.doc.isv/.contentsettings | 4 + doc/org.eclipse.cdt.doc.isv/.project | 6 +- .../guide/mbs/extensibilityGuide/IWizardPage.jpeg | Bin 0 -> 10136 bytes .../mbs/extensibilityGuide/MBSCustomPage.jpeg | Bin 0 -> 12694 bytes .../mbs/extensibilityGuide/MBSCustomPageData.jpeg | Bin 0 -> 31484 bytes .../extensibilityGuide/MBSCustomPageManager.jpeg | Bin 0 -> 37716 bytes .../Managed_Build_Extensibility.html | 571 ++++++++++++++++++++- .../guide/mbs/extensibilityGuide/classdiagram.jpeg | Bin 0 -> 209886 bytes .../mbs/extensibilityGuide/classdiagram2.jpeg | Bin 0 -> 92829 bytes .../guide/mbs/extensibilityGuide/clip_image001.jpg | Bin 0 -> 11888 bytes 10 files changed, 573 insertions(+), 8 deletions(-) create mode 100644 doc/org.eclipse.cdt.doc.isv/.contentsettings create mode 100644 doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/IWizardPage.jpeg create mode 100644 doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPage.jpeg create mode 100644 doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPageData.jpeg create mode 100644 doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPageManager.jpeg create mode 100644 doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/classdiagram.jpeg create mode 100644 doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/classdiagram2.jpeg create mode 100644 doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/clip_image001.jpg diff --git a/doc/org.eclipse.cdt.doc.isv/.contentsettings b/doc/org.eclipse.cdt.doc.isv/.contentsettings new file mode 100644 index 00000000000..8ccdd3e8523 --- /dev/null +++ b/doc/org.eclipse.cdt.doc.isv/.contentsettings @@ -0,0 +1,4 @@ + + + + diff --git a/doc/org.eclipse.cdt.doc.isv/.project b/doc/org.eclipse.cdt.doc.isv/.project index 66c3b1b41a2..71b0805f150 100644 --- a/doc/org.eclipse.cdt.doc.isv/.project +++ b/doc/org.eclipse.cdt.doc.isv/.project @@ -7,7 +7,6 @@ org.eclipse.ui.externaltools.ExternalToolBuilder - full,incremental, LaunchConfigHandle @@ -25,6 +24,11 @@ + + com.ibm.sse.model.structuredbuilder + + + org.eclipse.pde.PluginNature diff --git a/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/IWizardPage.jpeg b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/IWizardPage.jpeg new file mode 100644 index 00000000000..f792cc85f39 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/IWizardPage.jpeg differ diff --git a/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPage.jpeg b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPage.jpeg new file mode 100644 index 00000000000..44416375c37 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPage.jpeg differ diff --git a/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPageData.jpeg b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPageData.jpeg new file mode 100644 index 00000000000..c3f06088755 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPageData.jpeg differ diff --git a/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPageManager.jpeg b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPageManager.jpeg new file mode 100644 index 00000000000..6ba7a1c40d3 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/MBSCustomPageManager.jpeg differ diff --git a/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/Managed_Build_Extensibility.html b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/Managed_Build_Extensibility.html index a1837b9d82f..a4736c46421 100644 --- a/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/Managed_Build_Extensibility.html +++ b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/Managed_Build_Extensibility.html @@ -79,7 +79,7 @@ managed build system and how to extend it. - + @@ -89,6 +89,9 @@ managed build system and how to extend it. + + + @@ -133,8 +136,8 @@ managed build system and how to extend it.
Table of Contents

1 Introduction - - +
1.1 Who Needs This Information
+
1.2 Managed Build System Overview
2 User Model @@ -6948,11 +6951,565 @@ public boolean isOptionEnabled(
extension point.  To specify a dynamic element provider, your build definitions must define a dynamicElementProvider element as described in § 3.19.

7.14 Adding Custom Pages to the New Project Wizard

-

This section will be provided in a future version of the document.  For -now, refer to the Custom Project Wizard Pages design document in bugzilla -#90334.

+ + + + + -

7.15 Defining Startup Behavior for Configuration Loading

+

One aspect that toolchain developers have requested +more flexibility in is the ability to customize the new project wizard.  Developers wish to be able to +add custom pages to the wizard to facilitate such things as +automatically setting launch properties for the project, generating +configuration files for the project, and other various custom settings +and behaviour.
+
+Developers might wish that such customizations be +toolchain specific, or possibly be global to all toolchains.  At the same time or separately, +they may wish their pages to appear only when a project is of a certain +nature (e.g. C vs. C++) or for certain project types (e.g. executable +vs. library).
+
External interfaces are provided by a single +extension point:
+
7.14.1 org.eclipse.cdt.managedbuilder.ui.newWizardPages

+

This extension point allows for the specification +of pages to the New Managed C/C++ wizards.  +Via this extension point, the developer may specify one or more +wizard pages to add to the wizard, and optionally only add these pages +if certain conditions on the project type, project toolchain, and +project nature are met.  The +developer may also specify a Java class which performs any operations +pursuant to the state of the wizard when the user clicks Finish.

+

7.14.1.1 Schema

+

7.14.1.1.1 wizardPage Element

+

One or more instances of this element are required.  Each instance of this element +defines an additional page which is added to the New Project wizard.  Pages are added after the +default pages provided by MBS.  Pages +are added in the order they are discovered.

+

Note that the IWizardPage interface allows a page +to specify programmatically and dynamically at runtime what its previous +and next pages are.  This +element does not trump that behaviour, but rather just specifies the +order in which the pages are added to the wizard (and hence the order in +which the pages appear if they do not override the previous and next +page methods).

+

For convenience, here is a UML class diagram of the +IWizardPage interface.
+
+ +
+
Wizard pages as GUI elements by +themselves are really not all that useful.  +More than likely if someone is defining their own wizard pages +it?s because they need some additional operations to happen upon project +creation in addition to the stock behaviour of creating a basic project, +and they want to use their new wizard pages to provide a front end to +these operations.

+

As such, along with a specification +of the GUI wizard page, ISVs may specify a runnable operation that will +be executed in the wizard?s doRunEpilogue() method.  These contributions will all be +executed in the order that the wizard pages were added to the wizard.  Not all pages need have such a +contribution however, as ISVs may need to perform all the operations +associated with their pages as a group.  +In cases such as this the ISV can define an operation for one of +the pages and it can pull data from any of the other pages as required. + +

+

wizardPage +Element Schema:

+
AuthorsAuthors Sean Evoy
Mikhail Sennikovsky
Chris Recoskie
Revision Date 10/21/2003 - Version: 0.1.0
+ + + + + + + + + + + + + + + + + + + + +
+

Attribute

+
+

Description

+
+

Required?

+
+

Id

+
+

A unique identifier for + the page which will be used to reference the page

+
+

Yes

+
+

pageClass

+
+

Specifies the Java class + which implements the added page.  + This class must implement the org.eclipse.jface.wizard.IWizardPage + interface

+
+

Yes

+
+

operationClass

+
+

Specifies the Java class + which implements the operations associated with this page.  The class must implement the + + java.lang.Runnable interface

+
+

No

+
+

7.14.1.1.2 projectType element

+

This is an optional child element of wizardPage +which specifies a projectType for which the additional pages should +apply.  One instance of this +element is provided per toolchain supported by the page.

+

If no projectType elements are specified, then it +is assumed that the page potentially applies to all projectTypes, +although it may still be excluded based on toolchain (§7.14.1.1.3) or project nature (§4.1.1.1.4).

+

projectType Element Schema:

+ + + + + + + + + + + +
+

Attribute

+
+

Description

+
+

Required?

+
+

projectTypeID

+
+

The unique ID of a + projectType for which this page should appear.

+
+

Yes

+
+

7.14.1.1.3 toolchain Element

+

This is an optional child element of wizardPage +which specifies a toolchain for which the additional pages should apply.  One instance of this element is +provided per toolchain supported by the page.

+

If no toolchain elements are specified, +then it is assumed that the page potentially applies to all toolchains, +although it may still be excluded based on project type (§7.14.1.1.2) or project nature (§7.14.1.1.4)

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +toolchain +Element Schema

+ + + + + + + + + + + + + + + + + + +
+

Attribute

+
+

Description

+
+

Required?

+
+

toolchainID

+
+

The unique ID of a + toolchain for which this page should appear.

+
+

Yes

+
+

versionsSupported

+
+

A comma separated list of + specific versions of the toolchain that are supported by the page.  If not specified, it is + assumed that this page supports the toolchain regardless of version.

+
+

No

+
+

7.14.1.1.4 nature Element

+

This optional child element of wizardPage specifies +the project nature(s) for which the additional pages should apply.   One +instance of this element is provided per nature supported.

+

 This +would for example allow one to add pages to the New Managed C Project +wizard but not the New Managed C++ project wizard, or other hypothetical +natures that might be supported by MBS in the future (e.g. someday there +might be a Fortran nature).

+

If no natureID elements are specified, then it is +assumed that the page potentially applies to all project natures, +although it may still be excluded based on project type (§7.14.1.1.2) or toolchain (§4.1.1.1.3)

+

natureID element Schema:

+ + + + + + + + + + + + + +
+

Attribute

+
+

Description

+
+

Required?

+
+

natureID

+
+

The unique ID of a nature + (org.eclipse.core.resources.natures) for which this page should + appear.

+
+

Yes

+
+


+
7.14.2 High-Level Architecture
+
7.14.2.1 System Overview
+
The custom wizard pages subsystem in MBS is responsible for managing:

+ +


The main entry point to the system is a central manager class calledl MBSCustomPageManager.  This +class is responsible for managing classes which handle the +aggregation of page data (MBSCustomPageData).

+

For convenience sake, an abstract base class for wizard pages exists (MBSCustomPage) which ISVs can subclass to implement the default behaviour of +allowing the page manager to completely control the ordering of pages.

+

The following class diagram shows how these +new classes fit into the existing wizard system in MBS in terms of class +hierarchies and associations.

+ +

+
Figure 12: High level view of MBS wizard system
+


+As you can see in Figure 12, there are two MBS wizards, one for C projects and one for C++. These +wizards ultimately inherit some of their behaviour from the generic +wizards provided by the CDT's core UI. There are several wizard pages that always appear in the MBS wizard, which allow the user to select the project name, project location, and MBS project type for their project. The wizards defer to the MBSCustomPageManager to handle any custom pages that might be present in the system.

+


7.14.3 Low-Level Architecture +

+


Drilling down into the custom wizard page system itself, we see the following:
+
+ +

+
Figure 12: High level view of custom wizard system
+


The MBSCustomPageManager class is the main entry point to the system. It is responsible for loading all of the extensions which provide custom wizard pages, and storing that data for later use by the wizard. It keeps a list of records of these pages (MBSCustomPageData) which act as a repository for everything that needs to be known about the page, including what circumstances it should be shown under, and what actual IWizardPage should be shown when the page is displayed.
+
For convenience, there is an abstract base class (MBSCustomPage) which ISVs can subclass to get the most commonly desired behaviour from their pages. Most notably, the provided implementation contained in this class consults the MBSCustomPageManager to determine what wizard pages appear before and after the page, which is necessary to ensure that all custom pages in the system are displayed when they should be.
+
7.14.3.1 MBSCustomPageManager

+

This class is responsible +for:

+ +


This class is a singleton. +All non-constructor methods are static.

+

When the wizard is initialized, it +makes a call to MBSCustomPageManager.loadExtensions(). This method looks contributions to the org.eclipse.cdt.managedbuilder.ui.newWizardPages +extension point.  The loaded data is used to +instantiate and populate an MBSCustomPageData object for each page +discovered.

+

As the user manipulates the wizard, each page can +publish data they wish to export for use by other pages.  This is done via the +addPageProperty() method, which allows for the storage of string data by +string key, using the string ID of the page as a sort of namespace.  The data can be +retrieved by other pages via the getPageProperty() method, and this is the standard way for pages to interface to eachother.

+

Individual pages are expected to somehow consult +the getNextPage() and getPreviousPage() methods of the manager when +their own getNextPage() and getPreviousPage() methods are called by the +wizard.  This allows the +pages to properly navigate amongst eachother while taking into account +user choices such as project nature, toolchain, and project type.  It should be noted that the +manager can only do so much as it fills the role of an advisor.  Custom pages are still +theoretically free to ignore its existence, although this is strongly +discouraged.
+
+ +
+
+ + +

+

7.14.3.2 MBSCustomPageData +

+

This class provides data aggregation capabilities +for the page manager to store information on a custom wizard page.  On startup, the page manager +loads all contributions to the newWizardPages extension point, and +stores the loaded data in these records for later use. There is a nested class, ToochainData, which is used to maintain information on each individual toolchain a given custom page supports. The MBSCustomPage manager calls various methods on this class (e.g. MBSCustomPageData.shouldBeVisibleForNature()) to determine when a given page should be visible in the wizard.
+
+ +

+


+7.14.3.3 + +MBSCustomPage + +

+

This abstract class provides a convenient, partial +implementation of the IWizardPage interface.  This class provides +implementations of the getNextPage() and getPreviousPage() methods which +consult with the page manager to determine which pages are to be +displayed.  If an ISV?s +custom pages do not subclass MBSCustomPage then their page +implementation must be carefully coded to function properly while still +respecting the rules laid out by the page manager.
+
+ +
+
7.14.4 Limitations
+
+ + +Currently there is no way for ISVs to +intermingle their wizard pages amidst the ones defined in MBS, or amidst +the ones created by other plugins in general.  In the future it might be +possible to provide an extension point which would allow an ISV to +customize this ordering for their product.

+

This would +be problematic though as it would be possible for multiple ISVs to +attempt to specify such an ordering within the same installation of +Eclipse/CDT.

+

It would +also be problematic as certain custom pages would rely on the selected +project type or toolchain, and with a reordering mechanism, ISVs would +have to be careful to not try to put such pages ahead of the page on +which that data is selected.  If +a developer were reordering pages that they themselves did not create, +they would have to tread extremely carefully to properly manage these +and other ordering constraints.

+

7.15 Defining Startup Behavior for Configuration Loading

Tool integrators may require that a plugin contain all the build configurations before projects are loaded. Use of this interface insures that a plugin will have access to build configurations before project inforamation is loaded in the workbench. Two methods can be used to access configuration information just after build definitions have been loaded and then again after the build definitions have been resolved. Added as enhancement to bug 123275.

public interface IManagedBuildDefinitionsStartup {

diff --git a/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/classdiagram.jpeg b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/classdiagram.jpeg new file mode 100644 index 00000000000..03f6d25a7de Binary files /dev/null and b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/classdiagram.jpeg differ diff --git a/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/classdiagram2.jpeg b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/classdiagram2.jpeg new file mode 100644 index 00000000000..aabe897c1db Binary files /dev/null and b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/classdiagram2.jpeg differ diff --git a/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/clip_image001.jpg b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/clip_image001.jpg new file mode 100644 index 00000000000..89d7786fbdf Binary files /dev/null and b/doc/org.eclipse.cdt.doc.isv/guide/mbs/extensibilityGuide/clip_image001.jpg differ -- cgit v1.2.3