/** * Show the details portion of the dialog if it is not already visible. This * method will only work when it is invoked after the control of the dialog * has been set. In other words, after the <code>createContents</code> * method has been invoked and has returned the control for the content area * of the dialog. Invoking the method before the content area has been set * or after the dialog has been disposed will have no effect. * */ protected final void showDetailsArea() { if (!listCreated) { Control control = getContents(); if (control != null && !control.isDisposed()) { toggleDetailsArea(); } } }
/** * Show the details portion of the dialog if it is not already visible. This * method will only work when it is invoked after the control of the dialog * has been set. In other words, after the <code>createContents</code> * method has been invoked and has returned the control for the content area * of the dialog. Invoking the method before the content area has been set * or after the dialog has been disposed will have no effect. * * @since 3.1 */ protected final void showDetailsArea() { if (!listCreated) { Control control = getContents(); if (control != null && !control.isDisposed()) { toggleDetailsArea(); } } }
/** * Show the details portion of the dialog if it is not already visible. This * method will only work when it is invoked after the control of the dialog * has been set. In other words, after the <code>createContents</code> * method has been invoked and has returned the control for the content area * of the dialog. Invoking the method before the content area has been set * or after the dialog has been disposed will have no effect. * * @since 3.1 */ protected final void showDetailsArea() { if (!listCreated) { Control control = getContents(); if (control != null && !control.isDisposed()) { toggleDetailsArea(); } } }
/** * Toggles the unfolding of the details area. This is triggered by the user * pressing the details button. */ 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))); } }
/** * Toggles the unfolding of the details area. This is triggered by the user * pressing the details button. */ 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))); } }
/** * 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) { list.dispose(); listCreated = false; detailsButton.setText(IDialogConstants.get().SHOW_DETAILS_LABEL); } else { list = createDropDownList((Composite) getContents()); detailsButton.setText(IDialogConstants.get().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))); }