Example usage for org.eclipse.jface.dialogs IDialogConstants CLOSE_LABEL

List of usage examples for org.eclipse.jface.dialogs IDialogConstants CLOSE_LABEL

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs IDialogConstants CLOSE_LABEL.

Prototype

String CLOSE_LABEL

To view the source code for org.eclipse.jface.dialogs IDialogConstants CLOSE_LABEL.

Click Source Link

Document

The label for close buttons.

Usage

From source file:com.minres.scviewer.e4.application.parts.AboutDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    // create OK button
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.CLOSE_LABEL, true);
}

From source file:com.nokia.carbide.cpp.internal.project.ui.editors.common.CarbideFormEditor.java

License:Open Source License

/**
 * If the file has been deleted, and the editor is dirty,
 * offer to save the file or close the editor.
 *//*  w  ww  . j ava2  s  . co m*/
protected void handleResourceDeleted() {
    // offer user the choice of saving the file or closing the editor
    boolean doSaveAs = false;
    if (isDirty()) {
        MessageDialog dialog = new MessageDialog(getSite().getShell(),
                Messages.CarbideFormEditor_saveResourceTitle, null,
                Messages.CarbideFormEditor_saveResourceMessage, MessageDialog.INFORMATION,
                new String[] { Messages.CarbideFormEditor_saveResourceLabel, IDialogConstants.CLOSE_LABEL }, 0);
        if (dialog.open() == 0) {
            doSaveAs = true;
            resourceDeleted = false;
        }
    }

    // save the file or close the editor at the next reasonable opportunity
    final boolean saveAs = doSaveAs;
    Display.getDefault().asyncExec(new Runnable() {
        public void run() {
            if (saveAs)
                doSaveAs();
            else
                getSite().getPage().closeEditor(CarbideFormEditor.this, false);
        }
    });
}

From source file:com.nokia.carbide.remoteconnections.internal.ui.DeviceDiscoveryPrequisiteErrorDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // OK button == "Close"
    // no Cancel button
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.CLOSE_LABEL, true);
}

From source file:com.nokia.s60tools.crashanalyser.ui.dialogs.ErrorLibraryDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.CLOSE_LABEL, false);
    setHelps();
}

From source file:com.nokia.tools.theme.s60.ui.dialogs.KeyPairsDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, false);
}

From source file:com.salesforce.ide.core.internal.utils.DialogUtils.java

License:Open Source License

public int closeMessage(String title, String message) {
    MessageDialog dialog = new MessageDialog(getShell(), title, null, message, MessageDialog.INFORMATION,
            new String[] { IDialogConstants.CLOSE_LABEL }, IDialogConstants.CLOSE_ID);
    return dialog.open();
}

From source file:com.sap.netweaver.porta.ide.eclipse.server.ui.dialogs.NoWSGateDialog.java

License:Open Source License

public NoWSGateDialog(Shell parentShell, NoWSGateException exception) {
    super(parentShell, "Deploy Web Service Not Available", null, /* dialogTitleImage */
            exception.getLocalizedMessage(), MessageDialog.WARNING,
            new String[] { "&Open Instructions", IDialogConstants.CLOSE_LABEL }, 0);
    this.endpoint = exception.getEndpoint();
}

From source file:com.sap.netweaver.porta.ide.eclipse.server.ui.dialogs.PublishProblemDialog.java

License:Open Source License

public PublishProblemDialog(Shell parentShell, PublishException exception) {
    super(parentShell, "Publishing Problem", null, /* dialogTitleImage */
            exception.getMessage(), getImage(exception.getDeployResult().getStatus()),
            new String[] { IDialogConstants.SHOW_DETAILS_LABEL, IDialogConstants.CLOSE_LABEL }, 1);
    this.exception = exception;
    setShellStyle(getShellStyle() | SWT.RESIZE);
}

From source file:com.versant.core.jdo.tools.plugins.eclipse.dialogs.WriterOutputDialog.java

License:Open Source License

public WriterOutputDialog(Shell parentShell, String dialogTitle, String dialogMessage) {
    super(parentShell, dialogTitle, null, dialogMessage, MessageDialog.INFORMATION,
            new String[] { IDialogConstants.CLOSE_LABEL }, 0);
    writer = new Writer() {
        public void close() throws IOException {
            final Runnable run = new Runnable() {
                public void run() {
                    if (closeWhenDone.getSelection()) {
                        WriterOutputDialog.this.close();
                    } else {
                        closeWhenDone.setEnabled(false);
                        getButton(0).setEnabled(true);
                    }//from  w  w w. ja va2  s.  c  o m
                }
            };
            if (text != null && !text.isDisposed()) {
                try {
                    text.getDisplay().asyncExec(run);
                } catch (RuntimeException e) {
                    VOAToolsPlugin.log(e);
                }
            }
        }

        public void flush() throws IOException {
        }

        public void write(char[] cbuf, int off, int len) throws IOException {
            final String add = new String(cbuf, off, len);
            final Runnable run = new Runnable() {
                public void run() {
                    text.append(add);
                }
            };
            if (text != null && !text.isDisposed()) {
                try {
                    text.getDisplay().asyncExec(run);
                } catch (RuntimeException e) {
                    VOAToolsPlugin.log(e);
                }
            }
        }
    };
    printWriter = new PrintWriter(writer, true);
}

From source file:de.blizzy.backup.BackupApplication.java

License:Open Source License

@Override
public Object start(IApplicationContext context) {
    display = Display.getDefault();/*from  ww w.  j  a  v a 2  s  . c o m*/

    boolean restartNecessary = false;

    File runLockFile = new File(BackupPlugin.getDefault().getStateLocation().toFile(), "runLock"); //$NON-NLS-1$
    RunLock runLock = new RunLock(runLockFile);
    if (runLock.tryLock()) {
        setupDefaultPreferences();

        Image image16 = AbstractUIPlugin.imageDescriptorFromPlugin(BackupPlugin.ID, "etc/logo/logo_16.png") //$NON-NLS-1$
                .createImage(display);
        Image image32 = AbstractUIPlugin.imageDescriptorFromPlugin(BackupPlugin.ID, "etc/logo/logo_32.png") //$NON-NLS-1$
                .createImage(display);
        Image image48 = AbstractUIPlugin.imageDescriptorFromPlugin(BackupPlugin.ID, "etc/logo/logo_48.png") //$NON-NLS-1$
                .createImage(display);
        windowImages = new Image[] { image16, image32, image48 };

        settingsManager = new SettingsManager();
        settingsManager.addListener(new ISettingsListener() {
            @Override
            public void settingsChanged() {
                if (backupRun == null) {
                    scheduleBackupRun(false);
                }
            }
        });

        timer = new Timer();

        scheduleBackupRun(false);

        trayIcon = new TrayIcon(display);

        context.applicationRunning();

        if (!BackupPlugin.getDefault().isHidden()) {
            showShell();
        }

        try {
            Shell shell = (backupShell != null) ? backupShell.getShell() : null;
            if (new Updater(false, false).update(shell)) {
                running = false;
                restartNecessary = true;
            }
        } catch (Throwable e) {
            BackupPlugin.getDefault().logError("error while updating application", e); //$NON-NLS-1$
        }

        while (running && !display.isDisposed()) {
            try {
                if (!display.readAndDispatch()) {
                    display.sleep();
                }
            } catch (RuntimeException e) {
                BackupPlugin.getDefault().logError("error in event loop", e); //$NON-NLS-1$
            }
        }

        trayIcon.dispose();

        timer.cancel();
        timer = null;

        image16.dispose();
        image32.dispose();
        image48.dispose();

        if (backupRun != null) {
            backupRun.stopBackupAndWait();
        }
    } else {
        new MessageDialog(null, Messages.Title_ProgramRunning, null, Messages.ProgramRunning,
                MessageDialog.ERROR, new String[] { IDialogConstants.CLOSE_LABEL }, 0).open();
    }

    return restartNecessary ? EXIT_RESTART : EXIT_OK;
}