Search in sources :

Example 11 with IContext

use of org.eclipse.help.IContext 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);
        }
    }
}
Also used : ExportPatternsWizard(org.talend.dataprofiler.core.pattern.ExportPatternsWizard) IContext(org.eclipse.help.IContext) CoreException(org.eclipse.core.runtime.CoreException) ExportForExchangeWizard(org.talend.dataprofiler.core.ui.imex.ExportForExchangeWizard) IHelpResource(org.eclipse.help.IHelpResource) OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) Wizard(org.eclipse.jface.wizard.Wizard) ExportPatternsWizard(org.talend.dataprofiler.core.pattern.ExportPatternsWizard) ExportForExchangeWizard(org.talend.dataprofiler.core.ui.imex.ExportForExchangeWizard) OpeningHelpWizardDialog(org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 12 with IContext

use of org.eclipse.help.IContext in project dbeaver by serge-rider.

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);
        }
    }
}
Also used : IHelpContextIdProvider(org.jkiss.dbeaver.ui.IHelpContextIdProvider) IWorkbenchHelpSystem(org.eclipse.ui.help.IWorkbenchHelpSystem) IContext(org.eclipse.help.IContext) IHelpResource(org.eclipse.help.IHelpResource)

Aggregations

IContext (org.eclipse.help.IContext)12 IHelpResource (org.eclipse.help.IHelpResource)8 OpeningHelpWizardDialog (org.talend.dataprofiler.core.ui.utils.OpeningHelpWizardDialog)5 WizardDialog (org.eclipse.jface.wizard.WizardDialog)4 FolderProvider (org.talend.cwm.management.api.FolderProvider)3 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)2 IWorkbenchHelpSystem (org.eclipse.ui.help.IWorkbenchHelpSystem)2 IHelpContextIdProvider (org.jkiss.dbeaver.ui.IHelpContextIdProvider)2 HALEContextProvider (eu.esdihumboldt.hale.ui.HALEContextProvider)1 ContextImpl (eu.esdihumboldt.hale.ui.common.help.internal.ContextImpl)1 ContextWrapper (eu.esdihumboldt.hale.ui.common.help.internal.ContextWrapper)1 ProjectService (eu.esdihumboldt.hale.ui.service.project.ProjectService)1 HaleWizardDialog (eu.esdihumboldt.hale.ui.util.wizard.HaleWizardDialog)1 Pair (eu.esdihumboldt.util.Pair)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1