List of usage examples for org.eclipse.jface.dialogs IDialogConstants SHOW_DETAILS_LABEL
String SHOW_DETAILS_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants SHOW_DETAILS_LABEL.
Click Source Link
From source file:com.google.code.t4eclipse.tools.dialog.InternalErrorDialog.java
License:Open Source License
/** * Convenience method to open a simple Yes/No question dialog. * /* w w w . j av a 2s .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 boolean openQuestion(Shell parent, String title, String message, Throwable detail, int defaultIndex) { String[] labels; if (detail == null) { labels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }; } else { labels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.SHOW_DETAILS_LABEL }; } InternalErrorDialog dialog = new InternalErrorDialog(parent, title, null, // accept the default window icon message, detail, QUESTION, labels, defaultIndex); if (detail != null) { dialog.setDetailButton(2); } return dialog.open() == 0; }
From source file:com.jaspersoft.studio.jface.dialogs.DataAdapterErrorDialog.java
License:Open Source License
/** * Toggles the unfolding of the details area. This is triggered by the user * pressing the details button./*from www . ja v a2s . c o m*/ */ private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (textCreated) { text.dispose(); textCreated = false; detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { text = createDropDownList((Composite) getContents()); detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); getContents().getShell().layout(); } Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y))); }
From source file:com.maccasoft.ui.internal.application.InternalErrorDialog.java
License:Open Source License
/** * Toggles the unfolding of the details area. This is triggered by * the user pressing the details button. *///from ww w .ja v a2 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:com.maccasoft.ui.internal.application.WorkbenchExceptionHandler.java
License:Open Source License
private boolean openQuestion(Shell parent, String title, String message, Throwable detail, int defaultIndex) { String[] labels;/*from w w w . j ava2 s. com*/ if (detail == null) { labels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }; } else { labels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.SHOW_DETAILS_LABEL }; } dialog = new InternalErrorDialog(parent, title, null, message, detail, MessageDialog.QUESTION, labels, defaultIndex); if (detail != null) { dialog.setDetailButton(2); } boolean result = dialog.open() == Window.OK; dialog = null; return result; }
From source file:com.mercatis.lighthouse3.base.ui.widgets.LighthouseErrorDialog.java
License:Apache License
/** * /*from w w w. ja v a 2 s . c o m*/ */ private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (stackTraceExpanded) { stackTraceText.dispose(); stackTraceExpanded = false; detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { stackTraceText = createStackTraceText((Composite) getContents()); detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); stackTraceExpanded = true; } Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y))); }
From source file:com.mercatis.lighthouse3.base.ui.widgets.LighthouseErrorDialog.java
License:Apache License
/** * @param parent/* www . ja v a 2 s . c o m*/ */ private void createDetailsButton(Composite parent) { detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL, false); }
From source file:com.sap.netweaver.porta.ide.eclipse.server.ui.dialogs.PublishProblemDialog.java
License:Open Source License
public PublishProblemDialog(Shell parentShell, PublishException exception) { super(parentShell, "Publishing Problem", null, /* dialogTitleImage */ exception.getMessage(), getImage(exception.getDeployResult().getStatus()), new String[] { IDialogConstants.SHOW_DETAILS_LABEL, IDialogConstants.CLOSE_LABEL }, 1); this.exception = exception; setShellStyle(getShellStyle() | SWT.RESIZE); }
From source file:com.sap.netweaver.porta.ide.eclipse.server.ui.dialogs.PublishProblemDialog.java
License:Open Source License
private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (detailsText != null) { detailsText.dispose();//from w ww .j a v a2s . c om detailsText = null; getButton(DETAILS_BUTTON_ID).setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { createDropDownText((Composite) getContents()); getButton(DETAILS_BUTTON_ID).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:com.windowtester.eclipse.ui.dialogs.AbstractDetailsDialog.java
License:Open Source License
/** * Override superclass implementation to create OK and Details buttons * but no cancel button./*w w w .j av a 2s . c o m*/ * * @param parent the button bar */ protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false); detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL, false); }
From source file:com.windowtester.eclipse.ui.dialogs.AbstractDetailsDialog.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. c o m*/ protected void toggleDetailsArea() { Point oldWindowSize = getShell().getSize(); Point newWindowSize = cachedWindowSize; cachedWindowSize = oldWindowSize; // show the details area if (detailsArea == null) { detailsArea = createDetailsArea((Composite) getContents()); detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); } // hide the details area else { detailsArea.dispose(); detailsArea = null; detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); } /* * Must be sure to call getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT) * before calling getShell().setSize(newWindowSize); * since controls have been added or removed */ // compute the new window size Point oldSize = getContents().getSize(); Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (newWindowSize == null) newWindowSize = new Point(oldWindowSize.x, oldWindowSize.y + (newSize.y - oldSize.y)); // crop new window size to screen Point windowLoc = getShell().getLocation(); Rectangle screenArea = getContents().getDisplay().getClientArea(); if (newWindowSize.y > screenArea.height - (windowLoc.y - screenArea.y)) newWindowSize.y = screenArea.height - (windowLoc.y - screenArea.y); getShell().setSize(newWindowSize); ((Composite) getContents()).layout(); }