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:co.turnus.ui.profiling.wizard.page.StoreOperatorCostsFilePage.java

License:Open Source License

@Override
public void widgetSelected(SelectionEvent e) {
    String value = outputChooser.getText();
    if (value != null && !value.isEmpty()) {
        //TODO check if parent exists
        file = new File(value);
        setErrorMessage(null);/*w w w.j a va 2  s. c o  m*/
        getButton(IDialogConstants.OK_ID).setEnabled(true);
    } else {
        setErrorMessage("no output file selected");
        getButton(IDialogConstants.OK_ID).setEnabled(false);
    }
}

From source file:com.actuate.development.tool.dialog.ErrorLogDialog.java

License:Open Source License

protected Control createButtonBar(Composite parent) {
    Control control = super.createButtonBar(parent);
    if (getButton(IDialogConstants.OK_ID) != null) {
        getButton(IDialogConstants.OK_ID).setText("OK");
    }//  w  w w. j  a  v  a2  s  .co m
    if (getButton(IDialogConstants.CANCEL_ID) != null) {
        getButton(IDialogConstants.CANCEL_ID).setText("Cancel");
    }
    return control;
}

From source file:com.agynamix.platform.frontend.action.InputTextAction.java

License:Open Source License

/**
 * @see org.eclipse.jface.action.Action#run()
 *//*from w ww .  j a  v a  2  s .co  m*/
public void run() {
    InputTextDialog dialog = new InputTextDialog(window.getShell());
    if (dialog.open() == IDialogConstants.OK_ID) {
        String contents = dialog.getText();
        if ((contents != null) && (contents.length() > 0)) {
            IQueueManager queueManager = ((SimidudeApplicationContext) ApplicationBase.getContext())
                    .getQueueManager();
            queueManager.put(IQueueManager.QUEUE_SOURCE_DATA_MONITOR,
                    SourceDataFactory.createFromText(contents));
        }
    }
}

From source file:com.agynamix.platform.frontend.dialogs.AboutApplicationDialog.java

protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
}

From source file:com.agynamix.platform.frontend.dialogs.InputNetworkAddressDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite parentComposite = (Composite) super.createDialogArea(parent);
    parentComposite.setLayout(new GridLayout());

    Composite composite = new Composite(parentComposite, parentComposite.getStyle());
    GridData compData = new GridData(SWT.FILL, SWT.FILL, true, true);
    composite.setLayoutData(compData);/*from w  ww . j  a va  2  s  . c o  m*/

    composite.setLayout(new GridLayout(1, false));

    Label l = new Label(composite, SWT.WRAP);
    l.setText("Enter Network Address:");
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
    l.setLayoutData(data);

    text = new Text(composite, SWT.BORDER);
    data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    text.setLayoutData(data);

    text.addKeyListener(new KeyAdapter() {
        @Override
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == 13) {
                if ((e.stateMask & SWT.MOD1) != 0) {
                    buttonPressed(IDialogConstants.OK_ID);
                }
            }
        }
    });

    return parentComposite;
}

From source file:com.agynamix.platform.frontend.dialogs.InputNetworkAddressDialog.java

License:Open Source License

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

From source file:com.agynamix.platform.frontend.dialogs.InputNetworkAddressDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.OK_ID) {
        finalContents = text.getText();/*from  ww  w .  j  ava  2s .co m*/
    }
    super.buttonPressed(buttonId);
}

From source file:com.agynamix.platform.frontend.dialogs.InputTextDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite parentComposite = (Composite) super.createDialogArea(parent);
    parentComposite.setLayout(new GridLayout());

    Composite composite = new Composite(parentComposite, parentComposite.getStyle());
    GridData compData = new GridData(SWT.FILL, SWT.FILL, true, true);
    composite.setLayoutData(compData);/*from w  w w . j  a v  a2s.com*/

    composite.setLayout(new GridLayout(1, false));

    Label l = new Label(composite, SWT.WRAP);
    l.setText("Enter Text here:");
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
    l.setLayoutData(data);

    text = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.minimumHeight = 80;
    text.setLayoutData(data);

    text.addKeyListener(new KeyAdapter() {
        @Override
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == 13) {
                if ((e.stateMask & SWT.MOD1) != 0) {
                    buttonPressed(IDialogConstants.OK_ID);
                }
            }
        }
    });

    return parentComposite;
}

From source file:com.agynamix.platform.frontend.dialogs.InputTextDialog.java

License:Open Source License

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

From source file:com.agynamix.platform.frontend.dialogs.SimpleInformationViewerDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.CLOSE_LABEL, true);
    //    super.createButtonsForButtonBar(parent);
}