Search in sources :

Example 1 with IHelpContextIdProvider

use of org.jkiss.dbeaver.ui.IHelpContextIdProvider in project dbeaver by serge-rider.

the class EditObjectDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    getShell().setText(dialogPage.getTitle());
    Composite group = (Composite) super.createDialogArea(parent);
    GridData gd = new GridData(GridData.FILL_BOTH);
    group.setLayoutData(gd);
    dialogPage.createControl(group);
    if (dialogPage instanceof IHelpContextIdProvider) {
        UIUtils.setHelp(dialogPage.getControl(), ((IHelpContextIdProvider) dialogPage).getHelpContextId());
    }
    return group;
}
Also used : IHelpContextIdProvider(org.jkiss.dbeaver.ui.IHelpContextIdProvider) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData)

Example 2 with IHelpContextIdProvider

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

Example 3 with IHelpContextIdProvider

use of org.jkiss.dbeaver.ui.IHelpContextIdProvider 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)

Example 4 with IHelpContextIdProvider

use of org.jkiss.dbeaver.ui.IHelpContextIdProvider in project dbeaver by dbeaver.

the class EditObjectDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    getShell().setText(dialogPage.getTitle());
    Composite group = (Composite) super.createDialogArea(parent);
    GridData gd = new GridData(GridData.FILL_BOTH);
    group.setLayoutData(gd);
    dialogPage.createControl(group);
    if (dialogPage instanceof IHelpContextIdProvider) {
        UIUtils.setHelp(dialogPage.getControl(), ((IHelpContextIdProvider) dialogPage).getHelpContextId());
    }
    return group;
}
Also used : IHelpContextIdProvider(org.jkiss.dbeaver.ui.IHelpContextIdProvider) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData)

Aggregations

IHelpContextIdProvider (org.jkiss.dbeaver.ui.IHelpContextIdProvider)4 IContext (org.eclipse.help.IContext)2 IHelpResource (org.eclipse.help.IHelpResource)2 GridData (org.eclipse.swt.layout.GridData)2 Composite (org.eclipse.swt.widgets.Composite)2 IWorkbenchHelpSystem (org.eclipse.ui.help.IWorkbenchHelpSystem)2