@Override public IHelpResource[] getRelatedTopics() { return context.getRelatedTopics(); }
@Override public String getText() { return context.getText(); } }
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()); } } }
IHelpResource[] resources= context.getRelatedTopics(); if (resources != null) { for (int j= 0; j < resources.length; j++) { fText= context.getText(); fText= context.getText() + "<br><br>" + javadocSummary; //$NON-NLS-1$ else fText= javadocSummary;
IHelpResource[] resources= context.getRelatedTopics(); if (resources != null) { for (int j= 0; j < resources.length; j++) { fText= context.getText(); fText= context.getText() + "<br><br>" + javadocSummary; //$NON-NLS-1$ else fText= javadocSummary;
/** * Measures the longest label of related links * * @param text * @return */ private int getLinksWidth(Description text) { int linkWidth = 0; IHelpResource relatedTopics[] = context.getRelatedTopics(); if (relatedTopics != null) { GC gc = new GC(text); for (int i = 0; i < relatedTopics.length; i++) { linkWidth = Math.max(linkWidth, gc.textExtent(relatedTopics[i] .getLabel()).x); } gc.dispose(); } return linkWidth; }
@Override public String getStyledText() { if (context instanceof IContext2) { return ((IContext2)context).getStyledText(); } return context.getText(); }
private void displayContextAsInfopop(IContext context, int x, int y) { if (f1Dialog != null) { f1Dialog.close(); } if (context != 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) { try { PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(topics[0].getHref()); } catch (Exception e) { // should never happen } } else { f1Dialog = new ContextHelpDialog(context, x, y); f1Dialog.open(); } } }
buff.append("</span></p>"); //$NON-NLS-1$ resultSorter.sort(null, hits); IHelpResource [] excludedTopics = excludeContext!=null?excludeContext.getRelatedTopics():null;
/** * Make sure to support the Help system bold tag. Help systen returns a * regular string for getText(). Use internal apis for now to get bold. * * @param context * @return */ private String decodeContextBoldTags(IContext context) { String styledText; if (context instanceof IContext2) { styledText = ((IContext2) context).getStyledText(); if (styledText == null) { styledText = context.getText(); } } else { styledText = context.getText(); } if (styledText == null) { return Messages.ContextHelpPart_noDescription; } String decodedString = styledText.replaceAll("<@#\\$b>", "<b>"); //$NON-NLS-1$ //$NON-NLS-2$ decodedString = decodedString.replaceAll("</@#\\$b>", "</b>"); //$NON-NLS-1$ //$NON-NLS-2$ decodedString = parent.escapeSpecialChars(decodedString, true); decodedString = decodedString.replaceAll("\r\n|\n|\r", "<br/>"); //$NON-NLS-1$ //$NON-NLS-2$ return decodedString; }
IHelpResource[] resources= context.getRelatedTopics(); if (resources != null) { for (int j= 0; j < resources.length; j++) { fText= context.getText(); fText= context.getText() + "<br><br>" + javadocSummary; //$NON-NLS-1$ else fText= javadocSummary;
IHelpResource[] links = context.getRelatedTopics(); if (links != null && context instanceof IContext2) { ContextHelpSorter sorter = new ContextHelpSorter((IContext2)context);
if (context != null) { if (HelpPlugin.DEBUG_CONTEXT) { System.out.println("ContextManager.getContext found context, description = \"" + context.getText() + '"'); //$NON-NLS-1$
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 Control createLinksArea(Composite parent) { IHelpResource[] relatedTopics = context.getRelatedTopics(); if (relatedTopics == null) return null;
public void mergeContext(IContext src) { String text = src.getText(); if (getText() == null || getText().length() == 0) { setText(text); } if (src instanceof IContext2 && getTitle() == null) { String title = ((IContext2)src).getTitle(); if (title != null) { setAttribute(ATTRIBUTE_TITLE, title); } } if (src instanceof IContext3) { ICommandLink[] commands = ((IContext3)src).getRelatedCommands(); for (int i=0;i<commands.length;++i) { appendChild(new CommandLink(commands[i])); } } IHelpResource[] topics = src.getRelatedTopics(); for (int i=0;i<topics.length;++i) { if (topics[i] instanceof ITopic) { appendChild(new Topic((ITopic)topics[i])); } else { Topic topic = new Topic(); topic.setHref(topics[i].getHref()); topic.setLabel(topics[i].getLabel()); appendChild(topic); } } }
IHelpResource[] topics = context.getRelatedTopics(); boolean openInEditor = pref.getBoolean(IHelpBaseConstants.P_KEY_OPEN_IN_EDITOR); if (context.getText() == null && topics.length == 1 && openInEditor) { showInWorkbenchBrowser(topics[0].getHref(), true);