use of org.eclipse.help.IHelpResource in project statecharts by Yakindu.
the class AbstractUserHelpDocumentationProvider method parseHelp.
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());
}
use of org.eclipse.help.IHelpResource in project tdq-studio-se by Talend.
the class ImportPatternsAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
ImportPatternsWizard wizard = new ImportPatternsWizard(folder, type);
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = relatedTopics[2].getHref();
WizardDialog dialog = new OpeningHelpWizardDialog(null, wizard, href);
wizard.setWindowTitle(getText());
if (WizardDialog.OK == dialog.open()) {
if (this.node != null) {
CorePlugin.getDefault().refreshDQView(this.node);
}
}
}
use of org.eclipse.help.IHelpResource in project tdq-studio-se by Talend.
the class CreateUDIAction method run.
@Override
public void run() {
if (this.folder == null) {
this.folder = ResourceManager.getUDIFolder();
}
UDIndicatorParameter parameter = new UDIndicatorParameter();
FolderProvider folderProvider = new FolderProvider();
folderProvider.setFolderResource(folder);
parameter.setFolderProvider(folderProvider);
NewUDIndicatorWizard fileWizard = WizardFactory.createNewUDIWizard(parameter);
fileWizard.setWindowTitle(getText());
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getUDIndicatorHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = relatedTopics[0].getHref();
WizardDialog dialog = new OpeningHelpWizardDialog(null, fileWizard, href);
if (WizardDialog.OK == dialog.open()) {
ProxyRepositoryManager.getInstance().save();
}
}
use of org.eclipse.help.IHelpResource in project dbeaver by dbeaver.
the class BaseObjectEditPage method performHelp.
@Override
public void performHelp() {
if (this instanceof IHelpContextIdProvider) {
IWorkbenchHelpSystem helpSystem = UIUtils.getActiveWorkbenchWindow().getWorkbench().getHelpSystem();
if (helpSystem != null) {
String helpContextId = ((IHelpContextIdProvider) this).getHelpContextId();
IContext helpContext = new IContext() {
@Override
public IHelpResource[] getRelatedTopics() {
return new IHelpResource[] { new IHelpResource() {
@Override
public String getHref() {
return helpContextId;
}
@Override
public String getLabel() {
return helpContextId;
}
} };
}
@Override
public String getText() {
return helpContextId;
}
};
helpSystem.displayHelp(helpContext);
}
}
}
use of org.eclipse.help.IHelpResource in project dbeaver by dbeaver.
the class GitHubWikiHelpUI method displayContext.
@Override
public void displayContext(IContext context, int x, int y) {
try {
IHelpResource[] relatedTopics = context.getRelatedTopics();
if (relatedTopics == null || relatedTopics.length == 0) {
return;
}
IHelpResource relatedTopic = relatedTopics[0];
String topicRef = relatedTopic.getHref();
// Cut plugin ID from href
while (topicRef.startsWith("/")) {
topicRef = topicRef.substring(1);
}
int divPos = topicRef.indexOf('/');
if (divPos != -1) {
topicRef = topicRef.substring(divPos + 1);
}
showHelpPage(GITHUB_HELP_ROOT + topicRef);
} catch (Exception e) {
log.error(e);
}
}
Aggregations