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

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

Introduction

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

Prototype

String HIDE_DETAILS_LABEL

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

Click Source Link

Document

The label for hide details buttons.

Usage

From source file:org.eclipse.ajdt.internal.ui.ajde.AJDTErrorDialog.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  a va 2  s . com
 */
private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (listCreated) {
        list.dispose();
        listCreated = false;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        list = 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: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.//from  w  ww  . j  a v a 2  s  .c om
 */
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  av  a 2  s .  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

private void showStacktraceArea() {
    // create the stacktrace container area
    this.stackTraceAreaControl = new Composite((Composite) getContents(), SWT.NONE);
    this.stackTraceAreaControl.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout containerLayout = new GridLayout();
    containerLayout.marginHeight = containerLayout.marginWidth = 0;
    this.stackTraceAreaControl.setLayout(containerLayout);

    // the text inside the stacktrace area
    this.stacktraceAreaText = new Text(this.stackTraceAreaControl,
            SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    this.stacktraceAreaText.setLayoutData(new GridData(GridData.FILL_BOTH));

    // update button
    this.detailsButton.setText(IDialogConstants.HIDE_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  a v  a 2s.c o  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());
            }//from w  ww.  ja va2  s .  c om
            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.gmf.internal.codegen.popup.actions.DiagnosticsDialog.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 av a  2 s . c  o  m*/
 */
private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (detailsCreated) {
        diagnosticTree.getTree().dispose();
        stackTraceText.dispose();

        detailsCreated = false;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        createDetailsArea((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.jst.j2ee.internal.plugin.ErrorDialog.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  2  s.  c  o  m
 */
private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    Point oldSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (text != null) {
        text.dispose();
        text = null;
        getButton(detailButtonID).setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        createDropDownText((Composite) getContents());
        getButton(detailButtonID).setText(IDialogConstants.HIDE_DETAILS_LABEL);
    }
    Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
}

From source file:org.eclipse.mat.ui.snapshot.RuntimeListDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.DETAILS_ID) {
        if (detailsButton.getText().equals(IDialogConstants.SHOW_DETAILS_LABEL)) {
            detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
            Object selection = ((IStructuredSelection) getTableViewer().getSelection()).getFirstElement();
            if (selection instanceof MultipleSnapshotsException.Context) {
                updateDetails((MultipleSnapshotsException.Context) selection);
            }/*  w w w .  j  a  v a  2  s  . c  om*/
        } else {
            detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
            updateDetails(null);
        }

    } else {
        super.buttonPressed(buttonId);
    }
}

From source file:org.eclipse.mat.ui.snapshot.RuntimeListDialog.java

License:Open Source License

private void updateDetails(MultipleSnapshotsException.Context runtime) {
    Point shellSize = getShell().getSize();
    Point originalContentsSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);

    if (runtime != null && detailsButton.getText().equals(IDialogConstants.HIDE_DETAILS_LABEL)) {
        if (detailsText == null) {
            detailsText = new Text(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY);
        }/*from  w w  w  . j a  va2  s . c  om*/
        detailsText.setText(getDetails(runtime));
        GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL
                | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL);
        data.heightHint = detailsText.getLineHeight() * 15;
        data.horizontalSpan = 2;
        detailsText.setLayoutData(data);
    } else {
        if (detailsText != null) {
            detailsText.dispose();
            detailsText = null;
        }
    }

    Point newContentsSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    getShell().setSize(new Point(shellSize.x, shellSize.y + (newContentsSize.y - originalContentsSize.y)));
}