public void showURL(final String url) { BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { public void run() { showURL(url, getShowDocumentsInPlace()); } }); }
public void init(ReusableHelpPart parent, String id, IMemento memento) { this.helpPart = parent; this.id = id; addLinks(linkContainer, helpPart.getForm().getToolkit()); }
public void init(ReusableHelpPart parent, String id, IMemento memento) { this.parent = parent; this.id = id; loadEngines(filteringGroup, parent.getForm().getToolkit()); createAdvancedLink(filteringGroup, parent.getForm().getToolkit()); parent.hookFormText(searchWordText); if (memento != null) restorePart(memento); }
public void run() { final IHelpResource res = getHelpResource(); final ReusableHelpPart helpPart = ReusableHelpPart.getLastActiveInstance(); if (helpPart != null) { helpPart.getControl().getDisplay().syncExec(new Runnable() { 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); } } }); } }
IHelpPartPage page = helpPart.createPage(CheatSheetHelpPart.ID, null, null); page.setVerticalSpacing(0); page.setHorizontalMargin(0); stateManager = trayManager; helpPart.addPart(CheatSheetHelpPart.ID, new CheatSheetHelpPart(helpPart.getForm().getForm().getBody(), helpPart.getForm().getToolkit(), page.getToolBarManager(), contentElement, trayManager)); page.addPart(CheatSheetHelpPart.ID, true); helpPart.addPage(page); helpPart.showPage(CheatSheetHelpPart.ID); Display.getCurrent().removeFilter(SWT.Show, listener); helpPart.getControl().addListener(SWT.Dispose, event -> { control.setVisible(true); Display.getCurrent().addFilter(SWT.Show, listener);
gd.heightHint = 1; separator.setLayoutData(gd); helpPart = new ReusableHelpPart(PlatformUI.getWorkbench().getProgressService()); helpPart.init(null, tbm, null, null); helpPart.setDefaultContextHelpText(Messages.HelpView_defaultText); helpPart.createControl(container, toolkit); gd = new GridData(GridData.FILL_BOTH); gd.widthHint = DEFAULT_WIDTH; helpPart.getControl().setLayoutData(gd); helpPart.getControl().addListener(SWT.Dispose, new Listener() { public void handleEvent(Event event) { unhookPageChangeListener(shell);
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()); } } }
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); }
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 HelpPartPage showPage(String id, boolean setFocus) { HelpPartPage page = this.showPage(id); if (page != null && setFocus) page.setFocus(); return page; }
public void init(IViewSite site, IMemento memento) throws PartInitException { if (memento!=null) this.firstPageId = memento.getString("pageId"); //$NON-NLS-1$ init(site); reusableHelpPart = new ReusableHelpPart(site.getWorkbenchWindow(), getHelpPartStyle()); IActionBars actionBars = site.getActionBars(); reusableHelpPart.init(actionBars, actionBars.getToolBarManager(), actionBars.getStatusLineManager(), memento); IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); IPartService service = window.getPartService(); service.addPartListener(this); }
private void contributeToDropDownMenu(IMenuManager manager) { addPageAction(manager, IHelpUIConstants.HV_CONTEXT_HELP_PAGE); addPageAction(manager, IHelpUIConstants.HV_ALL_TOPICS_PAGE); addPageAction(manager, IHelpUIConstants.HV_INDEX_PAGE); addPageAction(manager, IHelpUIConstants.HV_FSEARCH_PAGE); addPageAction(manager, IHelpUIConstants.HV_BOOKMARKS_PAGE); }
public void changed(LocationEvent event) { String url = event.location; boolean isResult = url.indexOf("resultof")!=-1; //$NON-NLS-1$ BrowserPart.this.parent.browserChanged(url); BrowserPart.this.url = url; updateSyncTocAction(); BrowserPart.this.highlightAction.setEnabled(isResult); } });
.getImageDescriptor(IHelpUIConstants.IMAGE_ADD_BOOKMARK)); if (actionBars != null && actionBars.getMenuManager() != null) contributeToDropDownMenu(actionBars.getMenuManager());
IHelpPartPage page = helpPart.createPage(CheatSheetHelpPart.ID, null, null); page.setVerticalSpacing(0); page.setHorizontalMargin(0); CheatSheetElement contentElement = CheatSheetRegistryReader.getInstance().findCheatSheet(id); helpPart.addPart(CheatSheetHelpPart.ID, new CheatSheetHelpPart(helpPart.getForm().getForm().getBody(), helpPart.getForm().getToolkit(), page.getToolBarManager(), contentElement, new DefaultStateManager())); page.addPart(CheatSheetHelpPart.ID, true); helpPart.addPage(page); helpPart.showPage(CheatSheetHelpPart.ID);
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 } }
public void run() { searchWordCombo.getControl().setEnabled(!searchInProgress); if (!searchInProgress) goButton.setEnabled(true); if (searchInProgress) goButton.setText(Messages.SearchPart_stop); else goButton.setText(Messages.SearchPart_go); parent.getForm().getForm().setBusy(searchInProgress); goButton.getParent().layout(); } }
public void run() { BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() { public void run() { busyRun(); } }); }