本文整理了Java中org.eclipse.swt.widgets.Listener
类的一些代码示例,展示了Listener
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Listener
类的具体详情如下:
包路径:org.eclipse.swt.widgets.Listener
类名称:Listener
[英]Implementers of Listener
provide a simple handleEvent()
method that is used internally by SWT to dispatch events.
After creating an instance of a class that implements this interface it can be added to a widget using the addListener(int eventType, Listener handler)
method and removed using the removeListener (int eventType, Listener handler)
method. When the specified event occurs, handleEvent(...)
will be sent to the instance.
Classes which implement this interface are described within SWT as providing the untyped listener API. Typically, widgets will also provide a higher-level typed listener API, that is based on the standard java.util.EventListener
pattern.
Note that, since all internal SWT event dispatching is based on untyped listeners, it is simple to build subsets of SWT for use on memory constrained, small footprint devices, by removing the classes and methods which implement the typed listener API.
[中]Listener
的实现者提供了一个简单的handleEvent()
方法,SWT在内部使用该方法来调度事件。
创建实现此接口的类的实例后,可以使用addListener(int eventType, Listener handler)
方法将其添加到小部件中,并使用removeListener (int eventType, Listener handler)
方法将其删除。当指定的事件发生时,handleEvent(...)
将被发送到实例。
实现此接口的类在SWT中描述为提供非类型化侦听器API。通常,小部件还将提供基于标准java.util.EventListener
模式的更高级别的类型化侦听器API。
请注意,由于所有内部SWT事件调度都基于非类型化侦听器,因此通过删除实现类型化侦听器API的类和方法,构建SWT子集以在内存受限、占用空间小的设备上使用非常简单。
代码示例来源:origin: pentaho/pentaho-kettle
@Override public void handleEvent( final Event event ) {
lsCancel.handleEvent( event );
shell.dispose();
}
};
代码示例来源:origin: stackoverflow.com
for (int i =0; i < listeners.size(); i++) {
Listener l = listeners.get(i);
if (l == null)
continue;
l.handleEvent();
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
public void modifyText(ModifyEvent evt)
{
statusListener_.handleEvent( null );
}
};
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
private void handleModifyBeanClassText()
{
statusListener.handleEvent(null);
serverProject_ = null;
serverComponentName_ = null;
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
public void modifyText(ModifyEvent evt)
{
handleProjectTypeChanged();
statusListener_.handleEvent( null );
}
};
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
public void modifyText(ModifyEvent evt)
{
handleProjectChanged();
statusListener_.handleEvent( null );
}
};
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
public void widgetSelected(SelectionEvent evt)
{
Table table = (Table) (evt.widget);
selectedBeanIndex = new Integer(table.getSelectionIndex());
statusListener_.handleEvent(null);
}
});
代码示例来源:origin: com.eclipsesource.tabris/tabris
@Override
public void run() {
Event event = new Event();
event.display = display;
listener.handleEvent( event );
}
} );
代码示例来源:origin: BiglySoftware/BiglyBT
/**
* Notifies the WindowAddedListener handlers
* @param sender A SWT shell that "sends" the events
*/
protected final void notifyAddListeners(Shell sender)
{
Iterator iter = addHandlers.iterator();
for(int i = 0; i < addHandlers.size(); i++)
{
((Listener)iter.next()).handleEvent(getSWTEvent(sender));
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
/**
* Notifies the WindowRemovedListener handlers
* @param sender A SWT shell that "sends" the events
*/
protected final void notifyRemoveListeners(Shell sender)
{
Iterator iter = removeHandlers.iterator();
for(int i = 0; i < removeHandlers.size(); i++)
{
((Listener)iter.next()).handleEvent(getSWTEvent(sender));
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event event) {
listener.handleEvent(event);
shell.dispose();
}
});
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
private void handleSelectionEvent(Event event)
{
if (launchUDDICheckbox_ == event.widget)
publicUDDIRegCombo_.setEnabled(launchUDDICheckbox_.getSelection());
statusListener.handleEvent(event);
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
private void handleTreeSelectionChangedEvent(SelectionChangedEvent event)
{
statusListener.handleEvent(new Event());
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
@Override
public void widgetSelected(SelectionEvent e) {
updateEnabledState();
if (selectionListener != null) {
selectionListener.handleEvent(new Event());
}
}
});
代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui
public void run()
{
handleWebServiceURI();
statusListener_.handleEvent(null);
}
代码示例来源:origin: org.eclipse.egit/ui
private void sendEvent(Widget widget, int index) {
Event event = new Event();
event.type = SWT.Selection;
event.index = index;
event.widget = widget;
event.data = fileRevisions[index];
for (Listener listener : eventList) {
listener.handleEvent(event);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
/**
* Handles events for all controls in the group.
*
* @param e
* org.eclipse.swt.widgets.Event
*/
@Override
public void handleEvent(Event e) {
validateControls();
if (client != null) {
client.handleEvent(e);
}
}
代码示例来源:origin: com.diffplug.durian/durian-swt
/** Sets the callback to be the given Listener. It may receive a null event. */
public Actions setListener(Listener listener) {
return setCallback((action, event) -> listener.handleEvent(event));
}
代码示例来源:origin: org.eclipse/org.eclipse.datatools.sqltools.common.ui
/**
* Handles events for all controls in the group.
*
* @param e org.eclipse.swt.widgets.Event
*/
public void handleEvent(Event e)
{
validateControls();
if (_client != null)
{
_client.handleEvent(e);
}
}
代码示例来源:origin: atdl4j/atdl4j
public void handleEvent(Event event) {
delegate.handleEvent(new SWTControlEvent(parameter));
}
内容来源于网络,如有侵权,请联系作者删除!