/** @deprecated */ @Deprecated @Override public IContext getContext(String contextId) { // non-UI method - forward to HelpSystem return HelpSystem.getContext(contextId); }
/** @deprecated */ @Deprecated @Override public IToc[] getTocs() { // non-UI method - forward to HelpSystem return HelpSystem.getTocs(); }
/** * Returns an open input stream on the contents of the specified help * resource in the platform's current locale. The client is responsible for * closing the stream when finished. * * @param href * the URL (as a string) of the help resource * <p> * Valid href are as described in * {@link org.eclipse.help.IHelpResource#getHref IHelpResource.getHref} * </p> * @return an input stream containing the contents of the help resource, or * <code>null</code> if the help resource could not be found and * opened */ public static InputStream getHelpContent(String href) { return getHelpContent(href, Platform.getNL()); }
public Object[] getChildren(Object parentElement) { if (parentElement == IndexPart.this) { return HelpSystem.getIndex().getEntries(); } if (parentElement instanceof IIndexEntry) { return IndexPart.this.getChildren((IIndexEntry) parentElement); } return new Object[0]; }
@Override public IContext getContext(Object target) { String id = fTree.computeContextId(); if (id!=null) { return HelpSystem.getContext(id); } return null; }
private IHelpResource getHelpResource() { StringTokenizer tok = new StringTokenizer(path, "_"); //$NON-NLS-1$ int index = Integer.parseInt(tok.nextToken()); IToc[] tocs = HelpSystem.getTocs(); IToc toc = tocs[index]; if (tok.hasMoreTokens()) { ITopic topic = toc.getTopic(null); while (tok.hasMoreTokens()) { index = Integer.parseInt(tok.nextToken()); topic = topic.getSubtopics()[index]; } return topic; } return toc; } }
public UAElement resolve(String bundleId, String relativePath, String elementId) throws IOException, SAXException, ParserConfigurationException { String href = '/' + bundleId + '/' + relativePath; try (InputStream in = HelpSystem.getHelpContent(href, locale)) { UAElement element = findElement(in, elementId); processor.process(element, href); return element; } }
/** @deprecated */ @Deprecated @Override public void displayContext(String contextId, int x, int y) { // convenience method - funnel through the real method IContext context = HelpSystem.getContext(contextId); if (context != null) { displayContext(context, x, y); } }
public Object[] getChildren(Object parentElement) { if (parentElement == AllTopicsPart.this) return HelpSystem.getTocs(); if (parentElement instanceof IToc) return ((IToc) parentElement).getTopics(); if (parentElement instanceof ITopic) return ((ITopic) parentElement).getSubtopics(); return new Object[0]; }
private Node[] getContent(String bundleId, String relativePath, String nodeId) throws IOException, SAXException, ParserConfigurationException { String href = '/' + bundleId + '/' + relativePath; try (InputStream in = HelpSystem.getHelpContent(href, locale)) { if (nodeId != null) { Element element = findElement(in, nodeId); processor.process(new UAElement(element), href); return new Node[] { element }; } Element body = findBody(in); List<Node> children = new ArrayList<>(); Node node = body.getFirstChild(); while (node != null) { if (node.getNodeType() == Node.ELEMENT_NODE) { processor.process(new UAElement((Element)node), href); } children.add(node); node = node.getNextSibling(); } return children.toArray(new Node[children.size()]); } }
public IContext getContext(Object target) { IContext context= HelpSystem.getContext(fId); if (fSelected != null && fSelected.length > 0) { try { context= new JavadocHelpContext(context, fSelected); } catch (JavaModelException e) { } } return context; } public String getSearchExpression(Object target) {
public void selectReveal(String href) { IToc[] tocs = HelpSystem.getTocs(); for (int i = 0; i < tocs.length; i++) { IToc toc = tocs[i]; ITopic topic = toc.getTopic(href); if (topic != null) { selectReveal(topic); return; } } }
public static IContext findHelpContext(Control c) { String contextId = null; Control node = c; do { contextId = (String) node.getData(HELP_KEY); if (contextId != null) break; node = node.getParent(); } while (node != null); if (contextId != null) { return HelpSystem.getContext(contextId); } return null; }
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); } } }
public IContext getContext(Object target) { String contextId = HelpUtil.getContextId(HelpUtil.getHelpKey(target), _contextHelpPluginID); if (contextId == null) { return null; } return HelpSystem.getContext(contextId); }
@Override public void displayHelp(String contextId) { IContext context = HelpSystem.getContext(contextId); if (context != null) { Point point = computePopUpLocation(Display.getCurrent()); displayContext(context, point.x, point.y); } }
@Override public IContext getContext(Object target) { String contextId = null; // See if there is a context registered for the current selection IMarker[] markers = view.getSelectedMarkers(); if(markers.length > 0) { contextId = IDE.getMarkerHelpRegistry().getHelp(markers[0]); } //TODO this needs to be migrated to the ide plug-in if (contextId == null) { contextId = PlatformUI.PLUGIN_ID + ".problem_view_context";//$NON-NLS-1$ } return HelpSystem.getContext(contextId); }
if (object instanceof String) { context = HelpSystem.getContext((String) object); } else if (object instanceof IContext) { Object primaryEntry = helpContexts[0]; if (primaryEntry instanceof String) { context = HelpSystem.getContext((String) primaryEntry); } else if (primaryEntry instanceof IContext) { context = (IContext) primaryEntry; context = HelpSystem.getContext(IWorkbenchHelpContextIds.MISSING);
public static void displayHelp(String contextId, Object[] selected) throws CoreException { IContext context= HelpSystem.getContext(contextId); if (context != null) { if (selected != null && selected.length > 0) { context= new JavadocHelpContext(context, selected); } PlatformUI.getWorkbench().getHelpSystem().displayHelp(context); } }
public static void displayHelp(String contextId, Object[] selected) throws CoreException { IContext context= HelpSystem.getContext(contextId); if (context != null) { if (selected != null && selected.length > 0) { context= new JavadocHelpContext(context, selected); } PlatformUI.getWorkbench().getHelpSystem().displayHelp(context); } }