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

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

Introduction

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

Prototype

int CANCEL_ID

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

Click Source Link

Document

Button id for a "Cancel" button (value 1).

Usage

From source file:de.hoesel.dav.buv.twitter.baustelle.BaustelleTwitternDialog.java

License:Open Source License

/**
 * Create contents of the button bar.//  www .  jav a  2s.c  o  m
 * 
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, "Absenden", true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:de.itemis.tooling.terminology.ui.search.TerminologyEObjectSearchDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);
    getOkButton().setText("Save Settings and Close");
    setButtonLayoutData(getOkButton());//w  ww  .j av  a2 s.c  o m
    getButton(IDialogConstants.CANCEL_ID).setText("Close");
}

From source file:de.jcup.egradle.eclipse.gradleeditor.OpenGradleResourceDialog.java

License:Apache License

@Override
protected void createButtonsForButtonBar(final Composite parent) {
    GridLayout parentLayout = (GridLayout) parent.getLayout();
    parentLayout.makeColumnsEqualWidth = false;

    openWithButton = createDropdownButton(parent, OPEN_WITH_ID, "Open with", new MouseAdapter() {
        @Override//from  w  ww .ja v a 2s.  com
        public void mouseDown(MouseEvent e) {
            showOpenWithMenu();
        }
    });
    setButtonLayoutData(openWithButton);

    new Label(parent, SWT.NONE).setLayoutData(new GridData(5, 0));
    parentLayout.numColumns++;

    Button okButton = createButton(parent, IDialogConstants.OK_ID, "Open", true);
    Button cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL,
            false);

    GridData cancelLayoutData = (GridData) cancelButton.getLayoutData();
    GridData okLayoutData = (GridData) okButton.getLayoutData();
    int buttonWidth = Math.max(cancelLayoutData.widthHint, okLayoutData.widthHint);
    cancelLayoutData.widthHint = buttonWidth;
    okLayoutData.widthHint = buttonWidth;
}

From source file:de.loskutov.eclipse.jdepend.preferences.JDependPreferencePage.java

License:Open Source License

protected void addPackage() {
    Shell shell = getShell();//from w  ww.  j a  v a2s . com
    ElementListSelectionDialog dialog = null;
    try {
        dialog = createAllPackagesDialog(shell, null, true);
    } catch (JavaModelException jme) {
        String title = JDepend4EclipsePlugin
                .getResourceString("JDependPreferencePage.Add_package_to_package_filters"); //$NON-NLS-1$
        String message = JDepend4EclipsePlugin.getResourceString(
                "JDependPreferencePage.Could_not_open_package_selection_dialog_for_package_filters"); //$NON-NLS-1$
        JDepend4EclipsePlugin.logError(jme, title + message);
        return;
    }

    dialog.setTitle(
            JDepend4EclipsePlugin.getResourceString("JDependPreferencePage.Add_package_to_package_filters")); //$NON-NLS-1$
    dialog.setMessage(JDepend4EclipsePlugin
            .getResourceString("JDependPreferencePage.Select_a_package_to_filter_for_JDepend")); //$NON-NLS-1$
    dialog.setMultipleSelection(true);
    if (dialog.open() == IDialogConstants.CANCEL_ID) {
        return;
    }

    Object[] packages = dialog.getResult();
    if (packages != null) {
        for (int i = 0; i < packages.length; i++) {
            IJavaElement pkg = (IJavaElement) packages[i];

            String filter = pkg.getElementName();
            if (filter.length() < 1) {
                filter = JDepend4EclipsePlugin.getResourceString("JDependPreferencePage.default_package"); //$NON-NLS-1$
            } else {
                filter += ".*"; //$NON-NLS-1$
            }
            fStepFilterContentProvider.addFilter(filter, true);
        }
    }
}

From source file:de.plugins.eclipse.depclipse.preferences.JDependPreferencePage.java

License:Open Source License

protected void addPackage() {
    Shell shell = getShell();/*from   w  w w .j ava2  s . c o  m*/
    ElementListSelectionDialog dialog = null;
    try {
        dialog = createAllPackagesDialog(shell, null, true);
    } catch (JavaModelException jme) {
        String title = "Add package to package filters"; //$NON-NLS-1$
        String message = "Could not open package selection dialog for package filters"; //$NON-NLS-1$
        DepclipsePlugin.logError(jme, title + message);
        return;
    }

    dialog.setTitle("Add package to package filters"); //$NON-NLS-1$
    dialog.setMessage(Messages.JDependPreferencePage_Select_a_package_to_filter_for_JDepend);
    dialog.setMultipleSelection(true);
    if (dialog.open() == IDialogConstants.CANCEL_ID) {
        return;
    }

    Object[] packages = dialog.getResult();
    if (packages != null) {
        for (int i = 0; i < packages.length; i++) {
            IJavaElement pkg = (IJavaElement) packages[i];

            String filter = pkg.getElementName();
            if (filter.length() < 1) {
                filter = "(default package)"; //$NON-NLS-1$
            } else {
                filter += ".*"; //$NON-NLS-1$
            }
            fStepFilterContentProvider.addFilter(filter, true);
        }
    }
}

From source file:de.snertlab.xdccBee.tools.AbstractSaveDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, "Speichern", false);
    createButton(parent, IDialogConstants.CANCEL_ID, "Abbrechen", true);
}

From source file:de.topicmapslab.onotoa.search.dialogs.CleanSchemaDialog.java

License:Open Source License

/**
 * Creates button at the bottom of the dialog
 *///from   w ww .  j  a va 2s. c  o m

@Override
protected void createButtonsForButtonBar(Composite parent) {

    createButton(parent, IDialogConstants.OK_ID, "Clean", true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

}

From source file:de.topicmapslab.onotoa.search.dialogs.TopicTypeSearchDialog.java

License:Open Source License

/**
 * Creates button at the bottom of the dialog
 *///w ww . j  a va 2s .c om

@Override
protected void createButtonsForButtonBar(Composite parent) {

    createButton(parent, IDialogConstants.OK_ID, "Search", true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

}

From source file:de.topicmapslab.tmcledit.model.dialogs.NewRoleCombinationConstraintDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    validate();// w w  w .j a  v a2  s.c o m
}

From source file:de.tudarmstadt.dvs.ukuflow.eventbase.utils.UkuInputDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    okButton.setEnabled(true);/*  w w  w .j a v a 2  s . com*/
    if (errorMessageText.getText().length() > 1) {
        System.out.println("set Button enabled = false:'" + errorMessageText.getText() + "'");
        okButton.setEnabled(false);
    }

}