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.symbian.smt.gui.smtwidgets.XmlFileSelectionDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);

    cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    // do this here because setting the m_text will set enablement on the ok
    // button//  www  . j  a  v a 2  s  .  co  m
    inputText.setFocus();
    if (inputValue != null) {
        inputText.setText(inputValue);
        inputText.selectAll();
    }
}

From source file:com.testify.ecfeed.ui.dialogs.GeneratorSetupDialog.java

License:Open Source License

/**
 * Create contents of the button bar./* w  w w  .  j  a v  a  2s  .co m*/
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    fOkButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    if (fGenerateExecutableContent) {
        for (MethodParameterNode parameter : fMethod.getMethodParameters()) {
            EImplementationStatus parameterStatus = fStatusResolver.getImplementationStatus(parameter);
            if ((parameter.getChoices().isEmpty()
                    && (parameter.isExpected() == false || JavaUtils.isUserType(parameter.getType())))
                    || parameterStatus == EImplementationStatus.NOT_IMPLEMENTED) {
                setOkButton(false);
                break;
            }
        }
    } else {
        for (MethodParameterNode parameter : fMethod.getMethodParameters()) {
            if (parameter.getChoices().isEmpty()
                    && (parameter.isExpected() == false || JavaUtils.isUserType(parameter.getType()))) {
                setOkButton(false);
                break;
            }
        }
    }

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

From source file:com.tocea.scertify.eclipse.scertifycode.ui.stats.views.internal.ScertifyMarkerFilterDialog.java

License:Open Source License

/**
 * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
 *//*from ww w. j a  v  a2s . co m*/

protected void createButtonsForButtonBar(Composite parent) {

    this.mBtnDefault = this.createButton(parent, IDialogConstants.BACK_ID,
            Messages.ScertifyMarkerFilterDialog_btnRestoreDefault, false);
    this.mBtnDefault.addSelectionListener(this.mController);

    // create OK and Cancel buttons by default
    this.createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    this.createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.toubassi.jface.ObjectChooserDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, okLabel, false);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true);
}

From source file:com.twinsoft.convertigo.eclipse.dialogs.ProjectChooseTestCasesDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Control buttonBar = super.createButtonBar(parent);
    getButton(IDialogConstants.OK_ID).setText("OK");
    //      getButton(IDialogConstants.OK_ID).setEnabled(false);
    getButton(IDialogConstants.CANCEL_ID).setText("Cancel");
    return buttonBar;
}

From source file:com.twinsoft.convertigo.eclipse.dialogs.ProjectDeployDialog.java

License:Open Source License

private void deploy() throws EngineException, RemoteAdminException {
    try {/*from   w w  w .j  a va  2s  .c  o m*/
        String projectName = ConvertigoPlugin.projectManager.currentProject.getName();

        setTextLabel("Archive creation");
        ConvertigoPlugin.logDebug("Creation of the archive...");
        try {
            if (listTestCasesSelected.size() > 0) {
                CarUtils.makeArchive(ConvertigoPlugin.projectManager.currentProject, listTestCasesSelected);
            } else {
                CarUtils.makeArchive(ConvertigoPlugin.projectManager.currentProject);
            }
        } catch (com.twinsoft.convertigo.engine.EngineException e) {
            throw new com.twinsoft.convertigo.engine.EngineException(
                    "The archive creation has failed: (EngineException) " + e.getMessage());
        }

        ConvertigoPlugin.logDebug("Archive successfully generated!");

        setTextLabel("Authenticating to the Convertigo server");

        if (convertigoServer.indexOf('/') == -1)
            convertigoServer += "/convertigo";

        RemoteAdmin remoteAdmin = new RemoteAdmin(convertigoServer, isHttps, trustAllCertificates);

        ConvertigoPlugin.logDebug("Trying to connect to the Convertigo remote server...");
        ConvertigoPlugin.logDebug("Username: " + convertigoUserName);
        ConvertigoPlugin.logDebug("Password: " + convertigoUserPassword);

        setTextLabel("Connection to the Convertigo server");

        remoteAdmin.login(convertigoUserName, convertigoUserPassword);

        setTextLabel("Deployment of the archive on the Convertigo server");

        File file = new File(Engine.PROJECTS_PATH + "/" + projectName + ".car");

        remoteAdmin.deployArchive(file, bAssembleXsl);

        bFinished = true;

        ConvertigoPlugin.logDebug("Deployment successfull!");
    } finally {
        final Display display = getParentShell().getDisplay();
        if (display != null)
            display.asyncExec(new Runnable() {
                public void run() {
                    if (bFinished) {
                        setTextLabel("The archive deployment has been correctly done.");
                        if (getButton(IDialogConstants.OK_ID) != null) {
                            getButton(IDialogConstants.OK_ID).setEnabled(false);
                            getButton(IDialogConstants.CANCEL_ID).setText("Finish");
                        }
                    } else {
                        if (getButton(IDialogConstants.OK_ID) != null)
                            getButton(IDialogConstants.OK_ID).setEnabled(true);
                        setTextLabel("Progression");
                    }
                }
            });
    }
}

From source file:com.twinsoft.convertigo.eclipse.dialogs.ProjectVersionUpdateDialog.java

License:Open Source License

@Override
protected Control createButtonBar(Composite parent) {
    Control buttonBar = super.createButtonBar(parent);
    getButton(IDialogConstants.OK_ID).setText("Update");
    getButton(IDialogConstants.OK_ID).setEnabled(false);
    Button cancel = getButton(IDialogConstants.CANCEL_ID);
    cancel.setText("Skip");
    cancel.setFocus();/*from   w  w  w.j  a v a  2 s .c  o m*/
    return buttonBar;
}

From source file:com.twinsoft.convertigo.eclipse.dialogs.SchemaObjectsDialog.java

License:Open Source License

@Override
protected void okPressed() {
    try {/*  w  w w  . j a va  2  s .com*/
        getButton(IDialogConstants.OK_ID).setEnabled(false);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(false);

        if (schemaObjectsDialogComposite != null) {
            qname = (QName) schemaObjectsDialogComposite.getValue(null);
        }

        Thread thread = new Thread(this);
        thread.start();
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to import objects");
    } finally {
        getButton(IDialogConstants.OK_ID).setEnabled(true);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
    }
}

From source file:com.twinsoft.convertigo.eclipse.dialogs.WsReferenceImportDialog.java

License:Open Source License

protected void okPressed() {
    try {/*w w w .jav  a 2  s . c o m*/
        progressBar = ((WsReferenceImportDialogComposite) dialogComposite).progressBar;

        getButton(IDialogConstants.OK_ID).setEnabled(false);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(false);

        Thread thread = new Thread(this);
        thread.start();
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to import WS reference!");
    }
}

From source file:com.twinsoft.convertigo.eclipse.dialogs.XmlStructureDialog.java

License:Open Source License

@Override
protected void okPressed() {
    try {//from   w  w  w.  j  a v a 2  s . c  om
        getButton(IDialogConstants.OK_ID).setEnabled(false);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(false);

        if (schemaObjectsDialogComposite != null) {
            xml = (String) schemaObjectsDialogComposite.getValue(null);
        }

        Thread thread = new Thread(this);
        thread.start();
    } catch (Throwable e) {
        ConvertigoPlugin.logException(e, "Unable to import objects");
    } finally {
        getButton(IDialogConstants.OK_ID).setEnabled(true);
        getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
    }
}