use of org.eclipse.help.IHelpResource in project dbeaver by serge-rider.
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);
}
}
use of org.eclipse.help.IHelpResource in project tdq-studio-se by Talend.
the class CreatePatternAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
if (folder.exists()) {
PatternParameter parameter = new PatternParameter();
FolderProvider folderProvider = new FolderProvider();
folderProvider.setFolderResource(folder);
parameter.setFolderProvider(folderProvider);
CreatePatternWizard fileWizard;
if (this.expression != null && this.lanuage != null) {
fileWizard = (CreatePatternWizard) WizardFactory.createPatternWizard(type, parameter, expression, lanuage);
} else {
fileWizard = (CreatePatternWizard) WizardFactory.createPatternWizard(type, parameter);
}
fileWizard.setPurpose(purpose);
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = relatedTopics[0].getHref();
switch(type) {
case SQL_LIKE:
href = relatedTopics[1].getHref();
break;
default:
break;
}
WizardDialog dialog = new OpeningHelpWizardDialog(Display.getDefault().getActiveShell(), fileWizard, href);
fileWizard.setWindowTitle(getText());
if (WizardDialog.OK == dialog.open())
ProxyRepositoryManager.getInstance().save();
}
}
use of org.eclipse.help.IHelpResource in project tdq-studio-se by Talend.
the class ExportPatternsAction method run.
@Override
public void run() {
Wizard wizard = isForExchange ? new ExportForExchangeWizard(folder.getFullPath().toString()) : new ExportPatternsWizard(node, isForExchange);
WizardDialog dialog = null;
// MOD hcheng 2009-07-07,for 8122.Add an help file in the "Export patterns for Talend exchange wizard".
if (isForExchange) {
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = relatedTopics[3].getHref();
dialog = new OpeningHelpWizardDialog(null, wizard, href);
} else {
// MOD yyi 2009-08-20,for 8689.Add help in "export pattern" wizard.
IContext context = HelpSystem.getContext(HelpPlugin.getDefault().getPatternHelpContextID());
IHelpResource[] relatedTopics = context.getRelatedTopics();
String href = relatedTopics[4].getHref();
dialog = new OpeningHelpWizardDialog(null, wizard, href);
}
wizard.setWindowTitle(getText());
if (WizardDialog.OK == dialog.open()) {
try {
folder.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
log.error(e, e);
}
}
}
Aggregations