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

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

Introduction

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

Prototype

int CLIENT_ID

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

Click Source Link

Document

Starting button id reserved for use by clients of JFace (value 1024).

Usage

From source file:at.rc.tacos.client.ui.dialog.DateSelectionDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    parent.setBackground(toolkit.getColors().getBackground());
    createButton(parent, IDialogConstants.CLIENT_ID + 1, "Clear", false);
    super.createButtonsForButtonBar(parent);
}

From source file:at.rc.tacos.client.ui.dialog.DateSelectionDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    super.buttonPressed(buttonId);
    if (buttonId == IDialogConstants.CLIENT_ID + 1) {
        reminderDate = null;/*from w  ww.java 2 s  . co m*/
        okPressed();
    }
}

From source file:ch.allon.redskin.internal.ui.custom.PriceCategoryDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button newPriceButton = createButton(parent, IDialogConstants.CLIENT_ID,
            Messages.NewPriceCategoryAction_New_Day_Action, true);
    newPriceButton.addSelectionListener(new SelectionListener() {

        @Override/*from   w w  w .  j  av  a2 s  .com*/
        public void widgetSelected(SelectionEvent e) {
            handleAddRow();
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
            handleAddRow();
        }
    });
    super.createButtonsForButtonBar(parent);
}

From source file:ch.elexis.base.messages.MsgDetailDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(final Composite parent) {
    String sOK;/*from w w w  .j a  v a  2s  .  co  m*/
    if (incomingMsg == null) {
        sOK = Messages.MsgDetailDialog_send;
    } else {
        sOK = Messages.MsgDetailDialog_delete;
    }
    bOK = createButton(parent, IDialogConstants.OK_ID, sOK, false);
    parent.getShell().setDefaultButton(bOK);
    bAnswer = createButton(parent, IDialogConstants.CLIENT_ID + 1, Messages.MsgDetailDialog_reply, false);
    if (incomingMsg == null) {
        bAnswer.setEnabled(false);
    }
    createButton(parent, IDialogConstants.CLIENT_ID + 2, Messages.MsgDetailDialog_asReminder, false);
    createButton(parent, IDialogConstants.CANCEL_ID, Messages.MsgDetailDialog_cancel, false);
}

From source file:ch.elexis.base.messages.MsgDetailDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    switch (buttonId) {
    case IDialogConstants.OK_ID:
        okPressed();//  www . j  a va2  s  .com
        return;
    case IDialogConstants.CLIENT_ID + 1:
        if (incomingMsg != null) {
            Anwender an = incomingMsg.getSender();
            new Message(an, txtMessage.getText());
        }
        okPressed();
    case IDialogConstants.CLIENT_ID + 2:
        StructuredSelection ss = ((StructuredSelection) cbTo.getSelection());
        if (!ss.isEmpty()) {
            Anwender anw = (Anwender) ss.getFirstElement();
            Reminder rem = new Reminder(null, new TimeTool().toString(TimeTool.DATE_GER), Visibility.ALWAYS, "",
                    incomingMsg.get(Message.FLD_TEXT));
            ElexisEventDispatcher.getInstance()
                    .fire(new ElexisEvent(rem, Reminder.class, ElexisEvent.EVENT_CREATE));
            rem.addResponsible(anw);
        }
        okPressed();
    default:
        break;
    }
    super.buttonPressed(buttonId);
}

From source file:cn.com.sky.hyperbola.LoginDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    Button removeCurrentUser = createButton(parent, IDialogConstants.CLIENT_ID, "&Delete User", false);
    removeCurrentUser.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            savedDetails.remove(userIdText.getText());
            initializeUsers("");
        }/*from ww w.  j  a va2 s  . co m*/
    });
    createButton(parent, IDialogConstants.OK_ID, "&Login", true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

}

From source file:com.appnativa.studio.composite.FontFieldComposite.java

License:Open Source License

protected void showDialog() {
    FontChooserDialog d = new FontChooserDialog(getShell());

    d.setFont(baseFont, (Font) rareFont.clone());

    int ret = d.open();

    switch (ret) {
    case IDialogConstants.OK_ID:
        Font f = d.getSelectedFont();

        if (f != null) {
            rareFont = f;/*ww w .j  av  a  2s. c  o  m*/
            updateField(true);
        }

        break;

    case IDialogConstants.CLIENT_ID:
        rareFont.spot_clear();
        updateField(true);

        break;

    default:
        break;
    }
}

From source file:com.appnativa.studio.composite.SequenceArrayEditorComposite.java

License:Open Source License

protected void showsequenceEditor(boolean addNew) {
    final SequenceArrayEditor se = new SequenceArrayEditor(getShell(), element, null, false);

    if (addNew) {
        Display.getDefault().asyncExec(new Runnable() {
            @Override//from   w w w .jav  a2s. c o m
            public void run() {
                se.addElement();
            }
        });
    }

    int ret = se.open();

    if ((ret == IDialogConstants.OK_ID) || (ret == IDialogConstants.CLIENT_ID)) {
        this.element = se.getSPOTElement();
        textWidget.setText(element.toString());

        int y = textWidget.getSize().y;

        if (y != calculatePreferredTextHeight()) {
            this.getParent().getParent().layout();
        }

        if (propertyChangeListener != null) {
            notifyPropertyChangeListener(element);
        }
    }
}

From source file:com.appnativa.studio.dialogs.ColorChooserDialog.java

License:Open Source License

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

    Button b = createButton(parent, IDialogConstants.CLIENT_ID, "None", false);

    b.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            setReturnCode(IDialogConstants.CLIENT_ID);
            selectedColor = null;
            ColorChooserDialog.this.close();
        }
    });
}

From source file:com.appnativa.studio.dialogs.FontChooserDialog.java

License:Open Source License

/**
 * Create contents of the button bar./* ww  w  .j  a v a2s .c  o  m*/
 * @param parent
 */
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    Button b = createButton(parent, IDialogConstants.CLIENT_ID, "None", false);

    b.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            setReturnCode(IDialogConstants.CLIENT_ID);
            rareFont = fontPanel.getSelectedFont();
            rareFont.spot_clear();
            FontChooserDialog.this.close();
        }
    });
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
}