本文整理汇总了Java中org.eclipse.core.runtime.ListenerList.getListeners方法的典型用法代码示例。如果您正苦于以下问题:Java ListenerList.getListeners方法的具体用法?Java ListenerList.getListeners怎么用?Java ListenerList.getListeners使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.ListenerList
的用法示例。
在下文中一共展示了ListenerList.getListeners方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fireSelectionChanged
import org.eclipse.core.runtime.ListenerList; //导入方法依赖的package包/类
private void fireSelectionChanged(ListenerList list, ISelection selection)
{
SelectionChangedEvent event = new SelectionChangedEvent(delegate, selection);
Object[] listeners = list.getListeners();
for (int i = 0; i < listeners.length; i++)
{
try
{
ISelectionChangedListener listener = (ISelectionChangedListener) listeners[i];
listener.selectionChanged(event);
}
catch (Exception e)
{
Logger.getLogger(ProjectEditorSelectionService.class.getName()).log(Level.WARNING, "Exception fireing selection changed: "+e.getMessage());
}
}
}
示例2: fireSelectionChanged
import org.eclipse.core.runtime.ListenerList; //导入方法依赖的package包/类
/**
* Fires the {@link ISelection} change to the given list of {@link ISelectionChangedListener}.
*
* @param list
* the list of {@link ISelectionChangedListener}
* @param selection
* the {@link ISelection}
*/
private void fireSelectionChanged(@SuppressWarnings("rawtypes") ListenerList list, ISelection selection) {
SelectionChangedEvent event = new SelectionChangedEvent(delegate, selection);
Object[] listeners = list.getListeners();
for (int i = 0; i < listeners.length; i++) {
ISelectionChangedListener listener = (ISelectionChangedListener)listeners[i];
listener.selectionChanged(event);
}
}
示例3: getListeners
import org.eclipse.core.runtime.ListenerList; //导入方法依赖的package包/类
/**
* @return the listeners attached to this event manager.
* The listeners currently attached; may be empty, but never
* null.
*
*/
protected final Object[] getListeners() {
final ListenerList list = listenerList;
if (list == null) {
return new Object[0];
}
return list.getListeners();
}
示例4: getListeners
import org.eclipse.core.runtime.ListenerList; //导入方法依赖的package包/类
/**
* Returns the listeners attached to this event manager.
*
* @return The listeners currently attached; may be empty, but never
* <code>null</code>
*/
protected final Object[] getListeners() {
final ListenerList list = listenerList;
if (list == null) {
return EMPTY_ARRAY;
}
return list.getListeners();
}
示例5: fireSelectionChanged
import org.eclipse.core.runtime.ListenerList; //导入方法依赖的package包/类
private void fireSelectionChanged(ListenerList list, ISelection selection){
SelectionChangedEvent event = new SelectionChangedEvent(delegate, selection);
Object[] listeners = list.getListeners();
for (int i = 0; i < listeners.length; i++) {
ISelectionChangedListener listener = (ISelectionChangedListener) listeners[i];
listener.selectionChanged(event);
}
}