• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IHelpResource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.help.IHelpResource的典型用法代码示例。如果您正苦于以下问题:Java IHelpResource类的具体用法?Java IHelpResource怎么用?Java IHelpResource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IHelpResource类属于org.eclipse.help包,在下文中一共展示了IHelpResource类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getHelpUrl

import org.eclipse.help.IHelpResource; //导入依赖的package包/类
public static String getHelpUrl(String contextId) {
    if (contextId != null) {
        if (contextId.lastIndexOf(Constants.DOT) == -1) {
            contextId = Constants.DOCUMENTATION_PLUGIN_PREFIX + Constants.DOT + contextId;
        }

        IContext c = HelpSystem.getContext(contextId);
        if (c != null) {
            IHelpResource[] topics = c.getRelatedTopics();

            if (!Utils.isEmpty(topics)) {
                return topics[0].getHref();
            }
        }
    }

    return null;
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:19,代码来源:UIUtils.java


示例2: parseHelp

import org.eclipse.help.IHelpResource; //导入依赖的package包/类
private String parseHelp(String contextId) throws Exception {
	ContextFileProvider provider = new ContextFileProvider();
	IContext context = provider.getContext(contextId, Locale.getDefault()
			.toString());
	IHelpResource[] relatedTopics = context.getRelatedTopics();
	Assert.isTrue(relatedTopics != null);
	// We assume that there is only one topic registered
	IHelpResource helpResource = relatedTopics[0];
	String href = helpResource.getHref().substring(1);
	URL url = new URL("platform:/plugin/" + href);
	return convertStreamToString(url.openConnection().getInputStream());
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:13,代码来源:AbstractUserHelpDocumentationProvider.java


示例3: getRelatedTopics

import org.eclipse.help.IHelpResource; //导入依赖的package包/类
public IHelpResource[] getRelatedTopics()
{
	Collection<PropertyElement> properties = getActiveProperty();
	if (!CollectionsUtil.isEmpty(properties))
	{
		Set<IHelpResource> refs = new HashSet<IHelpResource>();
		for (PropertyElement pe : properties)
		{
			for (SinceElement se : pe.getSinceList())
			{
				String version = se.getVersion();
				if ("DOM 0".equals(version))
				{
					refs.add(new JSDOMHelpResource(0));
				}
				else if ("HTML DOM Level 2".equals(version))
				{
					refs.add(new JSDOMHelpResource(2));
				}
				else if ("HTML DOM Level 3".equals(version))
				{
					refs.add(new JSDOMHelpResource(3));
				}
				else if ("DOM5 HTML".equals(version))
				{
					refs.add(new JSDOMHelpResource(5));
				}
			}
			return refs.toArray(new IHelpResource[refs.size()]);
		}
	}
	return null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:34,代码来源:JSSourceEditor.java


示例4: displayHelp

import org.eclipse.help.IHelpResource; //导入依赖的package包/类
/**
 * Display help for the a given topic and related topics.
 * 
 * @param context
 *            context for which related topics will be displayed
 * @param topic
 *            related topic to be selected
 */
public void displayHelp(IContext context, IHelpResource topic,
		boolean forceExternal) {
	if (context == null || topic == null || topic.getHref() == null)
		return;
	String topicURL = getTopicURL(topic.getHref());
	displayHelpResource(topicURL, false);
	/*
	 * links tab removed 11/2007, Bug 120947
	if (getNoframesURL(topicURL) == null) {
		try {
			String url = "tab=links" //$NON-NLS-1$
					+ "&contextId=" //$NON-NLS-1$
					+ URLEncoder.encode(getContextID(context), "UTF-8") //$NON-NLS-1$
					+ "&topic=" //$NON-NLS-1$
					+ URLEncoder.encode(topicURL, "UTF-8"); //$NON-NLS-1$
			displayHelpURL(url, forceExternal);
		} catch (UnsupportedEncodingException uee) {
		}

	} else if (topicURL.startsWith("jar:file:")) { //$NON-NLS-1$
		// topic from a jar to display without frames
		displayHelpURL(
				getBaseURL() + "nftopic/" + getNoframesURL(topicURL), true); //$NON-NLS-1$
	} else {
		displayHelpURL(getNoframesURL(topicURL), true);
	}
	*/
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:37,代码来源:SelfHelpDisplay.java


示例5: getCategory

import org.eclipse.help.IHelpResource; //导入依赖的package包/类
public String getCategory(IHelpResource topic)
{
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:6,代码来源:JSSourceEditor.java


示例6: JavadocHelpContext

import org.eclipse.help.IHelpResource; //导入依赖的package包/类
public JavadocHelpContext(IContext context, Object[] elements) throws JavaModelException {
	Assert.isNotNull(elements);
	if (context instanceof IContext2)
		fTitle= ((IContext2)context).getTitle();

	List<IHelpResource> helpResources= new ArrayList<IHelpResource>();

	String javadocSummary= null;
	for (int i= 0; i < elements.length; i++) {
		if (elements[i] instanceof IJavaElement) {
			IJavaElement element= (IJavaElement) elements[i];
			// if element isn't on the build path skip it
			if (!ActionUtil.isOnBuildPath(element))
				continue;

			// Create Javadoc summary
			if (BUG_85721_FIXED) {
				if (javadocSummary == null) {
					javadocSummary= retrieveText(element);
					if (javadocSummary != null) {
						String elementLabel= JavaElementLabels.getTextLabel(element, JavaElementLabels.ALL_DEFAULT);

						// FIXME: needs to be NLSed once the code becomes active
						javadocSummary= "<b>Javadoc for " + elementLabel + ":</b><br>" + javadocSummary;   //$NON-NLS-1$//$NON-NLS-2$
					}
				} else {
					javadocSummary= ""; // no Javadoc summary for multiple selection //$NON-NLS-1$
				}
			}

			URL url= JavaUI.getJavadocLocation(element, true);
			if (url == null || doesNotExist(url)) {
				IPackageFragmentRoot root= JavaModelUtil.getPackageFragmentRoot(element);
				if (root != null) {
					url= JavaUI.getJavadocBaseLocation(element);
					if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
						element= element.getJavaProject();
					} else {
						element= root;
					}
					url= JavaUI.getJavadocLocation(element, false);
				}
			}
			if (url != null) {
				IHelpResource javaResource= new JavaUIHelpResource(element, getURLString(url));
				helpResources.add(javaResource);
			}
		}
	}

	// Add static help topics
	if (context != null) {
		IHelpResource[] resources= context.getRelatedTopics();
		if (resources != null) {
			for (int j= 0; j < resources.length; j++) {
				helpResources.add(resources[j]);
			}
		}
	}

	fHelpResources= helpResources.toArray(new IHelpResource[helpResources.size()]);

	if (context != null)
		fText= context.getText();

	if (BUG_85721_FIXED) {
		if (javadocSummary != null && javadocSummary.length() > 0) {
			if (fText != null)
				fText= context.getText() + "<br><br>" + javadocSummary; //$NON-NLS-1$
			else
				fText= javadocSummary;
		}
	}

	if (fText == null)
		fText= "";  //$NON-NLS-1$

}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:79,代码来源:JavadocHelpContext.java


示例7: getRelatedTopics

import org.eclipse.help.IHelpResource; //导入依赖的package包/类
public IHelpResource[] getRelatedTopics() {
	return fHelpResources;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:JavadocHelpContext.java


示例8: getCategory

import org.eclipse.help.IHelpResource; //导入依赖的package包/类
public String getCategory(IHelpResource topic) {
	if (topic instanceof JavaUIHelpResource)
		return JavaUIMessages.JavaUIHelpContext_javaHelpCategory_label;

	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:JavadocHelpContext.java



注:本文中的org.eclipse.help.IHelpResource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WindowedSerializer类代码示例发布时间:2022-05-23
下一篇:
Java StAXInputSource类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap