Example usage for org.eclipse.jface.dialogs StatusDialog setTitle

List of usage examples for org.eclipse.jface.dialogs StatusDialog setTitle

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs StatusDialog setTitle.

Prototype

public void setTitle(String title) 

Source Link

Document

Sets the title for this dialog.

Usage

From source file:org.eclipse.wst.xsl.internal.debug.ui.XSLLaunchShortcut.java

License:Open Source License

private void promptForInput() {
    // prompt for input xml file
    StatusDialog dialog = new StatusDialog(getShell()) {
        private InputFileBlock inputFileBlock = new InputFileBlock(null);

        @Override//from   www  . ja  v a  2  s  .  co  m
        protected Control createDialogArea(Composite parent) {
            Composite comp = (Composite) super.createDialogArea(parent);
            comp.setFont(parent.getFont());
            GridLayout layout = new GridLayout(1, false);
            comp.setLayout(layout);

            Label label = new Label(comp, SWT.NONE);
            label.setFont(comp.getFont());
            GridData gd = new GridData();
            gd.horizontalIndent = 5;
            gd.verticalIndent = 5;
            gd.widthHint = 380;
            label.setLayoutData(gd);
            label.setText(Messages.XSLLaunchShortcut_0);

            inputFileBlock.createControl(comp);
            return comp;
        }

        @Override
        protected void okPressed() {
            saveSelectedXmlFile();
            super.okPressed();
        }

        private void saveSelectedXmlFile() {
            IResource res = inputFileBlock.getResource();
            if (res == null)
                xmlFilePath = new Path(inputFileBlock.getText());
            else if (ResourcesPlugin.getWorkspace().getRoot().exists(res.getFullPath())
                    && res.getType() == IResource.FILE)
                xmlFile = (IFile) res;
        }
    };
    dialog.setHelpAvailable(false);
    dialog.setStatusLineAboveButtons(true);
    dialog.setTitle(Messages.XSLLaunchShortcut_1);
    dialog.open();
}

From source file:org.eclipse.wst.xsl.internal.debug.ui.XSLLaunchShortcut.java

License:Open Source License

private void promptForStylesheet() {
    // prompt for input xml file
    final LaunchPipeline promptedPipeline = new LaunchPipeline();

    StatusDialog dialog = new StatusDialog(getShell()) {
        private TransformsBlock transformsBlock = new TransformsBlock();

        @Override/*  w w w.ja v  a  2s .  co  m*/
        protected Control createDialogArea(Composite parent) {
            Composite comp = (Composite) super.createDialogArea(parent);
            comp.setFont(parent.getFont());
            GridLayout layout = new GridLayout(1, false);
            comp.setLayout(layout);

            Label label = new Label(comp, SWT.NONE);
            label.setFont(comp.getFont());
            GridData gd = new GridData();
            gd.horizontalIndent = 5;
            gd.verticalIndent = 5;
            gd.widthHint = 380;
            label.setLayoutData(gd);
            label.setText(Messages.XSLLaunchShortcut_7);

            promptedPipeline.setTransformDefs(new ArrayList<LaunchTransform>());
            transformsBlock.setPipeline(promptedPipeline);
            transformsBlock.createControl(comp);
            transformsBlock.initializeFrom(null);
            return comp;
        }

        @Override
        protected void okPressed() {
            savePipeline();
            super.okPressed();
        }

        private void savePipeline() {
            pipeline = promptedPipeline;
        }

    };
    dialog.setHelpAvailable(false);
    dialog.setStatusLineAboveButtons(true);
    dialog.setTitle(Messages.XSLLaunchShortcut_1);
    dialog.open();
}

From source file:org.jboss.tools.runtime.ui.internal.dialogs.RuntimeCheckboxTreeViewer.java

License:Open Source License

private void contentAssistChosen() {
    int problemIndex = popupTable.getSelectionIndex();
    if (problemIndex != -1) {
        RuntimeDefinition sel = getSelectedDefinition();
        RuntimeDetectionProblem[] s = sel.getProblems();
        if (problemIndex < s.length) {
            // TODO  run the content assist action
            // We now have the runtime definition and the chosen problem to be fixed
            final RuntimeDetectionProblem problem = s[problemIndex];
            IRuntimeDetectionResolution[] resolutions = RuntimeExtensionManager.getDefault()
                    .findResolutions(problem, sel);
            if (resolutions.length > 0) {
                // For now just execute the first one...  TODO expand
                resolutions[0].run(problem, sel);

                // The solution may have fixed several problems, not just one
                Object[] all = ((ITreeContentProvider) getContentProvider()).getElements(null);
                for (int i = 0; i < all.length; i++) {
                    if (all[i] instanceof RuntimeDefinition) {
                        ((RuntimeDefinition) all[i]).refreshProblems();
                    }//from   w  w  w  . ja va2s  .co  m
                }
                refresh();
            } else {
                // Show an error that no resolution could be found
                popupShell.setVisible(false);
                StatusDialog d = new StatusDialog(getTree().getShell()) {
                    protected Control createDialogArea(Composite parent) {
                        Composite composite = (Composite) super.createDialogArea(parent);

                        Label label = new Label(composite, SWT.WRAP);
                        GridData layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
                        layoutData.widthHint = convertWidthInCharsToPixels(80);
                        label.setLayoutData(layoutData);
                        label.setText("No quickfixes were found for the problem: " + problem.getDescription());
                        updateStatus(new Status(IStatus.ERROR, RuntimeUIActivator.PLUGIN_ID,
                                "No quickfixes found for the selected problem"));
                        Dialog.applyDialogFont(composite);
                        return composite;
                    }
                };
                d.setTitle("No quickfix available");
                d.open();
            }
        }
    }
    popupShell.setVisible(false);
}