Java 类org.eclipse.swt.events.HelpEvent 实例源码

项目:Eclipse-Postfix-Code-Completion    文件:JavaUIHelp.java   
public void helpRequested(HelpEvent e) {
    try {
        Object[] selected= null;
        if (fViewer != null) {
            ISelection selection= fViewer.getSelection();
            if (selection instanceof IStructuredSelection) {
                selected= ((IStructuredSelection)selection).toArray();
            }
        } else if (fEditor != null) {
            IJavaElement input= SelectionConverter.getInput(fEditor);
            if (input != null && ActionUtil.isOnBuildPath(input)) {
                selected= SelectionConverter.codeResolve(fEditor);
            }
        }
        JavadocHelpContext.displayHelp(fContextId, selected);
    } catch (CoreException x) {
        JavaPlugin.log(x);
    }
}
项目:gef-gwt    文件:Viewer.java   
/**
 * Adds a listener for help requests in this viewer.
 * Has no effect if an identical listener is already registered.
 *
 * @param listener a help listener
 */
public void addHelpListener(HelpListener listener) {
    helpListeners.add(listener);
    if (!helpHooked) {
        Control control = getControl();
        if (control != null && !control.isDisposed()) {
            if (this.helpListener == null) {
                this.helpListener = new HelpListener() {
                    public void helpRequested(HelpEvent event) {
                        handleHelpRequest(event);
                    }
                };
            }
            control.addHelpListener(this.helpListener);
            helpHooked = true;
        }
    }
}
项目:gef-gwt    文件:RetargetAction.java   
/**
 * Constructs a RetargetAction with the given action id, text and style.
 * 
 * @param actionID
 *            the retargetable action id
 * @param text
 *            the action's text, or <code>null</code> if there is no text
 * @param style
 *            one of <code>AS_PUSH_BUTTON</code>, <code>AS_CHECK_BOX</code>,
 *            <code>AS_DROP_DOWN_MENU</code>, <code>AS_RADIO_BUTTON</code>,
 *            and <code>AS_UNSPECIFIED</code>
 * @since 3.0
 */
public RetargetAction(String actionID, String text, int style) {
    super(text, style);
    setId(actionID);
    setEnabled(false);
    super.setHelpListener(new HelpListener() {
        public void helpRequested(HelpEvent e) {
            HelpListener listener = null;
            if (handler != null) {
                // if we have a handler, see if it has a help listener
                listener = handler.getHelpListener();
                if (listener == null) {
                    // use our own help listener
                    listener = localHelpListener;
                }
            }
            if (listener != null) {
                // pass on the event
                listener.helpRequested(e);
            }
        }
    });
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaUIHelp.java   
public void helpRequested(HelpEvent e) {
    try {
        Object[] selected= null;
        if (fViewer != null) {
            ISelection selection= fViewer.getSelection();
            if (selection instanceof IStructuredSelection) {
                selected= ((IStructuredSelection)selection).toArray();
            }
        } else if (fEditor != null) {
            IJavaElement input= SelectionConverter.getInput(fEditor);
            if (input != null && ActionUtil.isOnBuildPath(input)) {
                selected= SelectionConverter.codeResolve(fEditor);
            }
        }
        JavadocHelpContext.displayHelp(fContextId, selected);
    } catch (CoreException x) {
        JavaPlugin.log(x);
    }
}
项目:geoprism    文件:LocalizedWizardDialog.java   
protected void configureShell(Shell newShell)
{
  super.configureShell(newShell);
  // Register help listener on the shell
  newShell.addHelpListener(new HelpListener()
  {
    public void helpRequested(HelpEvent event)
    {
      // call perform help on the current page
      if (currentPage != null)
      {
        currentPage.performHelp();
      }
    }
  });
}
项目:PDFReporter-Studio    文件:HelpProvider.java   
/**
     * Open the selected uri if it is not null
     */
@Override
public void helpRequested(HelpEvent e) {
    if (href != null) {
        URL url = PlatformUI.getWorkbench().getHelpSystem().resolve(href, false);
        try {
            PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(url.toURI().toASCIIString());
        } catch (URISyntaxException e1) {
            e1.printStackTrace();
        }
    }
}
项目:p2-installer    文件:WizardDialog.java   
protected void configureShell(Shell newShell) {
    super.configureShell(newShell);
    // Register help listener on the shell
    newShell.addHelpListener(new HelpListener() {
        public void helpRequested(HelpEvent event) {
            // call perform help on the current page
            if (currentPage != null) {
                currentPage.performHelp();
            }
        }
    });
}
项目:translationstudio8    文件:TSWizardDialog.java   
protected void configureShell(Shell newShell) {
    super.configureShell(newShell);
    // Register help listener on the shell
    newShell.addHelpListener(new HelpListener() {
        public void helpRequested(HelpEvent event) {
            // call perform help on the current page
            if (currentPage != null) {
                currentPage.performHelp();
            }
        }
    });
}
项目:gef-gwt    文件:WizardDialog.java   
protected void configureShell(Shell newShell) {
    super.configureShell(newShell);
    // Register help listener on the shell
    newShell.addHelpListener(new HelpListener() {
        public void helpRequested(HelpEvent event) {
            // call perform help on the current page
            if (currentPage != null) {
                currentPage.performHelp();
            }
        }
    });
}
项目:tmxeditor8    文件:TSWizardDialog.java   
protected void configureShell(Shell newShell) {
    super.configureShell(newShell);
    // Register help listener on the shell
    newShell.addHelpListener(new HelpListener() {
        public void helpRequested(HelpEvent event) {
            // call perform help on the current page
            if (currentPage != null) {
                currentPage.performHelp();
            }
        }
    });
}
项目:logbookpn    文件:HelpEventListener.java   
@Override
public void helpRequested(HelpEvent paramHelpEvent) {
    new VersionDialog(this.shell).open();
}
项目:logbook-EN    文件:HelpEventListener.java   
@Override
public void helpRequested(HelpEvent paramHelpEvent) {
    new VersionDialog(this.shell).open();
}
项目:gef-gwt    文件:Viewer.java   
/**
 * Notifies any help listeners that help has been requested.
 * Only listeners registered at the time this method is called are notified.
 *
 * @param event a help event
 *
 * @see HelpListener#helpRequested(org.eclipse.swt.events.HelpEvent)
 */
protected void fireHelpRequested(HelpEvent event) {
    Object[] listeners = helpListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        ((HelpListener) listeners[i]).helpRequested(event);
    }
}
项目:gef-gwt    文件:Viewer.java   
/**
 * Handles a help request from the underlying SWT control.
 * The default behavior is to fire a help request,
 * with the event's data modified to hold this viewer.
 * @param event the event
 * 
 */
protected void handleHelpRequest(HelpEvent event) {
    Object oldData = event.data;
    event.data = this;
    fireHelpRequested(event);
    event.data = oldData;
}