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

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

Introduction

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

Prototype

int NO_ID

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

Click Source Link

Document

Button id for a "No" button (value 3).

Usage

From source file:eu.geclipse.ui.internal.transfer.TransferResumeDialog.java

License:Open Source License

private void noPressed() {
    setReturnCode(IDialogConstants.NO_ID);
    close();
}

From source file:eu.modelwriter.marker.command.AddRemoveTypeHandler.java

License:Open Source License

private void addRemoveType() {
    if (!MarkerPage.isParsed()) {
        final MessageDialog parseCtrlDialog = new MessageDialog(MarkerActivator.getShell(), "Type Information",
                null,/* w w  w  .j a va2 s . c o  m*/
                "You dont have any marker type registered to system! \n" + "Please parse an alloy file first",
                MessageDialog.INFORMATION, new String[] { "OK" }, 0);
        parseCtrlDialog.open();
        return;
    }

    final ActionSelectionDialog actionSelectionDialog = new ActionSelectionDialog(MarkerActivator.getShell());
    actionSelectionDialog.open();
    if (actionSelectionDialog.getReturnCode() == IDialogConstants.CANCEL_ID) {
        return;
    }

    if (selectedMarker != null && selectedMarker.exists()) {
        findCandidateToTypeChangingMarkers(selectedMarker);
        if (actionSelectionDialog.getReturnCode() == IDialogConstants.YES_ID) {
            addType(selectedMarker);
        } else if (actionSelectionDialog.getReturnCode() == IDialogConstants.NO_ID) {
            final MessageDialog warningDialog = new MessageDialog(MarkerActivator.getShell(), "Warning!", null,
                    "If you remove marker's type, all relations of this marker has been removed! Do you want to continue to remove marker's type?",
                    MessageDialog.WARNING, new String[] { "Yes", "No" }, 0);
            final int returnCode = warningDialog.open();
            if (returnCode != 0) {
                return;
            }
            removeType(selectedMarker);
        }
        // MarkerUpdater.updateTargets(selectedMarker);
        // MarkerUpdater.updateSources(selectedMarker);
    } else {
        final MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(),
                "There is no marker in this position", null, "Please select valid marker",
                MessageDialog.INFORMATION, new String[] { "Ok" }, 0);
        dialog.open();
        return;
    }
}

From source file:eu.modelwriter.marker.ui.internal.views.visualizationview.commands.AddRemoveTypeCommand.java

License:Open Source License

private void addRemoveType() {
    if (!MarkerPage.isParsed()) {
        final MessageDialog parseCtrlDialog = new MessageDialog(Activator.getShell(), "Type Information", null,
                "You dont have any marker type registered to system! \n" + "Please parse an alloy file first",
                MessageDialog.INFORMATION, new String[] { "OK" }, 0);
        parseCtrlDialog.open();/*from w w w.ja  va2s .c  o m*/
        return;
    }

    final ActionSelectionDialog actionSelectionDialog = new ActionSelectionDialog(Activator.getShell());
    actionSelectionDialog.open();
    if (actionSelectionDialog.getReturnCode() == IDialogConstants.CANCEL_ID) {
        return;
    }

    IMarker selectedMarker = this.marker;
    selectedMarker = MarkUtilities.getLeaderOfMarker(selectedMarker);

    if (selectedMarker != null && selectedMarker.exists()) {
        this.findCandidateToTypeChangingMarkers(selectedMarker);
        if (actionSelectionDialog.getReturnCode() == IDialogConstants.YES_ID) {
            AddRemoveTypeCommand.addType(selectedMarker);
        } else if (actionSelectionDialog.getReturnCode() == IDialogConstants.NO_ID) {
            final MessageDialog warningDialog = new MessageDialog(Activator.getShell(), "Warning!", null,
                    "If you remove marker's type, all relations of this marker has been removed! Do you want to continue to remove marker's type?",
                    MessageDialog.WARNING, new String[] { "YES", "NO" }, 0);
            final int returnCode = warningDialog.open();
            if (returnCode != 0) {
                return;
            }
            this.removeType(selectedMarker);
        }
    } else {
        final MessageDialog dialog = new MessageDialog(Activator.getShell(),
                "There is no marker in this position", null, "Please select valid marker",
                MessageDialog.INFORMATION, new String[] { "OK" }, 0);
        dialog.open();
        return;
    }
}

From source file:fr.inria.soctrace.tools.ocelotl.ui.views.OcelotlSettingsView.java

License:Open Source License

/**
 * Add button to save the settings/*from   ww  w .  j  a v  a  2  s .  c o m*/
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    // Change parent layout data to fill the whole bar
    parent.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    saveSettingsButton = createButton(parent, IDialogConstants.NO_ID, "Save Settings", false);
    saveSettingsButton.setToolTipText("Set Current Settings as Default Ocelotl Settings");
    saveSettingsButton.addSelectionListener(new SaveSettingsListener());

    // Create a spacer label
    Label spacer = new Label(parent, SWT.NONE);
    spacer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    // Update layout of the parent composite to count the spacer
    GridLayout layout = (GridLayout) parent.getLayout();
    layout.numColumns++;
    layout.makeColumnsEqualWidth = false;

    createButton(parent, IDialogConstants.CANCEL_ID, "Cancel", false);
    createButton(parent, IDialogConstants.OK_ID, "OK", true);
}

From source file:hydrograph.ui.expression.editor.evaluate.EvaluateDialog.java

License:Apache License

/**
 * Create contents of the button bar./*from   w  w  w. ja v a 2s .co  m*/
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    evaluateButton = createButton(parent, IDialogConstants.NO_ID, "Evaluate", false);
    evaluateButton.setFocus();
    addListenerToEvaluateButton();
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CLOSE_LABEL, false);
}

From source file:hydrograph.ui.parametergrid.dialog.MultiParameterFileDialog.java

License:Apache License

/**
 * Create contents of the button bar./* w ww.j a v a  2 s.c  om*/
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    okButton.setFocus();
    applyButton = createButton(parent, IDialogConstants.NO_ID, "Apply", false);
    applyButton.setEnabled(false);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:hydrograph.ui.parametergrid.dialog.MultiParameterFileDialog.java

License:Apache License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.NO_ID) {
        saveParamterDialogChanges();//ww w .  j a  v a  2 s. co  m
        applyButton.setEnabled(false);
    }
    super.buttonPressed(buttonId);
}

From source file:hydrograph.ui.propertywindow.propertydialog.PropertyDialog.java

License:Apache License

private void createApplyButton(Composite parent) {
    applyButton = createButton(parent, IDialogConstants.NO_ID, "Apply", false);
    disableApplyButton();
}

From source file:hydrograph.ui.propertywindow.widgets.customwidgets.operational.OperationClassDialog.java

License:Apache License

private void createApplyButton(Composite parent) {
    applyButton = createButton(parent, IDialogConstants.NO_ID, "Apply", false);
    disableApplyButton();/*from  w ww . j av a 2  s  .  c  om*/
    opeartionClassDialogButtonBar.setPropertyDialogButtonBar(okButton, applyButton, cancelButton);
}

From source file:net.refractions.udig.project.ui.internal.SaveDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.NO_ID) {
        setReturnCode(IDialogConstants.NO_ID);
        close();/*from   w  w  w.j a v  a2s.c  o m*/
    } else if (buttonId == IDialogConstants.YES_ID) {
        setReturnCode(IDialogConstants.YES_ID);
        close();
    } else {
        setReturnCode(IDialogConstants.CANCEL_ID);
        close();
    }

}