List of usage examples for org.eclipse.jface.dialogs IDialogConstants HIDE_DETAILS_LABEL
String HIDE_DETAILS_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants HIDE_DETAILS_LABEL.
Click Source Link
From source file:de.bht.fpa.mail.s000000.common.rcp.exception.ExceptionDetailsErrorDialog.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 .ja v a 2 s .c o m*/ */ private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (listCreated) { text.dispose(); listCreated = false; detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { text = 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:eu.transkribus.swt_canvas.util.ExceptionDetailsErrorDialog.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 2 s .co m*/ */ private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (listCreated) { text.dispose(); listCreated = false; detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { text = 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:jbt.tools.bteditor.util.DetailsDialog.java
License:Open Source License
protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.DETAILS_ID) { /*//from ww w . ja va2s . c o m * If the details button has been pressed, then the details area * must be shown or hidden, depending on whether it as hidden or * not. After doing so, the dialog must be resized. */ Point dialogOldDimensions = getShell().getSize(); if (this.detailsTextCreated) { /* * If the details area is being showed, we delete it. Also, the * label on the details button must be changed. */ this.detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); this.detailsText.dispose(); } else { /* * If the text area is not being showed, it must be created and * showed. In order to do so, we initialize "this.detailsText". * Also, the label on the details button must be changed. */ this.detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); this.detailsText = new Text((Composite) getContents(), SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL); this.detailsText.setText(this.details); GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); this.detailsText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); data.horizontalSpan = 2; this.detailsText.setLayoutData(data); } getContents().getShell().layout(); this.detailsTextCreated = !this.detailsTextCreated; /* * The dialog is finalli resized. */ Point dialogNewDimensions = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); int screenHeight = Display.getCurrent().getClientArea().height; getShell().setSize(new Point(dialogOldDimensions.x, Math.min(dialogNewDimensions.y, screenHeight))); } else { /* * Close the dialog... */ close(); } setReturnCode(buttonId); }
From source file:msi.gama.gui.swt.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 w ww. j av a 2 s . c o m*/ */ protected void toggleDetailsArea() { final 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. final Point oldSize = getContents().getSize(); final 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. final Point windowLoc = getShell().getLocation(); final 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(); }
From source file:net.bioclipse.core.util.ExceptionDetailsErrorDialog.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 a v a 2s.co m */ private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (listCreated) { text.dispose(); listCreated = false; detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { text = 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))); if (!text.isDisposed()) text.redraw(); }
From source file:net.refractions.udig.ui.ExceptionDetailsDialog.java
License:Open Source License
protected void toggleDetailsArea() { Point oldWindowSize = getShell().getSize(); Point newWindowSize = cachedWindowSize; cachedWindowSize = oldWindowSize;// ww w. j av a 2 s . c o m // 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(); }
From source file:net.sourceforge.taggerplugin.dialog.AbstractDetailsDialog.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 av a 2 s. com protected void toggleDetailsArea() { Point oldWindowSize = getShell().getSize(); Point newWindowSize = cachedWindowSize; cachedWindowSize = oldWindowSize; if (detailsArea == null) { detailsArea = createDetailsArea((Composite) getContents()); detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); } 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(); }
From source file:nl.utwente.ce.imageexport.ExceptionErrorDialog.java
License:Open Source License
/** Toggles the unfolding of the details area. This is triggered by the user pressing the details button. */ private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (listCreated) { text.dispose();/*from w w w . j a va2 s. c o m*/ listCreated = false; detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { text = createDropDownText((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:org.bonitasoft.studio.common.jface.BonitaErrorDialog.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 . ja va 2s .c o m */ 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); 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:org.ebayopensource.turmeric.eclipse.utils.ui.SOAErrorDialog.java
License:Open Source License
/** * Toggles the unfolding of the details area. This is triggered by the user * pressing the details button./* www .ja v a 2 s . c o m*/ */ private void showDetialsArea() { Point windowSize = getShell().getSize(); Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); // if list showed, hide list. Otherwise, show list. if (isListCreated) { messageList.dispose(); isListCreated = false; detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); // #added by wecai ((GridData) this.dialogArea.getLayoutData()).grabExcessVerticalSpace = true; } else { messageList = createDetailsList((Composite) getContents()); detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); // #added by wecai ((GridData) this.dialogArea.getLayoutData()).grabExcessVerticalSpace = false; } // resize dialog. Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y))); }