Wizards

FeatureExtension PointsClasses
ABS wizardsorg.eclipse.ui.newWizards org.eclipse.ui.navigator.navigatorContent#commonWizardeu.hatsproject.absplugin.wizards.NewABSFileWizard eu.hatsproject.absplugin.wizards.NewABSProjectWizard eu.hatsproject.absplugin.wizards.NewClassWizard eu.hatsproject.absplugin.wizards.NewInterfaceWizard eu.hatsproject.absplugin.wizards.NewModuleWizard
ABS wizard pages--eu.hatsproject.absplugin.wizards.pages.IABSClassInterfaceWizardPage eu.hatsproject.absplugin.wizards.pages.NewClassInFileWizardPage eu.hatsproject.absplugin.wizards.pages.NewInterfaceInFileWizardPage eu.hatsproject.absplugin.wizards.pages.NewModuleWizard
ABS wizard page composites--eu.hatsproject.absplugin.wizards.composites.ModuleGroup eu.hatsproject.absplugin.wizards.composites.ResourceGroup eu.hatsproject.absplugin.wizards.composites.CompositeGroup eu.hatsproject.absplugin.wizards.composites.ModuleGroupContentProvider eu.hatsproject.absplugin.wizards.composites.ResourceGroupContentProvider eu.hatsproject.absplugin.wizards.composites.ABSWizardStyledLabelProvider

ABS wizards

In eclipse wizards are a convenient method to create, import or export elements or files.

Within the ABS plug-in only new wizards are used so far, which can be added using the org.eclipse.ui.newWizards extension point. The addition of new wizard to this extension point extends the wizard selection page in File->New->Other... . If wizards should be added to the pop-up menu of the project explorer or the module explorer, they must be hooked into the respective views with the help of the org.eclipse.ui.navigator.navigatorContent#commonWizard extension point.

ABS wizard pages

Every wizard of the org.eclipse.ui.newWizards extension point needs a class implementing the logic of the wizard and adding one or more wizard pages. These pages are displayed one after another (in the order to their addition to the wizard) and can be traversed using the Next and Previous buttons in the wizard. These pages are added using the in the wizard class's addPages() method.

Example how to add wizard pages to a wizard:

@Override
public void addPages() {
        mainPage = new WizardNewProjectCreationPage("ABSProject");
        mainPage.setDescription("Create a new ABS Project");
        mainPage.setTitle("ABS Project");
        addPage(mainPage);
}

Each wizard page can determine if it contains a valid input and the user can go the next page. Only if all pages are valid, the wizard can be finished. In order to determine, whether a page is valid the wizard invokes the page's validate() method. If a page is not valid, an error message can be displayed in the parent wizard using the page's setErrorMessage(String).

If all wizards pages indicate their status as being valid and if the user clicked on the finish button, the wizard's performFinish() method is invoked. The performFinish() method is responsible for reading the respective result values out of the wizard's child pages. Moreover, is it responsible for actually creating new elements by creating appropriate files or insert text to their target location.

ABS wizard composites

In order to conveniently select select module declarations as well as existing *.abs files in wizards, both 'use cases' are encapsulated in a separate SWT composites. Each of these composites contains a JFace TreeViewer for easily selecting either module declarations or *.abs files.

The composite ResourceGroup is used for selecting *.abs files. The composite ModuleGroup is used for selecting single module declarations. Both composites have CompositeGroup as a common superclass. This class contains basic functionality (like creating overall dialog structure and the initialization of the TreeViewer) common to both composites.

Example how to use the ModuleGroup composite:

ModuleGroup moduleGroup = new ModuleGroup(parentComposite, changeListener, "Select a module declaration:");
...
moduleGroup.setSelectedResource(initialDecl);

As both composites contain JFace TreeViewers, they need their respective content and label providers - namely ResourceGroupContentProvider and ModuleGroupContentProvider, as well as ABSWizardStyledLabelProvider. For more information on how to build Content and Label providers for JFace viewers, see the content outline section of the Editor part of the developer documentation.