本文整理汇总了Java中org.eclipse.swt.events.HelpEvent类的典型用法代码示例。如果您正苦于以下问题:Java HelpEvent类的具体用法?Java HelpEvent怎么用?Java HelpEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HelpEvent类属于org.eclipse.swt.events包,在下文中一共展示了HelpEvent类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: helpRequested
import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
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);
}
}
示例2: addHelpListener
import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
/**
* 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;
}
}
}
示例3: RetargetAction
import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
/**
* 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);
}
}
});
}
示例4: configureShell
import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
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();
}
}
});
}
示例5: helpRequested
import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
/**
* 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();
}
}
}
示例6: configureShell
import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
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();
}
}
});
}
示例7: helpRequested
import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
@Override
public void helpRequested(HelpEvent paramHelpEvent) {
new VersionDialog(this.shell).open();
}
示例8: fireHelpRequested
import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
/**
* 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);
}
}
示例9: handleHelpRequest
import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
/**
* 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;
}