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

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

Introduction

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

Prototype

int OK_ID

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

Click Source Link

Document

Button id for an "Ok" button (value 0).

Usage

From source file:com.amazonaws.eclipse.explorer.dynamodb.AddGSIDialog.java

License:Apache License

@Override
protected Control createContents(Composite parent) {
    Control contents = super.createContents(parent);
    setTitle("Add Global Secondary Index");
    setTitleImage(AwsToolkitCore.getDefault().getImageRegistry().get(AwsToolkitCore.IMAGE_AWS_LOGO));
    okButton = getButton(IDialogConstants.OK_ID);
    okButton.setEnabled(false);/* ww w .j  ava2  s .  c o m*/
    return contents;
}

From source file:com.amazonaws.eclipse.explorer.dynamodb.AddLSIDialog.java

License:Apache License

@Override
protected Control createContents(Composite parent) {
    Control contents = super.createContents(parent);
    setTitle("Add Local Secondary Index");
    setTitleImage(AwsToolkitCore.getDefault().getImageRegistry().get(AwsToolkitCore.IMAGE_AWS_LOGO));
    okButton = getButton(IDialogConstants.OK_ID);
    okButton.setEnabled(false);// ww  w.j  ava 2s .c  o  m
    return contents;
}

From source file:com.amazonaws.eclipse.explorer.identitymanagement.AbstractAddPolicyDialog.java

License:Apache License

@Override
protected Control createContents(Composite parent) {
    Control contents = super.createContents(parent);
    setTitle("You can customize permissions by editing the following policy document.");
    setTitleImage(AwsToolkitCore.getDefault().getImageRegistry().get(AwsToolkitCore.IMAGE_AWS_LOGO));
    okButton = getButton(IDialogConstants.OK_ID);
    validate();/*  w w w  .j ava2  s  . co  m*/
    return contents;
}

From source file:com.amazonaws.eclipse.identitymanagement.user.UpdatePasswordDialog.java

License:Apache License

@Override
protected Control createContents(Composite parent) {
    Control contents = super.createContents(parent);
    if (hasPassword) {
        setTitle("Update User Password");
    } else {//from  w w w.  j  a  v  a  2s  .  c  o m
        setTitle("Create User Password");
    }
    setTitleImage(AwsToolkitCore.getDefault().getImageRegistry().get(AwsToolkitCore.IMAGE_AWS_LOGO));
    okButton = getButton(IDialogConstants.OK_ID);
    validate();
    return contents;
}

From source file:com.amitinside.e4.rcp.todo.dialogs.PasswordDialog.java

License:Apache License

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

From source file:com.android.ddmuilib.logcat.LogCatFilterSettingsDialog.java

License:Apache License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);

    mOkButton = getButton(IDialogConstants.OK_ID);

    DialogStatus status = validateDialog();
    mOkButton.setEnabled(status.valid);/*  w w  w. ja  v a  2 s.  co m*/
}

From source file:com.android.ddmuilib.screenrecord.ScreenRecorderOptionsDialog.java

License:Apache License

private void setOkButtonEnabled(boolean en) {
    getButton(IDialogConstants.OK_ID).setEnabled(en);
}

From source file:com.android.ddmuilib.vmtrace.VmTraceOptionsDialog.java

License:Apache License

@Override
protected Control createDialogArea(Composite shell) {
    int horizontalIndent = 30;

    Composite parent = (Composite) super.createDialogArea(shell);
    Composite c = new Composite(parent, SWT.NONE);
    c.setLayout(new GridLayout(2, false));
    c.setLayoutData(new GridData(GridData.FILL_BOTH));

    final Button useSamplingButton = new Button(c, SWT.RADIO);
    useSamplingButton.setText("Sample based profiling");
    useSamplingButton.setSelection(!sTracingEnabled);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true, true,
            2, 1);// ww w. j av  a2 s.  c o  m
    useSamplingButton.setLayoutData(gd);

    Label l = new Label(c, SWT.NONE);
    l.setText("Sample based profiling works by interrupting the VM at a given frequency and \n"
            + "collecting the call stacks at that time. The overhead is proportional to the \n"
            + "sampling frequency.");
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true, true, 2, 1);
    gd.horizontalIndent = horizontalIndent;
    l.setLayoutData(gd);

    l = new Label(c, SWT.NONE);
    l.setText("Sampling frequency (microseconds): ");
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_END, false, true);
    gd.horizontalIndent = horizontalIndent;
    l.setLayoutData(gd);

    final Text samplingIntervalTextField = new Text(c, SWT.BORDER);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true, true);
    gd.widthHint = 100;
    samplingIntervalTextField.setLayoutData(gd);
    samplingIntervalTextField.setEnabled(!sTracingEnabled);
    samplingIntervalTextField.setText(Integer.toString(sSamplingIntervalUs));
    samplingIntervalTextField.addModifyListener(new ModifyListener() {
        @Override
        public void modifyText(ModifyEvent modifyEvent) {
            int v = getIntegerValue(samplingIntervalTextField.getText());
            getButton(IDialogConstants.OK_ID).setEnabled(v > 0);
            sSamplingIntervalUs = v > 0 ? v : DEFAULT_SAMPLING_INTERVAL_US;
        }

        private int getIntegerValue(String text) {
            try {
                return Integer.parseInt(text);
            } catch (NumberFormatException e) {
                return -1;
            }
        }
    });

    final Button useTracingButton = new Button(c, SWT.RADIO);
    useTracingButton.setText("Trace based profiling");
    useTracingButton.setSelection(sTracingEnabled);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true, true, 2, 1);
    useTracingButton.setLayoutData(gd);

    l = new Label(c, SWT.NONE);
    l.setText("Trace based profiling works by tracing the entry and exit of every method.\n"
            + "This captures the execution of all methods, no matter how small, and hence\n"
            + "has a high overhead.");
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_CENTER, true, true, 2, 1);
    gd.horizontalIndent = horizontalIndent;
    l.setLayoutData(gd);

    SelectionAdapter selectionAdapter = new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
            sTracingEnabled = useTracingButton.getSelection();
            samplingIntervalTextField.setEnabled(!sTracingEnabled);
        }
    };
    useTracingButton.addSelectionListener(selectionAdapter);
    useSamplingButton.addSelectionListener(selectionAdapter);

    return c;
}

From source file:com.android.ide.eclipse.adt.internal.build.ConvertSwitchDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.HELP_ID, IDialogConstants.HELP_LABEL, false);
}

From source file:com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigEditDialog.java

License:Open Source License

private void setError(String text) {
    String displayString = Dialog.shortenText(text, mStatusLabel);
    mStatusLabel.setText(displayString);
    mStatusImage.setImage(mError);//from w  ww .ja v a  2  s .  c o m
    getButton(IDialogConstants.OK_ID).setEnabled(false);
}