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

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

Introduction

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

Prototype

String SHOW_DETAILS_LABEL

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

Click Source Link

Document

The label for show details buttons.

Usage

From source file:de.bht.fpa.mail.s000000.common.rcp.exception.ExceptionDetailsErrorDialog.java

License:Open Source License

/**
 * Toggles the unfolding of the details area. This is triggered by the user
 * pressing the details button.//from  w  ww .  j  ava  2 s. com
 */
private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (listCreated) {
        text.dispose();
        listCreated = false;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        text = createDropDownList((Composite) getContents());
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    }
    Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    getShell().setSize(new Point(windowSize.x, windowSize.y + newSize.y - oldSize.y));
}

From source file:eu.transkribus.swt_canvas.util.ExceptionDetailsErrorDialog.java

License:Open Source License

/**
 * Toggles the unfolding of the details area. This is triggered by the user
 * pressing the details button./*w w  w. j a  v  a  2 s.com*/
 */
private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (listCreated) {
        text.dispose();
        listCreated = false;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        text = createDropDownList((Composite) getContents());
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    }
    Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
}

From source file:jbt.tools.bteditor.util.DetailsDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true);
    this.detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL,
            false);/*from www.  j  a v a  2 s  .c om*/
}

From source file:jbt.tools.bteditor.util.DetailsDialog.java

License:Open Source License

protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.DETAILS_ID) {
        /*//ww w . j  ava 2  s .c o  m
         * If the details button has been pressed, then the details area
         * must be shown or hidden, depending on whether it as hidden or
         * not. After doing so, the dialog must be resized.
         */
        Point dialogOldDimensions = getShell().getSize();
        if (this.detailsTextCreated) {
            /*
             * If the details area is being showed, we delete it. Also, the
             * label on the details button must be changed.
             */
            this.detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
            this.detailsText.dispose();
        } else {
            /*
             * If the text area is not being showed, it must be created and
             * showed. In order to do so, we initialize "this.detailsText".
             * Also, the label on the details button must be changed.
             */
            this.detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
            this.detailsText = new Text((Composite) getContents(),
                    SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL);
            this.detailsText.setText(this.details);
            GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
            this.detailsText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
            data.horizontalSpan = 2;
            this.detailsText.setLayoutData(data);
        }
        getContents().getShell().layout();
        this.detailsTextCreated = !this.detailsTextCreated;

        /*
         * The dialog is finalli resized.
         */
        Point dialogNewDimensions = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
        int screenHeight = Display.getCurrent().getClientArea().height;
        getShell().setSize(new Point(dialogOldDimensions.x, Math.min(dialogNewDimensions.y, screenHeight)));
    } else {
        /*
         * Close the dialog...
         */
        close();
    }
    setReturnCode(buttonId);
}

From source file:msi.gama.gui.swt.dialogs.AbstractDetailsDialog.java

License:Open Source License

/**
 * Adds OK and Details buttons to this dialog's button bar.
 * //from  w  w w .  j a  va 2s . c om
 * @param parent the button bar composite
 */
@Override
protected void createButtonsForButtonBar(final Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
    detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL,
            false);
}

From source file:msi.gama.gui.swt.dialogs.AbstractDetailsDialog.java

License:Open Source License

/**
 * Toggles the unfolding of the details area. This is triggered by the user pressing the Details
 * button./*from www .  j  av a 2s .  co  m*/
 */
protected void toggleDetailsArea() {
    final Point oldWindowSize = getShell().getSize();
    Point newWindowSize = cachedWindowSize;
    cachedWindowSize = oldWindowSize;

    // Show the details area.
    if (detailsArea == null) {
        detailsArea = createDetailsArea((Composite) getContents());
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    }

    // Hide the details area.
    else {
        detailsArea.dispose();
        detailsArea = null;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    }

    /*
     * Must be sure to call getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT) before calling
     * getShell().setSize(newWindowSize) since controls have been added or removed.
     */

    // Compute the new window size.
    final Point oldSize = getContents().getSize();
    final Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (newWindowSize == null) {
        newWindowSize = new Point(oldWindowSize.x, oldWindowSize.y + newSize.y - oldSize.y);
    }

    // Crop new window size to screen.
    final Point windowLoc = getShell().getLocation();
    final Rectangle screenArea = getContents().getDisplay().getClientArea();
    if (newWindowSize.y > screenArea.height - (windowLoc.y - screenArea.y)) {
        newWindowSize.y = screenArea.height - (windowLoc.y - screenArea.y);
    }

    getShell().setSize(newWindowSize);
    ((Composite) getContents()).layout();
}

From source file:net.bioclipse.core.util.ExceptionDetailsErrorDialog.java

License:Open Source License

/**
 * Toggles the unfolding of the details area. This is triggered by the user
 * pressing the details button./* w  w  w  . j a  v  a 2 s . com*/
 */
private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (listCreated) {
        text.dispose();
        listCreated = false;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        text = createDropDownList((Composite) getContents());
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    }
    Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
    if (!text.isDisposed())
        text.redraw();
}

From source file:net.refractions.udig.ui.ExceptionDetailsDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false);
    detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL,
            false);/*from  ww  w  .j  a v a 2s.  co m*/
}

From source file:net.refractions.udig.ui.ExceptionDetailsDialog.java

License:Open Source License

protected void toggleDetailsArea() {
    Point oldWindowSize = getShell().getSize();
    Point newWindowSize = cachedWindowSize;
    cachedWindowSize = oldWindowSize;/* w  ww  . jav  a  2 s  .c o m*/

    // Show the details area.
    if (detailsArea == null) {
        detailsArea = createDetailsArea((Composite) getContents());
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    }

    // Hide the details area.
    else {
        detailsArea.dispose();
        detailsArea = null;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    }

    /*
     * Must be sure to call
     *    getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT)
     * before calling
     *    getShell().setSize(newWindowSize)
     * since controls have been added or removed.
     */

    // Compute the new window size.
    Point oldSize = getContents().getSize();
    Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (newWindowSize == null)
        newWindowSize = new Point(oldWindowSize.x, oldWindowSize.y + (newSize.y - oldSize.y));

    // Crop new window size to screen.
    Point windowLoc = getShell().getLocation();
    Rectangle screenArea = getContents().getDisplay().getClientArea();
    if (newWindowSize.y > screenArea.height - (windowLoc.y - screenArea.y))
        newWindowSize.y = screenArea.height - (windowLoc.y - screenArea.y);

    getShell().setSize(newWindowSize);
    ((Composite) getContents()).layout();
}

From source file:net.sourceforge.taggerplugin.dialog.AbstractDetailsDialog.java

License:Open Source License

/**
 * Toggles the unfolding of the details area. This is triggered by the user pressing the Details button.
 *///from   ww w . ja  v a  2s .  co  m
protected void toggleDetailsArea() {
    Point oldWindowSize = getShell().getSize();
    Point newWindowSize = cachedWindowSize;
    cachedWindowSize = oldWindowSize;

    if (detailsArea == null) {
        detailsArea = createDetailsArea((Composite) getContents());
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    } else {
        detailsArea.dispose();
        detailsArea = null;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    }

    /*
     * Must be sure to call getContents().computeSize(SWT.DEFAULT,
     * SWT.DEFAULT) before calling getShell().setSize(newWindowSize)
     * since controls have been added or removed.
     */

    // Compute the new window size.
    Point oldSize = getContents().getSize();
    Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (newWindowSize == null) {
        newWindowSize = new Point(oldWindowSize.x, oldWindowSize.y + (newSize.y - oldSize.y));
    }

    // Crop new window size to screen.
    Point windowLoc = getShell().getLocation();
    Rectangle screenArea = getContents().getDisplay().getClientArea();
    if (newWindowSize.y > screenArea.height - (windowLoc.y - screenArea.y)) {
        newWindowSize.y = screenArea.height - (windowLoc.y - screenArea.y);
    }

    getShell().setSize(newWindowSize);
    ((Composite) getContents()).layout();
}