Search in sources :

Example 1 with CtxHelpTopic

use of org.eclipse.pde.internal.ua.core.ctxhelp.text.CtxHelpTopic in project dsl-devkit by dsldevkit.

the class CheckContextsGenerator method createContextForCheck.

/**
 * Creates a context for every check.
 *
 * @param factory
 *          the model factory
 * @param check
 *          the check
 * @return the new help context
 */
private CtxHelpContext createContextForCheck(final CtxHelpDocumentFactory factory, final Check check) {
    CtxHelpContext context = factory.createContext();
    context.setID(generatorNaming.getContextId(check));
    CtxHelpTopic topic = factory.createTopic();
    topic.setLabel(check.getLabel());
    Path contextFilePath = new Path("docs/content/" + EcoreUtil2.getContainerOfType(check, CheckCatalog.class).getName() + ".html");
    topic.setXMLAttribute(ICtxHelpConstants.ATTRIBUTE_HREF, contextFilePath.toPortableString() + '#' + generatorNaming.getContextId(check));
    context.addChild(topic);
    return context;
}
Also used : Path(org.eclipse.core.runtime.Path) CtxHelpTopic(org.eclipse.pde.internal.ua.core.ctxhelp.text.CtxHelpTopic) CtxHelpContext(org.eclipse.pde.internal.ua.core.ctxhelp.text.CtxHelpContext)

Aggregations

Path (org.eclipse.core.runtime.Path)1 CtxHelpContext (org.eclipse.pde.internal.ua.core.ctxhelp.text.CtxHelpContext)1 CtxHelpTopic (org.eclipse.pde.internal.ua.core.ctxhelp.text.CtxHelpTopic)1