List of usage examples for org.eclipse.jface.dialogs IDialogConstants DETAILS_ID
int DETAILS_ID
To view the source code for org.eclipse.jface.dialogs IDialogConstants DETAILS_ID.
Click Source Link
From source file:org.eclipse.ui.internal.statushandlers.InternalDialog.java
License:Open Source License
/** * This method creates buttons that are placed on button bar. */// ww w . j a v a2s . c o m protected void createButtonsForButtonBar(Composite parent) { IAction gotoAction = getGotoAction(); String text = null; if (gotoAction != null) { text = gotoAction.getText(); } Button button = createButton(parent, GOTO_ACTION_ID, text == null ? "" : text, //$NON-NLS-1$ false); if (text == null) hideButton(button, true); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL, false); }
From source file:org.eclipse.ui.internal.statushandlers.InternalDialog.java
License:Open Source License
/** * Update the button enablements//from w w w .j a v a 2 s. c o m */ private void updateEnablements() { Button details = getButton(IDialogConstants.DETAILS_ID); if (details != null) { details.setEnabled(true); } Button gotoButton = getButton(GOTO_ACTION_ID); if (gotoButton != null) { IAction gotoAction = getGotoAction(); boolean hasValidGotoAction = (gotoAction != null) && (gotoAction.getText() != null); if (hasValidGotoAction) { hideButton(gotoButton, false); gotoButton.setText(gotoAction.getText()); ((GridData) gotoButton.getLayoutData()).widthHint = gotoButton.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; gotoButton.getParent().layout(); } else hideButton(gotoButton, true); } // and tray enablement button if (providesSupport() && !getBooleanValue(IStatusDialogConstants.HIDE_SUPPORT_BUTTON)) { if (launchTrayLink == null || launchTrayLink.isDisposed()) { launchTrayLink = createGetSupportLink(); } launchTrayLink.setEnabled(!getBooleanValue(IStatusDialogConstants.TRAY_OPENED)); } else { if (launchTrayLink != null && !launchTrayLink.isDisposed()) { launchTrayLink.dispose(); launchTrayLink = null; } } IViewDescriptor descriptor = shouldDisplayLinkToErrorLog(); if (descriptor != null) { if (showErrorLogLink == null || showErrorLogLink.isDisposed()) { showErrorLogLink = createShowErrorLogLink(); } } else { if (showErrorLogLink != null && !showErrorLogLink.isDisposed()) { showErrorLogLink.dispose(); } } linkComposite.getParent().layout(); }
From source file:org.eclipse.ui.internal.statushandlers.StatusDialog.java
License:Open Source License
private void updateEnablements() { Button details = getButton(IDialogConstants.DETAILS_ID); if (details != null) { details.setEnabled(true);//from ww w . jav a 2s .co m } Button gotoButton = getButton(GOTO_ACTION_ID); if (gotoButton != null) { IAction gotoAction = getGotoAction(); boolean hasValidGotoAction = gotoAction != null; String text = gotoButton.getText(); String newText = null; if (hasValidGotoAction) { newText = gotoAction.getText(); } if (newText == null) { hasValidGotoAction = false; newText = "Custom Operation Action"; } if (!newText.equals(text)) { gotoButton.setText(newText); } gotoButton.setEnabled(hasValidGotoAction); gotoButton.setVisible(hasValidGotoAction); } }
From source file:org.jboss.tools.common.model.ui.dialog.ErrorDialog.java
License:Open Source License
protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, "Submit", false); if (exception != null) { detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL, false);//from w w w . jav a 2s . c o m createButton(parent, IDialogConstants.CANCEL_ID, "Cancel", false); } }
From source file:org.jboss.tools.common.model.ui.dialog.ErrorDialog.java
License:Open Source License
protected void buttonPressed(int id) { if (text == null || text.isDisposed()) { if (problemText == null) { problemText = createProblemText(); }//from ww w . j a v a2 s . c o m } else { problemText = text.getText(); } if (id == IDialogConstants.DETAILS_ID) { // was the details button pressed? toggleDetailsArea(); } else { super.buttonPressed(id); } }
From source file:org.jboss.tools.common.model.ui.dialog.test.ErrorDialogTest.java
License:Open Source License
/** * Test method for {@link org.jboss.tools.common.model.ui.dialog.ErrorDialog#buttonPressed(int)}. *//*ww w . j a v a 2s. c o m*/ public void testButtonPressed() { ErrorDialogTestWrapper errDialog = new ErrorDialogTestWrapper(Display.getCurrent().getActiveShell(), "Title1", new Exception("Exception Message")); errDialog.setBlockOnOpen(false); errDialog.open(); errDialog.buttonPressed(IDialogConstants.DETAILS_ID); errDialog.buttonPressed(IDialogConstants.DETAILS_ID); errDialog.close(); }
From source file:org.jboss.tools.common.model.ui.dialog.test.ErrorDialogTest.java
License:Open Source License
/** * Test method for {@link org.jboss.tools.common.model.ui.dialog.ErrorDialog#ErrorDialog(org.eclipse.swt.widgets.Shell, java.lang.String, java.lang.String, java.lang.Throwable)}. *//*from ww w . ja va 2s. c om*/ public void testErrorDialogShellStringStringThrowable() { ErrorDialogTestWrapper errDialog = new ErrorDialogTestWrapper(Display.getCurrent().getActiveShell(), "Title1", "Message", new Exception("Exception Message")); errDialog.setBlockOnOpen(false); errDialog.open(); errDialog.buttonPressed(IDialogConstants.DETAILS_ID); errDialog.buttonPressed(IDialogConstants.DETAILS_ID); errDialog.close(); }
From source file:org.jboss.tools.common.model.ui.dialog.test.ErrorDialogTest.java
License:Open Source License
/** * Test method for {@link org.jboss.tools.common.model.ui.dialog.ErrorDialog#ErrorDialog(org.eclipse.swt.widgets.Shell, java.lang.String, java.lang.String, java.lang.Throwable)}. *//*www . j av a 2 s .com*/ public void testErrorDialogShellStringThrowable() { ErrorDialogTestWrapper errDialog = new ErrorDialogTestWrapper(Display.getCurrent().getActiveShell(), "Title1", new Exception("Exception Message")); errDialog.setBlockOnOpen(false); errDialog.open(); errDialog.buttonPressed(IDialogConstants.DETAILS_ID); errDialog.buttonPressed(IDialogConstants.DETAILS_ID); errDialog.close(); }
From source file:org.jkiss.dbeaver.ui.actions.navigator.NavigatorHandlerObjectDelete.java
License:Open Source License
private ConfirmResult confirmObjectDelete(final IWorkbenchWindow workbenchWindow, final DBNNode node, final boolean viewScript) { if (deleteAll != null) { return deleteAll ? ConfirmResult.YES : ConfirmResult.NO; }/*from ww w. j av a 2 s . c o m*/ ResourceBundle bundle = DBeaverActivator.getCoreResourceBundle(); String objectType = node instanceof DBNLocalFolder ? DBeaverPreferences.CONFIRM_LOCAL_FOLDER_DELETE : DBeaverPreferences.CONFIRM_ENTITY_DELETE; String titleKey = ConfirmationDialog.RES_CONFIRM_PREFIX + objectType + "_" //$NON-NLS-1$ + ConfirmationDialog.RES_KEY_TITLE; String messageKey = ConfirmationDialog.RES_CONFIRM_PREFIX + objectType + "_" //$NON-NLS-1$ + ConfirmationDialog.RES_KEY_MESSAGE; String nodeTypeName = node.getNodeType(); MessageDialog dialog = new MessageDialog(workbenchWindow.getShell(), UIUtils.formatMessage(bundle.getString(titleKey), nodeTypeName, node.getNodeName()), DBeaverIcons.getImage(UIIcon.REJECT), UIUtils.formatMessage(bundle.getString(messageKey), nodeTypeName.toLowerCase(), node.getNodeName()), MessageDialog.CONFIRM, null, 0) { @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, true); createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, false); if (structSelection.size() > 1) { createButton(parent, IDialogConstants.YES_TO_ALL_ID, IDialogConstants.YES_TO_ALL_LABEL, false); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); } if (viewScript) { createButton(parent, IDialogConstants.DETAILS_ID, CoreMessages.actions_navigator_view_script_button, false); } } }; int result = dialog.open(); switch (result) { case IDialogConstants.YES_ID: return ConfirmResult.YES; case IDialogConstants.YES_TO_ALL_ID: deleteAll = true; return ConfirmResult.YES; case IDialogConstants.NO_ID: return ConfirmResult.NO; case IDialogConstants.CANCEL_ID: case -1: deleteAll = false; return ConfirmResult.NO; case IDialogConstants.DETAILS_ID: return ConfirmResult.DETAILS; default: log.warn("Unsupported confirmation dialog result: " + result); //$NON-NLS-1$ return ConfirmResult.NO; } }
From source file:org.jkiss.dbeaver.ui.controls.resultset.FilterValueEditDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { if (operator.getArgumentCount() == 1) { Button copyButton = createButton(parent, IDialogConstants.DETAILS_ID, "Clipboard", false); copyButton.setImage(DBeaverIcons.getImage(UIIcon.FILTER_CLIPBOARD)); }/* w ww . j a va2s. co m*/ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }