view com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/wizards/PluginXmlCreationWizard.java @ 135:eef52fe80553

Make wizard page names describe functionality Make it easier to share wizard pages between wizards by making names reflect purpose rather than which wizard is using them.
author Omair Majid <omajid@redhat.com>
date Tue, 03 Jun 2014 17:32:08 -0400
parents 1c4f192bf2e2
children
line wrap: on
line source

package com.redhat.thermostat.tools.eclipse.plugin.wizards;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;

import com.redhat.thermostat.tools.eclipse.plugin.Messages;

public class PluginXmlCreationWizard extends Wizard implements INewWizard {

    private PluginXmlProjectSelectionPage page;
    private ISelection selection;

    public PluginXmlCreationWizard() {
        super();
        setNeedsProgressMonitor(true);
    }

    @Override
    public void init(IWorkbench workbench, IStructuredSelection selection) {
        this.selection = selection;

        setWindowTitle(Messages.PluginXmlCreationWizard_windowTitle);
    }

    @Override
    public void addPages() {
        page = new PluginXmlProjectSelectionPage(selection);
        addPage(page);
    }

    @Override
    public boolean performFinish() {
        final String containerName = page.getContainerName();
        GuiPluginXmlCreator creator = new GuiPluginXmlCreator();
        return creator.createPluginWithFeedback(containerName, this);
    }

}