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

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

Introduction

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

Prototype

int DETAILS_ID

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

Click Source Link

Document

Button id for a "Details" button (value 13).

Usage

From source file:org.jkiss.dbeaver.ui.controls.resultset.FilterValueEditDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.DETAILS_ID) {
        try {//  ww  w .ja  v a 2  s .  c om
            Object value = ResultSetUtils.getAttributeValueFromClipboard(attr);
            editor.primeEditorValue(value);
        } catch (DBException e) {
            UIUtils.showErrorDialog(getShell(), "Copy from clipboard", "Can't copy value", e);
        }
    } else {
        super.buttonPressed(buttonId);
    }
}

From source file:org.jkiss.dbeaver.ui.controls.resultset.valuefilter.FilterValueEditDialog.java

License:Apache License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    if (handler.operator.getArgumentCount() == 1) {
        Button copyButton = createButton(parent, IDialogConstants.DETAILS_ID, "Clipboard", false);
        copyButton.setImage(DBeaverIcons.getImage(UIIcon.FILTER_CLIPBOARD));
    }//from   w ww  . jav  a2 s . c  o  m

    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}

From source file:org.jkiss.dbeaver.ui.controls.resultset.valuefilter.FilterValueEditDialog.java

License:Apache License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.DETAILS_ID) {
        try {/*from www  .  j a v  a2 s.c  o  m*/
            Object value = ResultSetUtils.getAttributeValueFromClipboard(handler.attr);
            handler.editor.primeEditorValue(value);
        } catch (DBException e) {
            DBUserInterface.getInstance().showError("Copy from clipboard", "Can't copy value", e);
        }
    } else {
        super.buttonPressed(buttonId);
    }
}

From source file:org.jkiss.dbeaver.ui.dialogs.ConnectionLostDialog.java

License:Apache License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.DETAILS_ID) {
        super.buttonPressed(buttonId);
        return;//from w  w  w. ja v  a  2s  .co  m
    }
    setReturnCode(buttonId);
    close();
}

From source file:org.jkiss.dbeaver.ui.dialogs.sql.BaseSQLDialog.java

License:Open Source License

protected void createCopyButton(Composite parent) {
    createButton(parent, IDialogConstants.DETAILS_ID, CoreMessages.dialog_view_sql_button_copy, false);
}

From source file:org.jkiss.dbeaver.ui.dialogs.sql.BaseSQLDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.DETAILS_ID) {
        saveToClipboard();/*from  w ww  . j a  v  a  2  s  . co m*/
    } else {
        super.buttonPressed(buttonId);
    }
}

From source file:org.jkiss.dbeaver.ui.dialogs.sql.GenerateMultiSQLDialog.java

License:Open Source License

protected void createObjectsSelector(Composite parent) {
    if (selectedObjects.size() < 2) {
        // Don't need it for a single object
        return;/*from   w w w . j  a  v  a2 s . c o m*/
    }
    UIUtils.createControlLabel(parent, "Tables");
    objectsTable = new Table(parent, SWT.BORDER | SWT.CHECK);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = 100;
    objectsTable.setLayoutData(gd);
    for (T table : selectedObjects) {
        TableItem item = new TableItem(objectsTable, SWT.NONE);
        item.setText(DBUtils.getObjectFullName(table));
        item.setImage(DBeaverIcons.getImage(DBIcon.TREE_TABLE));
        item.setChecked(true);
        item.setData(table);
    }
    objectsTable.addSelectionListener(SQL_CHANGE_LISTENER);
    objectsTable.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean hasChecked = !getCheckedObjects().isEmpty();
            getButton(IDialogConstants.OK_ID).setEnabled(hasChecked);
            getButton(IDialogConstants.DETAILS_ID).setEnabled(hasChecked);
        }
    });
}

From source file:org.nightlabs.base.ui.exceptionhandler.DefaultErrorDialog.java

License:Open Source License

@Override
protected void buttonPressed(int buttonId) {
    switch (buttonId) {
    case IDialogConstants.DETAILS_ID:
        boolean show = ((GridData) stackTraceText.getLayoutData()).heightHint == 0;
        logger.debug("showing stack trace: " + show); //$NON-NLS-1$
        showStackTrace(show);/*from  www .j a  v a 2s . c o  m*/
        break;
    case SEND_ERROR_REPORT_ID:
        //         ErrorItem error = errorTable.getSelectedItem();
        ErrorReport errorReport = null;
        for (ErrorItem error : errorList) {
            if (errorReport == null)
                errorReport = new ErrorReport(error.getThrownException(), error.getTriggerException());
            else
                errorReport.addThrowablePair(error.getThrownException(), error.getTriggerException());
        }

        if (errorReport == null) {
            Exception xxx = new IllegalStateException(
                    "There was no error in the errorList!!! How can this happen?!"); //$NON-NLS-1$
            errorReport = new ErrorReport(xxx, xxx);
        }

        if (this.exceptHandlerParam.getErrorScreenShot() != null)
            errorReport.setErrorScreenshot(this.exceptHandlerParam.getErrorScreenShot());

        ErrorReportWizardDialog dlg = new ErrorReportWizardDialog(errorReport);
        okPressed();
        dlg.open();
        break;
    default:
        super.buttonPressed(buttonId);
    }
}

From source file:org.nightlabs.base.ui.exceptionhandler.DefaultErrorDialog.java

License:Open Source License

@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);
    createButton(parent, SEND_ERROR_REPORT_ID,
            Messages.getString(//w  w w  .ja v  a 2 s.c  o  m
                    "org.nightlabs.base.ui.exceptionhandler.DefaultErrorDialog.button.sendErrorReport.text"), //$NON-NLS-1$
            false);
    // FIXME: Build-Problem: .SHOW_DETAILS_LABEL is static in RCP but nun-static in RAP, can't build only against one platform!!
    //      detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, CompatibleDialogConstants.get().SHOW_DETAILS_LABEL, false);
    detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, "Show details", false);
}

From source file:org.search.niem.uml.qvt.ui.handlers.TransformDelegate.java

License:Open Source License

private boolean shouldContinue(final Shell shell, final IStatus status) {
    final ErrorDialog dialog = new ErrorDialog(shell,
            Activator.INSTANCE.getString("_UI_NIEM_TransformDelegate_validation_dialog_title"),
            getValidationMessage(status), status, IStatus.ERROR | IStatus.WARNING | IStatus.INFO) {

        @Override/*from   ww w.  j  a  v  a  2s. c  o m*/
        protected Control createContents(final Composite parent) {
            final Control contents = super.createContents(parent);
            shell.getDisplay().asyncExec(new Runnable() {
                @Override
                public void run() {
                    buttonPressed(IDialogConstants.DETAILS_ID);
                }
            });
            return contents;
        }

        @Override
        protected void createButtonsForButtonBar(final Composite parent) {
            createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false);
            createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
            createDetailsButton(parent);
        }

        @Override
        protected void buttonPressed(final int id) {
            if (id == IDialogConstants.YES_ID) {
                super.buttonPressed(IDialogConstants.OK_ID);
            } else if (id == IDialogConstants.NO_ID) {
                super.buttonPressed(IDialogConstants.CANCEL_ID);
            }
            super.buttonPressed(id);
        }

        @Override
        protected int getShellStyle() {
            return super.getShellStyle() | SWT.SHEET;
        }
    };
    final AtomicBoolean result = new AtomicBoolean();
    shell.getDisplay().syncExec(new Runnable() {
        @Override
        public void run() {
            result.set(dialog.open() == IDialogConstants.OK_ID);
        }
    });
    return result.get();
}