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:com.nokia.cpp.internal.api.utils.ui.FilesListDialog.java

License:Open Source License

/**
 * Create contents of the button bar//from w ww . j a  va 2s . c  o  m
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    okButton = createButton(parent, IDialogConstants.OK_ID, okButtonLabel, true);
    updateOkButtonEnabled();

    createButton(parent, IDialogConstants.CANCEL_ID, cancelButtonLabel, false);
}

From source file:com.nokia.s60ct.gui.actions.ImportVatiantDataAction.java

License:Open Source License

public void run(IAction action) {
    VariantDataImportWizard wizard = new VariantDataImportWizard(rootConf, action.getId());
    WizardDialog wizardDialog = new WizardDialog(getWindow().getShell(), wizard) {

        @Override//from  w  w  w. j a  v  a2s  .  c o m
        protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
            if (id == IDialogConstants.FINISH_ID) {
                Button finish = super.createButton(parent, id, label, defaultButton);
                finish.setVisible(false);
                return finish;
            } else
                return super.createButton(parent, id, label, defaultButton);
        }

        @Override
        protected void createButtonsForButtonBar(Composite parent) {
            super.createButtonsForButtonBar(parent);
            Button cancel = this.getButton(IDialogConstants.CANCEL_ID);
            cancel.setText("Done");
        }

    };
    wizardDialog.open();
}

From source file:com.nokia.s60tools.analyzetool.internal.ui.graph.GraphSettingsDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.nokia.s60tools.compatibilityanalyser.ui.dialogs.BaselineEditor.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {

    saveBtn = this.createButton(parent, IDialogConstants.OK_ID, Messages.getString("BaselineEditor.SaveOK"), //$NON-NLS-1$
            true);//from   ww w .  j a v  a  2  s .  c om
    saveBtn.addSelectionListener(this);
    deleteBtn = this.createButton(parent, IDialogConstants.IGNORE_ID,
            Messages.getString("BaselineEditor.Delete"), false); //$NON-NLS-1$
    deleteBtn.addSelectionListener(this);
    cancelBtn = this.createButton(parent, IDialogConstants.CANCEL_ID,
            Messages.getString("BaselineEditor.Cancel"), false); //$NON-NLS-1$
    cancelBtn.addSelectionListener(this);

    //It shows the information of the profile using the given profile name.
    //If that profile name is not valid then it is deleted from the list.

    if (selectedProfile != null) {
        openBaselineProfileIfExists(selectedProfile);
    } else {
        openBaselineProfileIfExists(profileCmb.getText());
    }

    //Exclude hdr directories list
    GridData d = (GridData) hdr_dirs_comp.getLayoutData();
    d.exclude = !radio_Hdr_dir.getSelection();
    hdr_dirs_comp.setVisible(radio_Hdr_dir.getSelection());

    //Exclude list of build targets for the first time
    GridData data = (GridData) list_build_Config.getLayoutData();
    data.exclude = !radio_build_target.getSelection();
    list_build_Config.setVisible(radio_build_target.getSelection());

    //Exlude dll/dso path tabs for the first time
    GridData exData = (GridData) dllPaths_Folder.getLayoutData();
    exData.exclude = !radio_dir_Libs.getSelection();
    dllPaths_Folder.setVisible(radio_dir_Libs.getSelection());

    if (hdrGrp != null && shell != null) {
        hdrGrp.layout();
        shell.layout();
    }
}

From source file:com.nokia.s60tools.compatibilityanalyser.ui.dialogs.BaselineEditor.java

License:Open Source License

protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.OK_ID) {
        setReturnCode(IDialogConstants.OK_ID);
    } else if (buttonId == IDialogConstants.CANCEL_ID) {
        setReturnCode(IDialogConstants.CANCEL_ID);
    } else if (buttonId == IDialogConstants.IGNORE_ID) {
        //For Delete button, IGNORE_ID is been used.
        setReturnCode(IDialogConstants.IGNORE_ID);
    }//from w ww .  j a  v a  2 s . com
}

From source file:com.nokia.s60tools.compatibilityanalyser.ui.dialogs.KnownissuesDilaog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    ok = this.createButton(parent, IDialogConstants.OK_ID, Messages.getString("KnownissuesDilaog.Ok"), false); //$NON-NLS-1$
    ok.addSelectionListener(this);
    cancel = this.createButton(parent, IDialogConstants.CANCEL_ID,
            Messages.getString("KnownissuesDilaog.Cancel"), false); //$NON-NLS-1$
    cancel.addSelectionListener(this);
    getPrefsStoreValues();//from   w w  w  . java 2 s.c o m

}

From source file:com.nokia.s60tools.creator.dialogs.AbstractDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    // Creating just OK button
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true);

}

From source file:com.nokia.s60tools.creator.job.ConfirmFileReplaceDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    GridLayout gdl = new GridLayout(1, false);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
    parent.setLayout(gdl);/*from   ww  w .  j  a  v  a 2 s.c o  m*/
    parent.setLayoutData(gd);

    createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true);
    createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true);
}

From source file:com.nokia.s60tools.creator.job.ConfirmFileReplaceDialog.java

License:Open Source License

protected void buttonPressed(int buttonId) {
    // Save pressed button id
    selection = buttonId;//  w w  w .  j  a va2s . c o m

    if (buttonId != IDialogConstants.CANCEL_ID) {
        // Save "Don't ask again" state
        CreatorPreferences.setDontAskFileReplaceInDevice(confirmReplaceRadioCB.getSelection());
    }

    super.close();
}

From source file:com.nokia.s60tools.creator.job.RunInDeviceJob.java

License:Open Source License

/**
 * Showing user a dialog to shutdown Creator in device or not,
 * @throws JobCancelledByUserException if user selects Cancel
 *//*w  w w.j a v  a  2  s.c o m*/
private void showShutdownDialog() throws JobCancelledByUserException {

    if (!CreatorPreferences.getDontAskShutdownCreator()) {

        Runnable runDlg = new Runnable() {

            public void run() {
                //
                ShutdownCreatorInDeviceDialog dlg = new ShutdownCreatorInDeviceDialog(
                        CreatorActivator.getCurrentlyActiveWbWindowShell());

                dlg.open();
                confirmDialogSelection = dlg.getSelection();
            }
        };

        Display.getDefault().syncExec(runDlg);

        if (confirmDialogSelection == IDialogConstants.CANCEL_ID) {
            throwJobCancelledException();
        }
    }
}