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:org.eclipse.b3.build.ui.dialogs.B3MessageDialog.java

License:Open Source License

/**
 * Convenience method to open an error dialog with a stack trace
 * /*  ww  w.  j  a  v a  2  s. com*/
 * @param parent
 *            the parent shell of the dialog, or <code>null</code> if none
 * @param title
 *            the dialog's title, or <code>null</code> if none
 * @param message
 *            the message
 * @param detail
 *            the error
 * @param defaultIndex
 *            the default index of the button to select
 * @return <code>true</code> if the user presses the OK button, <code>false</code> otherwise
 */
public static void openStackTrace(Shell parent, String title, String message, Throwable detail,
        int defaultIndex) {
    String[] labels;
    if (detail == null) {
        labels = new String[] { IDialogConstants.OK_LABEL };
        defaultIndex = 0;
    } else {
        labels = new String[] { IDialogConstants.OK_LABEL, IDialogConstants.SHOW_DETAILS_LABEL };
        defaultIndex = 0;
    }

    B3MessageDialog dialog = new B3MessageDialog(parent, title, null, // accept the default window icon
            message, detail, MessageDialog.ERROR, labels, defaultIndex);
    if (detail != null) {
        dialog.setDetailButton(1);
    }
    dialog.open();
}

From source file:org.eclipse.birt.report.data.oda.jdbc.ui.util.ExceptionDialog.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Details buttons
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    _detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL,
            false);/* www . j a  v a 2  s .  c  o  m*/
}

From source file:org.eclipse.birt.report.data.oda.jdbc.ui.util.ExceptionDialog.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  2s. c o  m*/
 */
private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);

    if (_textCreated) {
        _textArea.dispose();
        _textCreated = false;
        _detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        _textArea = createTextArea((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:org.eclipse.birt.report.designer.ui.editors.ReportDocumentEditor.java

License:Open Source License

private void updateDetailsText() {
    if (details != null) {
        details.dispose();/*from w w w  .  j a  va  2s . c  o  m*/
        details = null;
    }

    if (showingDetails) {
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
        Text detailsText = new Text(detailsArea,
                SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY | SWT.LEFT_TO_RIGHT);
        detailsText.setText(getStackTrace(e));
        detailsText.setBackground(detailsText.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
        details = detailsText;
        detailsArea.layout(true);
    } else {
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    }
}

From source file:org.eclipse.buildship.ui.notification.ExceptionDetailsDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    Button copyExceptionButton = createButton(parent, COPY_EXCEPTION_BUTTON_ID, "", false);
    copyExceptionButton.setToolTipText(UiMessages.Button_CopyFailuresToClipboard_Tooltip);

    copyExceptionButton/*from   www .  ja v  a  2s.c om*/
            .setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_COPY));
    this.detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL,
            false);
    Button okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    okButton.setFocus();
}

From source file:org.eclipse.buildship.ui.notification.ExceptionDetailsDialog.java

License:Open Source License

private void hideStacktraceArea() {
    this.stackTraceAreaControl.dispose();
    this.stackTraceAreaControl = null;
    this.detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
}

From source file:org.eclipse.e4mf.common.ui.dialogs.DiagnosticDialog.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 ava 2s . co m*/
 */
private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    if (diagnosticComposite != null) {
        // Closing the detail area
        diagnosticComposite.dispose();
        diagnosticComposite = null;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        // Opening the detail area
        diagnosticComposite = createDiagnosticComposite((Composite) getContents());
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    }
    Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    getShell().setSize(new Point(windowSize.x, newSize.y));
}

From source file:org.eclipse.e4mf.common.ui.editor.ProblemEditorPart.java

License:Open Source License

protected void updateDetails() {
    if (detailsButton.getData() == Boolean.TRUE) {
        if (diagnosticComposite == null) {
            diagnosticComposite = new DiagnosticComposite(detailsComposite, SWT.NONE);
            diagnosticComposite.setSeverityMask(DiagnosticComposite.ERROR_WARNING_MASK);
            diagnosticComposite.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL));
            if (getTextProvider() != null) {
                diagnosticComposite.setTextProvider(getTextProvider());
            }//ww w  .j  a  v a  2s . c  o  m
            diagnosticComposite.initialize(getDiagnostic());
            detailsComposite.layout(true);
        } else {
            diagnosticComposite.setVisible(true);
        }
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    } else {
        if (diagnosticComposite != null) {
            diagnosticComposite.setVisible(false);
        }
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    }
}

From source file:org.eclipse.epf.authoring.ui.actions.UserInteractionHandler.java

License:Open Source License

public int selectOne(int[] actions, String title, String msg, IStatus status) {
    final String[] buttonLabels = new String[actions.length];
    for (int i = 0; i < actions.length; i++) {
        buttonLabels[i] = getActionText(actions[i]);
    }//from w  w  w  . jav  a2  s  . c  om
    Image image = null;
    try {
        shell = LibraryUIPlugin.getDefault().getWorkbench().getDisplay().getActiveShell();
        image = shell.getImage();
    } catch (Exception e) {
    }
    if (status == null) {
        MessageDialog msgDlg = new MessageDialog(shell, title, image, msg, MessageDialog.QUESTION, buttonLabels,
                0);
        int id = msgDlg.open();
        return actions[id];
    } else {
        ErrorDialogNoReason dlg = new ErrorDialogNoReason(shell, title, msg, status,
                IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR) {

            protected void createButtonsForButtonBar(Composite parent) {
                // create OK and Details buttons
                for (int i = 0; i < buttonLabels.length; i++) {
                    String label = buttonLabels[i];
                    createButton(parent, i, label, i == 0);
                }
                if (shouldShowDetailsButton()) {
                    detailsButton = createButton(parent, IDialogConstants.DETAILS_ID,
                            IDialogConstants.SHOW_DETAILS_LABEL, false);
                }

            }

            /*
             * (non-Javadoc)
             * 
             * @see org.eclipse.epf.common.serviceability.ErrorDialogNoReason#buttonPressed(int)
             */
            protected void buttonPressed(int id) {
                if (id == IDialogConstants.DETAILS_ID) {
                    super.buttonPressed(id);
                } else {
                    setReturnCode(id);
                    close();
                }
            }
        };
        int id = dlg.open();
        return actions[id];
    }
}

From source file:org.eclipse.epf.common.serviceability.ErrorDialogNoReason.java

License:Open Source License

protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Details buttons
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
    if (shouldShowDetailsButton()) {
        detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL,
                false);//from  w  w w . j  a  v a  2 s . com
    }
}