@Override protected void handleShellCloseEvent() { /* * Close the tray to ensure that those dialogs that remember their * size do not store the tray size. */ if (getTray() != null) { closeTray(); } super.handleShellCloseEvent(); }
public boolean close() { /* * Close the tray to ensure that those dialogs that remember their * size do not store the tray size. */ if (getTray() != null) { closeTray(); } return super.close(); }
@Override protected void handleShellCloseEvent() { /* * Close the tray to ensure that those dialogs that remember their * size do not store the tray size. */ if (getTray() != null) { closeTray(); } super.handleShellCloseEvent(); }
private void helpPressed() { if (getTray() == null || fHelpButton != null && fHelpButton.getSelection()) { // help button was not selected before if (getShell() != null) { Control c = getShell().getDisplay().getFocusControl(); while (c != null) { if (c.isListening(SWT.Help)) { c.notifyListeners(SWT.Help, new Event()); break; } c = c.getParent(); } if (fHelpButton != null && getTray() != null) { fHelpButton.setSelection(true); } } } else { closeTray(); } }
/** * Executes the command. */ public Object execute(ExecutionEvent event) throws ExecutionException { Display display = Display.getCurrent(); if (display == null) { display = Display.getDefault(); } if (display != null) { Shell shell = Display.getCurrent().getActiveShell(); if (shell != null && !shell.isDisposed()) { Object shellData = shell.getData(); if (shellData instanceof TrayDialog) { TrayDialog trayDialog = (TrayDialog)shellData; if (trayDialog.getTray() instanceof HelpTray) { trayDialog.closeTray(); } } } } return null; } }
private void helpPressed() { if (getTray() == null) { if (getShell() != null) { Control c = getShell().getDisplay().getFocusControl(); while (c != null) { if (c.isListening(SWT.Help)) { c.notifyListeners(SWT.Help, new Event()); break; } c = c.getParent(); } } } else { closeTray(); } }
throw new NullPointerException("Tray was null"); //$NON-NLS-1$ if (getTray() != null) { throw new IllegalStateException("Tray was already open"); //$NON-NLS-1$
throw new NullPointerException("Tray was null"); //$NON-NLS-1$ if (getTray() != null) { throw new IllegalStateException("Tray was already open"); //$NON-NLS-1$
throw new NullPointerException("Tray was null"); //$NON-NLS-1$ if (getTray() != null) { throw new IllegalStateException("Tray was already open"); //$NON-NLS-1$
if (getTray() == null) { throw new IllegalStateException("Tray was not open"); //$NON-NLS-1$
private void displayContextAsHelpTray(Shell activeShell, IContext context) { Control controlInFocus = activeShell.getDisplay().getFocusControl(); TrayDialog dialog = (TrayDialog)activeShell.getData(); DialogTray tray = dialog.getTray(); if (tray == null) { tray = new HelpTray(); dialog.openTray(tray); } if (tray instanceof HelpTray) { ReusableHelpPart helpPart = ((HelpTray)tray).getHelpPart(); if (context != null) { IHelpResource[] topics = context.getRelatedTopics(); if (context.getText() == null && topics.length == 1) { helpPart.showURL(topics[0].getHref()); helpPart.update(context, null, controlInFocus); } else { helpPart.showPage(IHelpUIConstants.HV_CONTEXT_HELP_PAGE); helpPart.update(context, null, controlInFocus); } } else { helpPart.showPage(IHelpUIConstants.HV_FSEARCH_PAGE, true); } } else { // someone else was occupying the tray; not supported } }
if (getTray() == null) { throw new IllegalStateException("Tray was not open"); //$NON-NLS-1$
if (getTray() == null) { throw new IllegalStateException("Tray was not open"); //$NON-NLS-1$
HelpTray tray = (HelpTray)dialog.getTray(); if (tray == null) { tray = new HelpTray();
HelpTray tray = (HelpTray)dialog.getTray(); if (tray == null) { tray = new HelpTray();