public void createPage() { page = (IPreferencePage) createObject(classname); if (getLabelImage() != null) { page.setImageDescriptor(imageDescriptor); } page.setTitle(label); }
/** * (non-Javadoc) Method declared on IPreferenceNode. */ public void disposeResources() { if (image != null) { // RAP [bm]: Image#dispose // image.dispose(); image = null; } if (page != null) { page.dispose(); page = null; } }
@Override public void run() { size[0] = currentPage.computeSize(); } });
if (!currentPage.okToLeave()) { return false; currentPage = newPage; currentPage.setContainer(this); 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.setSize(containerSize); Control currentControl = currentPage.getControl(); for (int i = 0; i < children.length; i++) { if (children[i] != currentControl) { currentPage.setVisible(true); if (oldPage != null) { oldPage.setVisible(false);
public void createPage() { IPreferencePage page = desc.createRootPage(set.getName()); setPage(page); page.setTitle(desc.getLabel()); page.setImageDescriptor(desc.getImageDescriptor()); page.setDescription(desc.getDescription()); } }
@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 createPage() { try { Object obj = config.createExecutableExtension(IHelpUIConstants.ATT_CLASS); IPreferencePage page = (IPreferencePage)obj; setPage(page); page.setTitle(getLabelText()); } catch (CoreException e) { HelpUIPlugin.logError("Unable to create executable extension", e); //$NON-NLS-1$ } } }
@Override public void updateMessage() { String message = null; String errorMessage = null; if(currentPage != null){ message = currentPage.getMessage(); errorMessage = currentPage.getErrorMessage(); } int messageType = IMessageProvider.NONE; if (message != null && currentPage instanceof IMessageProvider) { messageType = ((IMessageProvider) currentPage).getMessageType(); } if (errorMessage == null){ if (showingError) { // we were previously showing an error showingError = false; } } else { message = errorMessage; messageType = IMessageProvider.ERROR; if (!showingError) { // we were not previously showing an error showingError = true; } } messageArea.updateText(message,messageType); }
public String getLabelText() { if (page != null) { return page.getTitle(); } return label; }
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;
/** * Create the page control for the supplied page. * * @param page - the preference page to be shown * @param parent - the composite to parent the page * * @since 3.1 */ protected void createPageControl(IPreferencePage page, Composite parent) { page.createControl(parent); }
if (!currentPage.okToLeave()) { return false; currentPage = newPage; currentPage.setContainer(this); 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) { currentPage.setVisible(true); if (oldPage != null) { oldPage.setVisible(false);
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(); }
/** * Creates a new preferences page and opens it */ public void configureWorkspaceSettings() { // create a new instance of the current class IPreferencePage page = new CppStylePerfPage(); page.setTitle(getTitle()); // and show it showPreferencePage(CppStyleConstants.PerfPageId, page); }
public void updateMessage() { String message = null; String errorMessage = null; if(currentPage != null){ message = currentPage.getMessage(); errorMessage = currentPage.getErrorMessage(); } int messageType = IMessageProvider.NONE; if (message != null && currentPage instanceof IMessageProvider) { messageType = ((IMessageProvider) currentPage).getMessageType(); } if (errorMessage == null){ if (showingError) { // we were previously showing an error showingError = false; } } else { message = errorMessage; messageType = IMessageProvider.ERROR; if (!showingError) { // we were not previously showing an error showingError = true; } } messageArea.updateText(message,messageType); }
@Override public String getLabelText() { if (page != null) { return page.getTitle(); } return label; }
/** * * 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(); }
/** * Create the page control for the supplied page. * * @param page - the preference page to be shown * @param parent - the composite to parent the page * * @since 1.0 */ protected void createPageControl(IPreferencePage page, Composite parent) { page.createControl(parent); }