本文整理汇总了Java中org.eclipse.swt.events.ArmListener类的典型用法代码示例。如果您正苦于以下问题:Java ArmListener类的具体用法?Java ArmListener怎么用?Java ArmListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArmListener类属于org.eclipse.swt.events包,在下文中一共展示了ArmListener类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addKeyText
import org.eclipse.swt.events.ArmListener; //导入依赖的package包/类
public static void addKeyText(final MenuItem mntm, final String text, final Task t) {
mntm.setText(text + "\t" + taskKeyMap.get(t)); //$NON-NLS-1$
mntm.addArmListener(new ArmListener() {
@Override
public void widgetArmed(ArmEvent e) {
mntm.setText(text + "\t" + taskKeyMap.get(t)); //$NON-NLS-1$
}
});
}
开发者ID:nilsschmidt1337,项目名称:ldparteditor,代码行数:10,代码来源:KeyStateManager.java
示例2: installTooltip
import org.eclipse.swt.events.ArmListener; //导入依赖的package包/类
private void installTooltip(final MenuItem menuItem, final IToolTipTextProvider toolTipTextProvider) {
final ArmListener armListener = new ArmListener() {
@Override
public void widgetArmed(final ArmEvent e) {
final boolean wasVisible = toolTip.isVisible();
toolTip.setVisible(false);
final String toolTipText = toolTipTextProvider.getToolTipText();
final boolean hasToolTip = toolTipText != null && !toolTipText.isEmpty();
if (wasVisible) {
if (hasToolTip) {
showToolTip(toolTipText);
}
}
else if (hasToolTip) {
lastArmListener = this;
final ArmListener thisListener = this;
Display.getCurrent().timerExec(400, new Runnable() {
@Override
public void run() {
if (lastArmListener == thisListener) {
showToolTip(toolTipText);
}
}
});
}
}
};
if (toolTip != null) {
menuItem.addArmListener(armListener);
}
}
开发者ID:jo-source,项目名称:jo-widgets,代码行数:38,代码来源:SwtMenu.java
示例3: addArmListener
import org.eclipse.swt.events.ArmListener; //导入依赖的package包/类
/**
* Adds the listener to the collection of listeners who will be notified
* when the arm events are generated for the control, by sending it one of
* the messages defined in the <code>ArmListener</code> interface.
*
* @param listener
* the listener which should be notified
*
* @exception IllegalArgumentException
* <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException
* <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been
* disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
* thread that created the receiver</li>
* </ul>
*
* @see ArmListener
* @see #removeArmListener
*/
public void addArmListener(ArmListener listener) {
checkWidget();
if (listener == null)
error(SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Arm, typedListener);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:31,代码来源:MenuItem.java
示例4: removeArmListener
import org.eclipse.swt.events.ArmListener; //导入依赖的package包/类
/**
* Removes the listener from the collection of listeners who will be
* notified when the arm events are generated for the control.
*
* @param listener
* the listener which should no longer be notified
*
* @exception IllegalArgumentException
* <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @exception SWTException
* <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been
* disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
* thread that created the receiver</li>
* </ul>
*
* @see ArmListener
* @see #addArmListener
*/
public void removeArmListener(ArmListener listener) {
checkWidget();
if (listener == null)
error(SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null)
return;
eventTable.unhook(SWT.Arm, listener);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:31,代码来源:MenuItem.java
注:本文中的org.eclipse.swt.events.ArmListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论