Example usage for org.eclipse.jface.dialogs TrayDialog isHelpAvailable

List of usage examples for org.eclipse.jface.dialogs TrayDialog isHelpAvailable

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs TrayDialog isHelpAvailable.

Prototype

public boolean isHelpAvailable() 

Source Link

Document

Returns whether or not context help is available for this dialog.

Usage

From source file:org.eclipse.oomph.ui.OomphDialog.java

License:Open Source License

public static boolean showFirstTimeHelp(final TrayDialog dialog) {
    try {/*from   ww  w .  j  a  va2s  .  co  m*/
        if (dialog.isHelpAvailable()) {
            String key = dialog.getClass().getName();
            String value = new Date().toString();

            if (HISTORY.compareAndSetProperty(key, value)) {
                UIUtil.asyncExec(dialog.getShell(), new Runnable() {
                    public void run() {
                        try {
                            Method method = ReflectUtil.getMethod(TrayDialog.class, "helpPressed");
                            ReflectUtil.invokeMethod(method, dialog);
                        } catch (Throwable ex) {
                            UIPlugin.INSTANCE.log(ex);
                        }
                    }
                });

                return true;
            }
        }
    } catch (Throwable ex) {
        UIPlugin.INSTANCE.log(ex);
    }

    return false;
}