public HelpPartPage showPage(String id, boolean setFocus) { HelpPartPage page = this.showPage(id); if (page != null && setFocus) page.setFocus(); return page; }
public void showDynamicHelp(IWorkbenchPart wpart, Control c) { showPage(IHelpUIConstants.HV_CONTEXT_HELP_PAGE, true); RelatedTopicsPart part = (RelatedTopicsPart) findPart(IHelpUIConstants.HV_RELATED_TOPICS); if (part != null) { part.handleActivation(c, wpart); } }
public void startSearch(String phrase) { showPage(IHelpUIConstants.HV_FSEARCH_PAGE, true); SearchPart part = (SearchPart) findPart(IHelpUIConstants.HV_FSEARCH); if (part != null && phrase != null) part.startSearch(phrase); }
public void run() { helpPart.showPage(IHelpUIConstants.HV_ALL_TOPICS_PAGE); AllTopicsPart part = (AllTopicsPart)helpPart.findPart(IHelpUIConstants.HV_TOPIC_TREE); if (part != null) { part.selectReveal(res); } } });
private void doSyncToc() { String href = BaseHelpSystem.unresolve(this.url); int ix = href.indexOf("?resultof="); //$NON-NLS-1$ if (ix >= 0) { href = href.substring(0, ix); } parent.showPage(IHelpUIConstants.HV_ALL_TOPICS_PAGE); AllTopicsPart part = (AllTopicsPart) parent .findPart(IHelpUIConstants.HV_TOPIC_TREE); if (part != null) { part.selectReveal(href); } }
void doCategoryLink(String href) { parent.showPage(IHelpUIConstants.HV_ALL_TOPICS_PAGE); AllTopicsPart part = (AllTopicsPart) parent .findPart(IHelpUIConstants.HV_TOPIC_TREE); if (part != null) { IToc[] tocs = HelpSystem.getTocs(); IHelpResource target = null; for (int i = 0; i < tocs.length; i++) { if (tocs[i].getHref().equals(href)) target = tocs[i]; } if (target != null) { part.selectReveal(target); } } }
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 } }
private void executeHistoryEntry(HistoryEntry entry) { history.setBlocked(true); if (entry.getType() == HistoryEntry.PAGE) { showPage(entry.getTarget(), true); mform.setInput(entry.getData()); } else if (entry.getType() == HistoryEntry.URL) { String relativeUrl = (String) entry.getData(); showURL(relativeUrl != null ? relativeUrl : entry.getTarget(), true); } }
public void displayContext(IContext context, IWorkbenchPart part, Control control) { if (reusableHelpPart != null) { /* * If the context help has no description text and exactly one * topic, go straight to the topic and skip context help. */ IHelpResource[] topics = context.getRelatedTopics(); if (context.getText() != null || topics.length != 1) { // Ensure that context help is currently showing reusableHelpPart.showPage(IHelpUIConstants.HV_CONTEXT_HELP_PAGE); // check if there is a dynamic version IContextProvider provider = null; if (part!=null) provider = (IContextProvider) part .getAdapter(IContextProvider.class); if (provider != null) reusableHelpPart.update(provider, context, part, control); else reusableHelpPart.update(context, part, control); } else { reusableHelpPart.showURL(topics[0].getHref()); } } }
private boolean openInternalBrowser(String url) { Preferences pref = HelpBasePlugin.getDefault().getPluginPreferences(); boolean openInEditor = pref.getBoolean(IHelpBaseConstants.P_KEY_OPEN_IN_EDITOR); Shell windowShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); Shell helpShell = mform.getForm().getShell(); boolean isDialog = (helpShell != windowShell); if (!isDialog && openInEditor) { return DefaultHelpUI.showInWorkbenchBrowser(url, true); } showPage(IHelpUIConstants.HV_BROWSER_PAGE); BrowserPart bpart = (BrowserPart) findPart(IHelpUIConstants.HV_BROWSER); if (bpart != null) { bpart.showURL(BaseHelpSystem .resolve(url, "/help/ntopic").toString()); //$NON-NLS-1$ return true; } return false; }
public void createPartControl(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode( HyperlinkGroup.UNDERLINE_HOVER); // toolkit.setBackground(toolkit.getColors().createNoContentBackground()); toolkit.getColors().initializeSectionToolBarColors(); reusableHelpPart.createControl(parent, toolkit); reusableHelpPart.setDefaultContextHelpText(Messages.HelpView_defaultText); reusableHelpPart.showPage(getFirstPage()); IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); if (window == null) return; IWorkbenchPage page = window.getActivePage(); if (page == null) return; IWorkbenchPartReference aref = page.getActivePartReference(); if (aref != null) handlePartActivation(aref); }
page.addPart(CheatSheetHelpPart.ID, true); helpPart.addPage(page); helpPart.showPage(CheatSheetHelpPart.ID);
page.addPart(CheatSheetHelpPart.ID, true); helpPart.addPage(page); helpPart.showPage(CheatSheetHelpPart.ID);