当前位置: 首页>>代码示例>>Java>>正文


Java HelpEvent类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:JavaUIHelp.java

示例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;
        }
    }
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:24,代码来源:Viewer.java

示例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);
			}
		}
	});
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:36,代码来源:RetargetAction.java

示例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();
      }
    }
  });
}
 
开发者ID:terraframe,项目名称:geoprism,代码行数:17,代码来源:LocalizedWizardDialog.java

示例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();
		}
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:15,代码来源:HelpProvider.java

示例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();
			}
		}
	});
}
 
开发者ID:MentorEmbedded,项目名称:p2-installer,代码行数:13,代码来源:WizardDialog.java

示例7: helpRequested

import org.eclipse.swt.events.HelpEvent; //导入依赖的package包/类
@Override
public void helpRequested(HelpEvent paramHelpEvent) {
    new VersionDialog(this.shell).open();
}
 
开发者ID:kyuntx,项目名称:logbookpn,代码行数:5,代码来源:HelpEventListener.java

示例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);
    }
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:15,代码来源:Viewer.java

示例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;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:14,代码来源:Viewer.java


注:本文中的org.eclipse.swt.events.HelpEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。