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

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

Introduction

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

Prototype

String OK_LABEL

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

Click Source Link

Document

The label for OK buttons.

Usage

From source file:com.drgarbage.utils.Messages.java

License:Apache License

public static int error(Shell shell, String title, String message) {
    MessageDialog dlg = new MessageDialog(shell, title, CoreImg.aboutDrGarbageIcon_16x16.createImage(), message,
            MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, 0);
    return dlg.open();
}

From source file:com.drgarbage.utils.Messages.java

License:Apache License

/**
 * @see  #openConfirm(Shell, String, String, String[])
 *///from   ww  w  .j a v  a2 s .  c  om
public static boolean openConfirm(Shell parent, String title, String message) {
    return openConfirm(parent, title, message,
            new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL });
}

From source file:com.drgarbage.utils.Messages.java

License:Apache License

/**
 * @see  #openSelectDialog(Shell, String, String, String[], List)
 *//*from   w  w w .java  2  s  .  c  o  m*/
public static String openSelectDialog(Shell parent, String title, String message, Image selectionListImage,
        List<String> elementList) {
    return openSelectDialog(parent, title, message,
            new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, selectionListImage,
            elementList);
}

From source file:com.dubture.symfony.debug.launch.SymfonyURLLaunchDialog.java

License:Open Source License

public SymfonyURLLaunchDialog(ILaunchConfigurationWorkingCopy launchConfiguration, String title, Route route) {

    super(PHPDebugUIPlugin.getActiveWorkbenchShell(), title, null, "", INFORMATION,
            new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0);

    this.launchConfiguration = launchConfiguration;
    this.route = route;
    message = "Note that no files will be published to the server.";
}

From source file:com.ecfeed.ui.dialogs.AddTestCaseDialog.java

License:Open Source License

/**
 * Create contents of the button bar.//from   w w w.j av  a2 s.  c o m
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    fOkButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.ecfeed.ui.dialogs.CalculateCoverageDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
    okButton.setEnabled(true);//from  w  w w . ja  va  2  s  .c om
}

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

License:Open Source License

@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 || JavaTypeHelper.isUserType(parameter.getType())))
                    || parameterStatus == EImplementationStatus.NOT_IMPLEMENTED) {
                setOkButtonStatus(false);
                break;
            }/*from  w ww.jav a2s.  c o m*/
        }
    } else {
        for (MethodParameterNode parameter : fMethod.getMethodParameters()) {
            if (parameter.getChoicesWithCopies().isEmpty()
                    && (parameter.isExpected() == false || JavaTypeHelper.isUserType(parameter.getType()))) {
                setOkButtonStatus(false);
                break;
            }
        }
    }

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

    updateOkButtonAndErrorMsg();
}

From source file:com.ecfeed.ui.dialogs.RenameTestSuiteDialog.java

License:Open Source License

/**
 * Create contents of the button bar./* ww  w .j ava2  s  .c om*/
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    fOkButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    fOkButton.setEnabled(false);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:com.ecfeed.ui.dialogs.SetupDialogGenerator.java

License:Open Source License

@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) {
                setOkButtonStatus(false);
                break;
            }/*from w  ww  .ja  v a 2s  . c  o  m*/
        }
    } else {
        for (MethodParameterNode parameter : fMethod.getMethodParameters()) {
            if (parameter.getChoices().isEmpty()
                    && (parameter.isExpected() == false || JavaUtils.isUserType(parameter.getType()))) {
                setOkButtonStatus(false);
                break;
            }
        }
    }

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

    updateOkButtonAndErrorMsg();
}

From source file:com.ecfeed.ui.wizards.NewEctFileCreationPage.java

License:Open Source License

public boolean performFinish() {
    IFile file = fPage.createNewFile();/*  w  w w .j a va 2s.co m*/
    try {
        if (file.getContents().read() != -1) {
            MessageDialog dialog = new MessageDialog(getShell(), Messages.WIZARD_FILE_EXISTS_TITLE,
                    Display.getDefault().getSystemImage(SWT.ICON_QUESTION), Messages.WIZARD_FILE_EXISTS_MESSAGE,
                    MessageDialog.QUESTION_WITH_CANCEL,
                    new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL },
                    IDialogConstants.OK_ID);
            if (dialog.open() != IDialogConstants.OK_ID) {
                return false;
            }
        }

        final IPath newFileFullPath = fPage.getContainerFullPath().append(fPage.getFileName());
        String modelName = newFileFullPath.removeFileExtension().lastSegment();
        RootNode model = new RootNode(modelName != null ? modelName : Constants.DEFAULT_NEW_ECT_MODEL_NAME,
                ModelVersionDistributor.getCurrentVersion());

        ByteArrayOutputStream ostream = new ByteArrayOutputStream();
        new EctSerializer(ostream, ModelVersionDistributor.getCurrentVersion()).serialize(model);
        ByteArrayInputStream istream = new ByteArrayInputStream(ostream.toByteArray());
        file.setContents(istream, true, true, null);

        //open new file in an ect editor
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();

        page.openEditor(new FileEditorInput(file), Constants.ECT_EDITOR_ID);
    } catch (Exception e) {
        e.printStackTrace();
    }

    return true;
}