Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] Project capability support in M4 build

This e-mail is of interest to plug-in developers of project wizards...

In the build for M4 today, the new project capability feature was released
by both the core and ui teams. The workbench provides one project creation
wizard to the user. Plug-ins can provide capabilities to the project by
using the extension point org.eclipse.ui.capabilities. Users can add/remove
capabilities on a project any time. Capabilities is how project natures are
being exposed in the UI.

For backward compatibily, we will keep displaying old style project type
creation wizards in the "Other" dialog of File > New > Other.... (for this
release, the "Project..." menu item is still there but that will be dropped
later on when more plug-ins provide capabilities).

Refer to the documentation (in \doc directory of eclipse ui plugin) for
more details. It should be fairly easy to convert your existing new project
wizards into capability wizards. Here are a few pointers:

1) Make sure the name given to your nature is something useful that can be
displayed to the user. Do no use the word "nature" in the name as it is not
a concept exposed to the user. The nature name is also the capability name
and will be presented to the user as the name for a capability.

2) Remove menu items that "convert" the project to a new type (for example,
the "convert to PDE project"). Users will simply go to the properties of a
project to change what capabilities they need.

3) The nature extension point now has an element to specify prerequisite
natures and one-of sets. Update your nature extension (for example, the PDE
nature would require the Java nature).

4) Your capability install wizard (ICapabilityWizard) does not need to
create a project like the old project type wizards use to do. It is given a
project to work on. That project will exist in the workspace already.

5) No need for a page to ask for project name and location. That is already
taken care of by the workbench. Your capability wizard will be given a
project to work on (see number 4 above)

6) Update your remaining wizard pages to work in a capability wizard. Also
think about making these pages public API and modular so that dependent
capabilities can reuse them if necessary (see below about HandleUI
element).

7) There is a HandleUI element on capabilities. This allows a capability
that requires other capabilities to control the UI for these prerequisite
capabilities. It may choose to not show any pages, show some custom pages,
or show the actual pages for the prereq capabilities. Either way, the
capability who handles the UI for prerequisite capabilities is also
responsible for adding the nature of these prerequisite capabilities to the
project (and making sure the nature has enough information to configure
itself properly). For example, the PDE nature would be a dependent on Java
nature. The PDE capability would handle the UI for the Java capability. It
would then collect the information needed and add both the Java and PDE
natures to the project (note, it is possible the project may already have
the Java nature configured).

8) Once your capability wizard works properly and is released, remove your
new project type extension contribution to the org.eclipse.ui.newWizards
extension point (ie the wizard that shows up in the File > New > Project...
dialog).

Please let us know if you run into any limitations with the new way of
creating projects. Also, if there are any missing features or private
implementation you want to see as public API.

At this time, we have not yet fully decided what to do with the project
icon annotation extension point. That is, how if at all does it fit in the
new capability story. Also, there is no support for specifying the
perspective to switch to when a capability is added. These are two areas
yet to be decided on.

Thanks
Simon :-)




Back to the top