Example usage for org.eclipse.jface.wizard WizardDialog setTitleImage

List of usage examples for org.eclipse.jface.wizard WizardDialog setTitleImage

Introduction

In this page you can find the example usage for org.eclipse.jface.wizard WizardDialog setTitleImage.

Prototype

public void setTitleImage(Image newTitleImage) 

Source Link

Document

Sets the title image to be shown in the title area of this dialog.

Usage

From source file:com.safi.workshop.NewSafiProjectAction.java

License:Open Source License

@Override
public void run() {
    // Create wizard selection wizard.
    IWorkbench workbench = PlatformUI.getWorkbench();

    ISelection selection = window.getSelectionService().getSelection();
    IStructuredSelection selectionToPass = StructuredSelection.EMPTY;
    if (selection instanceof IStructuredSelection) {
        selectionToPass = (IStructuredSelection) selection;
    }/*  w w w .  java 2  s  .c o m*/
    SafiBasicNewProjectResourceWizard wizard = new SafiBasicNewProjectResourceWizard();

    wizard.init(workbench, selectionToPass);

    WizardDialog dialog = new WizardDialog(null, wizard);
    dialog.setTitle("New Safi Project Wizard");

    dialog.setTitleImage(AsteriskDiagramEditorPlugin.getInstance()
            .getBundledImage("icons/server/resource/ServerResources.gif"));
    dialog.open();

    /*
     * SafiNewWizard wizard = new SafiNewWizard(); wizard.setProjectsOnly(true);
     * ISelection selection = window.getSelectionService().getSelection();
     * IStructuredSelection selectionToPass = StructuredSelection.EMPTY; if (selection
     * instanceof IStructuredSelection) { selectionToPass = (IStructuredSelection)
     * selection; } wizard.init(workbench, selectionToPass); IDialogSettings
     * workbenchSettings = IDEWorkbenchPlugin.getDefault() .getDialogSettings();
     * IDialogSettings wizardSettings = workbenchSettings
     * .getSection("NewWizardAction");//$NON-NLS-1$ if (wizardSettings == null) {
     * wizardSettings = workbenchSettings.addNewSection("NewWizardAction");//$NON-NLS-1$ }
     * wizard.setDialogSettings(wizardSettings);
     * wizard.setForcePreviousAndNextButtons(true);
     * 
     * // Create wizard dialog. WizardDialog dialog = new WizardDialog(null, wizard);
     * dialog.create(); dialog.getShell().setSize( Math.max(SIZING_WIZARD_WIDTH,
     * dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT);
     * PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(),
     * IIDEHelpContextIds.NEW_PROJECT_WIZARD);
     * 
     * // Open wizard. dialog.open();
     */
}

From source file:org.fusesource.ide.camel.editor.CamelGlobalConfigEditor.java

License:Open Source License

/**
 * creates a new entry in the treeviewer
 *///from  ww  w  .jav  a2s .  com
private void createNewEntry() {
    GlobalConfigElementsSelectionDialog dlg = new GlobalConfigElementsSelectionDialog(
            Display.getDefault().getActiveShell(), this, categoryContributions,
            new GlobalConfigElementsDialogContentProvider(), new GlobalConfigElementsDialogLabelProvider(),
            UIMessages.createGlobalElementDialogTitle, UIMessages.createGlobalElementDiaglogText);
    if (dlg.open() == Window.OK) {
        Object[] selection = dlg.getResult();
        if (selection != null && selection.length > 0) {
            Object selObj = selection[0];
            if (selObj instanceof GlobalConfigElementItem) {
                GlobalConfigElementItem item = (GlobalConfigElementItem) selObj;
                CamelFile cf = parentEditor.getDesignEditor().getModel();
                GlobalConfigurationTypeWizard wizard = item.getContributor()
                        .createGlobalElement(cf.getDocument());
                if (wizard == null)
                    return;
                WizardDialog wizdlg = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
                wizdlg.setBlockOnOpen(true);
                wizdlg.setTitle(UIMessages.newGlobalConfigurationTypeWizardDialogTitle);
                wizdlg.setTitleImage(null); // get a general icon or retrieve from contributor <- TODO!
                if (Window.OK == wizdlg.open()) {
                    Node newXMLNode = wizard.getGlobalConfigrationElementNode();
                    if (newXMLNode != null) {
                        switch (item.getContributor().getGlobalConfigElementType()) {
                        case GLOBAL_ELEMENT:
                            String id = ((Element) newXMLNode).getAttribute("id");
                            cf.addGlobalDefinition(Strings.isBlank(id) ? UUID.randomUUID().toString() : id,
                                    newXMLNode);
                            break;
                        case CONTEXT_DATAFORMAT:
                            CamelModelElement elemDF = new CamelModelElement(cf.getCamelContext(), newXMLNode);
                            cf.getCamelContext().addDataFormat(elemDF);
                            break;
                        case CONTEXT_ENDPOINT:
                            CamelModelElement elemEP = new CamelModelElement(cf.getCamelContext(), newXMLNode);
                            cf.getCamelContext().addEndpointDefinition(elemEP);
                            break;
                        default: // ignore
                            break;
                        }
                    }
                    List<Dependency> deps = item.getContributor().getElementDependencies();
                    if (deps != null && deps.isEmpty() == false) {
                        try {
                            MavenUtils.updateMavenDependencies(deps);
                        } catch (CoreException ex) {
                            CamelEditorUIActivator.pluginLog().logError(
                                    "Unable to update pom dependencies for element " + item.getName(), ex);
                        }
                    }
                }
            }
        }
    }
}

From source file:org.fusesource.ide.camel.editor.CamelGlobalConfigEditor.java

License:Open Source License

/**
 * modifies the selected entry/*from  w  ww .  j  av  a2s  .c  o m*/
 */
private void modifyEntry() {
    if (this.treeViewer.getSelection().isEmpty() == false) {
        IStructuredSelection sel = (IStructuredSelection) this.treeViewer.getSelection();
        Object o = Selections.getFirstSelection(sel);
        Element modElem = o instanceof Element ? (Element) o
                : o instanceof CamelModelElement ? (Element) ((CamelModelElement) o).getXmlNode() : null;
        ICustomGlobalConfigElementContribution extHandler = getExtensionForElement(modElem);
        if (extHandler != null) {
            GlobalConfigurationTypeWizard wizard = extHandler
                    .modifyGlobalElement(parentEditor.getDesignEditor().getModel().getDocument());
            if (wizard == null)
                return;
            wizard.setGlobalConfigrationElementNode(modElem);
            WizardDialog wizdlg = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
            wizdlg.setBlockOnOpen(true);
            wizdlg.setTitle(UIMessages.newGlobalConfigurationTypeWizardDialogTitle);
            wizdlg.setTitleImage(null); // get a general icon or retrieve from contributor <- TODO!
            if (Window.OK == wizdlg.open()) {
                Node newXMLNode = wizard.getGlobalConfigrationElementNode();
                if (newXMLNode == null)
                    return;
                switch (extHandler.getGlobalConfigElementType()) {
                case CONTEXT_DATAFORMAT: // here we need to reinit the model element so it copies all information from the node
                case CONTEXT_ENDPOINT:
                    CamelModelElement cme = (CamelModelElement) o;
                    cme.initialize();
                    break;
                case GLOBAL_ELEMENT:
                default: // nothing to do - handled via node events
                    break;
                }
                treeViewer.refresh(o, true);
            }
        }
    }
}

From source file:org.fusesource.ide.camel.editor.globalconfiguration.CamelGlobalConfigEditor.java

License:Open Source License

/**
 * modifies the selected entry//from   w  w  w  .  java2 s  .c o m
 */
private void modifyEntry() {
    if (!treeViewer.getSelection().isEmpty()) {
        IStructuredSelection sel = (IStructuredSelection) this.treeViewer.getSelection();
        Object o = Selections.getFirstSelection(sel);
        AbstractCamelModelElement cme = o instanceof AbstractCamelModelElement ? (AbstractCamelModelElement) o
                : null;
        ICustomGlobalConfigElementContribution extHandler = getExtensionForElement(cme);
        if (extHandler != null) {
            GlobalConfigurationTypeWizard wizard = extHandler
                    .modifyGlobalElement(parentEditor.getDesignEditor().getModel());
            if (wizard == null) {
                try {
                    new ShowPropertiesViewHandler().execute(null);
                } catch (ExecutionException e) {
                    CamelEditorUIActivator.pluginLog().logError(e);
                }
            } else {
                wizard.setGlobalConfigurationElementNode((Element) cme.getXmlNode());
                WizardDialog wizdlg = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
                wizdlg.setBlockOnOpen(true);
                wizdlg.setTitle(UIMessages.newGlobalConfigurationTypeWizardDialogTitle);
                wizdlg.setTitleImage(null); // TODO get a general icon or
                // retrieve from contributor <-
                if (Window.OK == wizdlg.open()) {
                    Node newXMLNode = wizard.getGlobalConfigurationElementNode();
                    if (newXMLNode == null) {
                        return;
                    }
                    switch (extHandler.getGlobalConfigElementType()) {
                    case CONTEXT_DATAFORMAT:
                        throw new UnsupportedOperationException();
                        // here we need to reinit the model element so it
                        // copies all information from the node
                    case CONTEXT_ENDPOINT:
                        throw new UnsupportedOperationException();
                    case GLOBAL_ELEMENT:
                        modifyGlobalElement(newXMLNode);
                        break;
                    default: // nothing to do - handled via node events
                        break;
                    }
                    treeViewer.refresh(o, true);
                }
            }
        }
    }
}

From source file:org.jboss.tools.jst.web.ui.wizards.appregister.AppRegisterWizard.java

License:Open Source License

public int execute() {
    Shell shell = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
    WizardDialog dialog = new WizardDialog(shell, this);
    dialog.create();/*from   w  w  w.j av a 2  s . com*/
    dialog.getShell().setText("" + p.getProperty("title")); //$NON-NLS-1$ //$NON-NLS-2$
    dialog.setTitleImage(ModelUIImages.getImage(ModelUIImages.WIZARD_DEFAULT));
    return dialog.open();
}

From source file:org.jboss.tools.struts.ui.wizard.addstruts.AddStrutsSupportWizard.java

License:Open Source License

public static int run(Shell shell, ImportWebDirProjectContext context) {
    AddStrutsSupportWizard wizard = new AddStrutsSupportWizard(context);
    WizardDialog dialog = new WizardDialog(shell, wizard);
    dialog.create();//  ww w .ja  v a 2 s.  c o  m
    dialog.getShell().setText("Add Struts Support");
    dialog.setTitle("Struts Project");
    dialog.setTitleImage(ModelUIImages.getImage(ModelUIImages.WIZARD_DEFAULT));
    return dialog.open();
}

From source file:org.nabucco.testautomation.config.ui.rcp.command.config.execute.TestConfigExecutionJob.java

License:Open Source License

private boolean userRequest(final TestConfigurationResult result) {
    Display.getDefault().syncExec(new Runnable() {

        @Override// w  w w.ja  v a2 s.co m
        public void run() {
            ManualTestWizard wizard = new ManualTestWizard(result, configuration, info);
            wizard.init(Activator.getDefault().getWorkbench(), StructuredSelection.EMPTY);
            WizardDialog wizardDialog = new WizardDialog(null, wizard);
            wizardDialog.setBlockOnOpen(true);
            wizardDialog.setPageSize(600, 450);
            wizardDialog.setTitleImage(ImageProvider.createImage(ConfigImageRegistry.ICON_CONFIG.getId()));
            wizardDialog.open();
        }
    });
    return manualTestResultFinished;
}

From source file:org.nabucco.testautomation.result.ui.rcp.command.result.CollectiveJiraExportHandlerImpl.java

License:Open Source License

@Override
public void collectiveJiraExport() {

    Display.getDefault().syncExec(new Runnable() {

        @Override/*from   w  ww  .  j  a  v  a2 s.  c o  m*/
        public void run() {
            TestConfigurationResultMaintenanceMultiPageEditView view = (TestConfigurationResultMaintenanceMultiPageEditView) Activator
                    .getDefault().getView(TestConfigurationResultMaintenanceMultiPageEditView.ID);
            TestConfigurationResult testConfigurationResult = view.getModel().getTestConfigurationResult();

            JiraBulkExportWizard wizard = new JiraBulkExportWizard(testConfigurationResult);
            wizard.init(Activator.getDefault().getWorkbench(), StructuredSelection.EMPTY);
            WizardDialog wizardDialog = new WizardDialog(null, wizard);
            wizardDialog.setBlockOnOpen(true);
            wizardDialog.setPageSize(600, 400);
            wizardDialog.setTitleImage(ImageProvider.createImage(ResultImageRegistry.ICON_JIRA.getId()));
            wizardDialog.open();
        }
    });

}

From source file:org.nabucco.testautomation.result.ui.rcp.command.result.JiraExportHandlerImpl.java

License:Open Source License

@Override
public void jiraExport() {
    Display.getDefault().syncExec(new Runnable() {

        @Override/*from ww  w. ja  v  a  2  s . c  om*/
        public void run() {
            TestConfigurationResultMaintenanceMultiPageEditView view = (TestConfigurationResultMaintenanceMultiPageEditView) Activator
                    .getDefault().getView(TestConfigurationResultMaintenanceMultiPageEditView.ID);
            TestResult testResult = (TestResult) ((MasterDetailTreeNode) ((IStructuredSelection) view
                    .getMasterDetailsBlock().getTreeViewer().getSelection()).getFirstElement()).getDatatype();
            TestConfigurationResult testConfigurationResult = view.getModel().getTestConfigurationResult();

            JiraExportWizard wizard = new JiraExportWizard(testConfigurationResult, testResult);
            wizard.init(Activator.getDefault().getWorkbench(), StructuredSelection.EMPTY);
            WizardDialog wizardDialog = new WizardDialog(null, wizard);
            wizardDialog.setBlockOnOpen(true);
            wizardDialog.setPageSize(600, 400);
            wizardDialog.setTitleImage(ImageProvider.createImage(ResultImageRegistry.ICON_JIRA.getId()));
            wizardDialog.open();
        }
    });

}