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.jkiss.dbeaver.ui.editors.entity.ErrorEditorPartEx.java

License:Open Source License

private void updateDetailsText() {
    if (details != null) {
        details.dispose();/*from   w  w  w.j ava2 s. c om*/
        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(getDetails());
        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.org.eclipse.core.utils.platform.dialogs.message.AbstractInformationDialog.java

License:Open Source License

/**
 * Toggles the unfolding of the details area. This is triggered by the user pressing the details button.
 *//*  ww w .  jav  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(detailButtonIndex).setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        createDropDownText((Composite) getDialogArea());
        text.setSize(oldSize.x - this.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING),
                oldSize.y - convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING));
        getButton(detailButtonIndex).setText(IDialogConstants.HIDE_DETAILS_LABEL);
    }

    Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    getContents()
            .setSize(new Point(windowSize.x + (newSize.x - oldSize.x), windowSize.y + (newSize.y - oldSize.y)));

}

From source file:org.seasar.uruma.ui.dialogs.UrumaErrorDialog.java

License:Apache License

protected void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    if (detailsCreated) {
        detailTreeViewer.getTree().dispose();
        detailsCreated = false;//from  w  w w . ja v  a  2  s.c  o  m
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        detailTreeViewer = createDetailsTreeViewer((Composite) getContents());
        detailTreeViewer.setInput("");
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
        detailsCreated = true;
    }
    Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
}

From source file:org.talend.mdm.repository.ui.dialogs.ValidationResultDialog.java

License:Open Source License

private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    if (detailsComposite != null) {
        detailsComposite.dispose();/*from  ww w  .j  a  v  a  2 s.c  om*/
        detailsComposite = null;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
        GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(2, 1)
                .applyTo(dialogArea);
    } else {
        detailsComposite = createDetailsComposite((Composite) getContents());
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
        GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1)
                .applyTo(dialogArea);
    }
    ((Composite) getContents()).layout();
    Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    getShell().setSize(new Point(windowSize.x, newSize.y));
}

From source file:org.testeditor.ui.reporting.TestExecutionProgressDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {

    // adding new button for closing the dialog on demand
    closeButton = createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true);
    closeButton.setEnabled(false);//  w  w  w  .ja  v a2  s  .  co  m

    closeButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            close();
            dispose();
        }
    });

    // adding new button for closing the dialog on demand
    detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL,
            true);

    detailsButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {

            if (logViewerComposite.getVisible()) {
                logViewerComposite.setVisible(false);
                detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
                TestExecutionProgressDialog.this.parent.getShell().setSize(DEFAULT_DIALOG_SIZE);
            } else {
                logViewerComposite.setVisible(true);
                detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
                TestExecutionProgressDialog.this.parent.getShell().setSize(ENLARGED_DIALOG_SIZE);
            }

            TestExecutionProgressDialog.this.parent.getShell().layout();
        }
    });

    super.createButtonsForButtonBar(parent);
}

From source file:org.tigris.subversion.subclipse.ui.util.DetailsDialog.java

License:Open Source License

/**
 * Toggles the unfolding of the details area.  This is triggered by
 * the user pressing the details button.
 *//*from   w  w  w . j ava 2  s  . c o  m*/
private void toggleDetailsArea() {
    Point windowSize = getShell().getSize();
    Point oldSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT);

    if (detailsCreated) {
        detailsComposite.dispose();
        detailsCreated = false;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    } else {
        detailsComposite = createDropDownDialogArea((Composite) getContents());
        detailsCreated = true;
        detailsButton.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.wso2.developerstudio.eclipse.errorreporter.ui.dialogs.ErrorNotificationDialog.java

License:Open Source License

/**
 * This method contains the logic to execute when the details button is
 * pressed. This method shows and hides the error report.
 *//*from   www .ja  v  a  2s  .  c  om*/

private void toggleDetailsArea() {
    boolean opened = false;
    Point windowSize = getShell().getSize();
    if (listCreated) {
        list.dispose();
        listCreated = false;
        detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
        opened = false;
    } else {
        list = createDropDownList((Composite) getContents());
        detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
        getContents().getShell().layout();
        opened = true;
    }
    Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    int diffY = newSize.y - windowSize.y;
    // increase the dialog height if details were opened and such increase
    // is necessary
    // decrease the dialog height if details were closed and empty space
    // appeared
    if ((opened && diffY > 0) || (!opened && diffY < 0)) {
        getShell().setSize(new Point(windowSize.x, windowSize.y + (diffY)));
    }
}