/** * * Overrides to set focus to the specific page if it a specific page was * requested. * * @since 3.5 */ @Override public int open() { IPreferencePage selectedPage = getCurrentPage(); if ((initialPageId != null) && (selectedPage != null)) { Shell shell = getShell(); if ((shell != null) && (!shell.isDisposed())) { shell.open(); // make the dialog visible to properly set the focus Control control = selectedPage.getControl(); if (!SwtUtil.isFocusAncestor(control)) control.setFocus(); } } return super.open(); }
PreferenceDialog dialog = (PreferenceDialog) object; IPreferencePage page = (IPreferencePage) dialog.getSelectedPage(); processHelp(page.getControl().getShell(), helpBuffer); processChildren(page.getControl(), helpBuffer); } else if (object instanceof Dialog) { Dialog dialog = (Dialog) object;
@Override public void helpRequested(HelpEvent event) { if (currentPage == null) { // no current page? open dialog's help openDialogHelp(); return; } // A) A typical path: the current page has registered its own help link // via WorkbenchHelpSystem#setHelp(). When just call it and let // it handle the help request. Control pageControl = currentPage.getControl(); if (pageControl != null && pageControl.isListening(SWT.Help)) { currentPage.performHelp(); return; } // B) Less typical path: no standard listener has been created for the page. // In this case we may or may not have an override of page's #performHelp(). // 1) Try to get default help opened for the dialog; openDialogHelp(); // 2) Next call currentPage's #performHelp(). If it was overridden, it might switch help // to something else. currentPage.performHelp(); }
public void helpRequested(HelpEvent event) { if (currentPage == null) { // no current page? open dialog's help openDialogHelp(); return; } // A) A typical path: the current page has registered its own help link // via WorkbenchHelpSystem#setHelp(). When just call it and let // it handle the help request. Control pageControl = currentPage.getControl(); if (pageControl != null && pageControl.isListening(SWT.Help)) { currentPage.performHelp(); return; } // B) Less typical path: no standard listener has been created for the page. // In this case we may or may not have an override of page's #performHelp(). // 1) Try to get default help opened for the dialog; openDialogHelp(); // 2) Next call currentPage's #performHelp(). If it was overridden, it might switch help // to something else. currentPage.performHelp(); }
@Override public void helpRequested(HelpEvent event) { if (currentPage == null) { // no current page? open dialog's help openDialogHelp(); return; } // A) A typical path: the current page has registered its own help link // via WorkbenchHelpSystem#setHelp(). When just call it and let // it handle the help request. Control pageControl = currentPage.getControl(); if (pageControl != null && pageControl.isListening(SWT.Help)) { currentPage.performHelp(); return; } // B) Less typical path: no standard listener has been created for the page. // In this case we may or may not have an override of page's #performHelp(). // 1) Try to get default help opened for the dialog; openDialogHelp(); // 2) Next call currentPage's #performHelp(). If it was overridden, it might switch help // to something else. currentPage.performHelp(); }
if (currentPage.getControl() == null) { final boolean[] failed = { false }; SafeRunnable.run(new ISafeRunnable() { Assert.isNotNull(currentPage.getControl()); setShellSize(shellSize.x + hdiff, shellSize.y + vdiff); lastShellSize = shell.getSize(); if (currentPage.getControl().getSize().x == 0) { currentPage.getControl().setSize(containerSize); currentPage.getControl().setSize(containerSize); Control currentControl = currentPage.getControl(); for (int i = 0; i < children.length; i++) { if (children[i] != currentControl) {
if (currentPage.getControl() == null) { final boolean[] failed = { false }; SafeRunnable.run(new ISafeRunnable() { Assert.isNotNull(currentPage.getControl()); setShellSize(shellSize.x + hdiff, shellSize.y + vdiff); lastShellSize = shell.getSize(); if (currentPage.getControl().getSize().x == 0) { currentPage.getControl().setSize(containerSize); currentPage.getControl().setSize(containerSize); Control currentControl = currentPage.getControl(); for (Control element : children) { if (element != currentControl) {
if (currentPage.getControl() == null) { final boolean[] failed = { false }; SafeRunnable.run(new ISafeRunnable() { Assert.isNotNull(currentPage.getControl()); setShellSize(shellSize.x + hdiff, shellSize.y + vdiff); lastShellSize = shell.getSize(); if (currentPage.getControl().getSize().x == 0) { currentPage.getControl().setSize(containerSize); Control currentControl = currentPage.getControl(); for (int i = 0; i < children.length; i++) { if (children[i] != currentControl) {