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


Java ListenerList类代码示例

本文整理汇总了Java中org.eclipse.core.runtime.ListenerList的典型用法代码示例。如果您正苦于以下问题:Java ListenerList类的具体用法?Java ListenerList怎么用?Java ListenerList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ListenerList类属于org.eclipse.core.runtime包,在下文中一共展示了ListenerList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SelectionProviderMediator

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
/**
 * @param viewers All viewers that can provide a selection
 * @param viewerInFocus the viewer currently in focus or <code>null</code>
 */
public SelectionProviderMediator(StructuredViewer[] viewers, StructuredViewer viewerInFocus) {
	Assert.isNotNull(viewers);
	fViewers= viewers;
	InternalListener listener= new InternalListener();
	fSelectionChangedListeners= new ListenerList();
	fPostSelectionChangedListeners= new ListenerList();
	fViewerInFocus= viewerInFocus;

	for (int i= 0; i < fViewers.length; i++) {
		StructuredViewer viewer= fViewers[i];
		viewer.addSelectionChangedListener(listener);
		viewer.addPostSelectionChangedListener(new InternalPostSelectionListener());
		Control control= viewer.getControl();
		control.addFocusListener(listener);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:SelectionProviderMediator.java

示例2: PartListenerGroup

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
public PartListenerGroup(ITextEditor editorPart) {
	fPart= editorPart;
	fCurrentJob= null;
	fAstListeners= new ListenerList(ListenerList.IDENTITY);

	fSelectionListener= new ISelectionChangedListener() {
		public void selectionChanged(SelectionChangedEvent event) {
			ISelection selection= event.getSelection();
			if (selection instanceof ITextSelection) {
				fireSelectionChanged((ITextSelection) selection);
			}
		}
	};

	fPostSelectionListener= new ISelectionListener() {
		public void selectionChanged(IWorkbenchPart part, ISelection selection) {
			if (part == fPart && selection instanceof ITextSelection)
				firePostSelectionChanged((ITextSelection) selection);
		}
	};
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:SelectionListenerWithASTManager.java

示例3: addPropertyChangeListener

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.action.ExternalActionManager.ICallback#addPropertyChangeListener(String,
 *      IPropertyChangeListener)
 */
public final void addPropertyChangeListener(final String commandId,
		final IPropertyChangeListener listener) {
	Object existing = registeredListeners.get(commandId);
	if (existing instanceof ListenerList) {
		((ListenerList) existing).add(listener);
	} else if (existing != null) {
		ListenerList listeners = new ListenerList(ListenerList.IDENTITY);
		listeners.add(existing);
		listeners.add(listener);
		registeredListeners.put(commandId, listeners);
	} else {
		registeredListeners.put(commandId, listener);
	}
	if (!bindingManagerListenerAttached) {
		bindingManager.addBindingManagerListener(this);
		bindingManagerListenerAttached = true;
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:23,代码来源:ExternalActionManager.java

示例4: removePropertyChangeListener

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.action.ExternalActionManager.ICallback#removePropertyChangeListener(String,
 *      IPropertyChangeListener)
 */
public final void removePropertyChangeListener(final String commandId,
		final IPropertyChangeListener listener) {
	Object existing = registeredListeners.get(commandId);
	if (existing == listener) {
		registeredListeners.remove(commandId);
		if (registeredListeners.isEmpty()) {
			bindingManager.removeBindingManagerListener(this);
			bindingManagerListenerAttached = false;
		}
	} else if (existing instanceof ListenerList) {
		ListenerList existingList = (ListenerList) existing;
		existingList.remove(listener);
		if (existingList.size() == 1) {
			registeredListeners.put(commandId,
					existingList.getListeners()[0]);
		}
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:23,代码来源:ExternalActionManager.java

示例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++)
	{
		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());
		}

	}
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:19,代码来源:ProjectEditorSelectionService.java

示例6: PathsProvider

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
protected PathsProvider(TableViewer viewer, FindbugsPropertyPage propertyPage) {
        this.propertyPage = propertyPage;
        this.paths = new ArrayList<IPathElement>();
        this.viewer = viewer;
        if(viewer instanceof CheckboxTableViewer) {
            CheckboxTableViewer tv = (CheckboxTableViewer) viewer;
//            tv.setCheckStateProvider(this);
            tv.addCheckStateListener(new ICheckStateListener() {
                public void checkStateChanged(CheckStateChangedEvent event) {
                    boolean checked = event.getChecked();
                    IPathElement element = (IPathElement) event.getElement();
                    element.setEnabled(checked);
                    handleContendChanged();
                }
            });
        }
        this.control = viewer.getTable();
        listeners = new ListenerList();
        viewer.setContentProvider(this);
    }
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:21,代码来源:PathsProvider.java

示例7: ScriptConsole

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
public ScriptConsole(String consoleName, String consoleType, IScriptConsoleInterpreter interpreterArg) {
    super(consoleName, consoleType, null, true);

    this.interpreter = interpreterArg;

    this.consoleListeners = new ListenerList(ListenerList.IDENTITY);
    this.prompt = createConsolePrompt();
    this.history = new ScriptConsoleHistory();

    this.session = new ScriptConsoleSession();
    addListener(this.session);

    partitioner = new ScriptConsolePartitioner();
    getDocument().setDocumentPartitioner(partitioner);
    partitioner.connect(getDocument());
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:17,代码来源:ScriptConsole.java

示例8: addListener

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
@Override
public void addListener(ILabelProviderListener listener) {
	if (fListeners == null) {
		fListeners= new ListenerList<>();
	}
	fListeners.add(listener);
	if (fProblemChangedListener == null) {
		fProblemChangedListener= new IProblemChangedListener() {
			@Override
			public void problemsChanged(IResource[] changedResources, boolean isMarkerChange,
					boolean calledFromDisplayThread) {
				fireProblemsChanged(changedResources, isMarkerChange);
			}
		};
		LangUIPlugin.getDefault().getProblemMarkerManager().addListener(fProblemChangedListener);
	}
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:18,代码来源:ProblemsLabelDecorator.java

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

示例10: ProfileManager

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
/**
 * Create and initialize a new profile manager.
 * 
 * @param profiles
 *            Initial custom profiles (List of type <code>CustomProfile</code>)
 * @param profileVersioner
 */
private ProfileManager()
{
	List<IProfile> profiles = new ArrayList<IProfile>();
	List<IProfile> builtInProfiles = getBuiltInProfiles();
	if (builtInProfiles != null && builtInProfiles.size() > 0)
	{
		profiles.addAll(builtInProfiles);
	}
	else
	{
		IdeLog.logError(FormatterPlugin.getDefault(), NLS.bind(
				FormatterMessages.AbstractFormatterSelectionBlock_noBuiltInProfiles, APTANA_CODE_FORMATTER_ID),
				IDebugScopes.DEBUG);
	}
	profiles.addAll(getCustomProfiles());

	fProfiles = new HashMap<String, IProfile>();
	fSelected = new HashMap<IProject, IProfile>();
	fProfilesByName = new ArrayList<IProfile>();
	for (final IProfile profile : profiles)
	{
		fProfiles.put(profile.getID(), profile);
		fProfilesByName.add(profile);
	}
	Collections.sort(fProfilesByName);
	if (!fProfilesByName.isEmpty())
	{
		String storedActiveProfile = getActiveProfileKey().getStoredValue(EclipseUtil.instanceScope());
		IProfile workspaceSelectedProfile = fProfiles.get(storedActiveProfile);
		if (workspaceSelectedProfile == null)
		{
			workspaceSelectedProfile = fProfilesByName.get(0);
		}
		fSelected.put(null, workspaceSelectedProfile);
	}
	listeners = new ListenerList();
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:45,代码来源:ProfileManager.java

示例11: addListenersToWorkingSetManagers

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
private void addListenersToWorkingSetManagers() {
	fListeners= new ListenerList(ListenerList.IDENTITY);
	fWorkingSetManagerListener= new IPropertyChangeListener() {
		public void propertyChange(PropertyChangeEvent event) {
			workingSetManagerChanged(event);
		}
	};
	PlatformUI.getWorkbench().getWorkingSetManager().addPropertyChangeListener(fWorkingSetManagerListener);
	fLocalWorkingSetManager.addPropertyChangeListener(fWorkingSetManagerListener);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:WorkingSetModel.java

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

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

示例14: refreshThePropertyView

import org.eclipse.core.runtime.ListenerList; //导入依赖的package包/类
private void refreshThePropertyView(final EObject theStereotypeApplication) {
    Display.getDefault().asyncExec(new Runnable() {
        @Override
        public void run() {
            for (final Adapter adapter : theStereotypeApplication.eAdapters()) {
                if (isInnerType(adapter, StereotypeApplicationObservableList.class)) {
                    final ListenerList[] listenerLists = get(ListenerList[].class,
                            get(StereotypeApplicationObservableList.class, adapter));
                    if (listenerLists != null) {
                        for (final ListenerList listenerList : listenerLists) {
                            for (final Object listener : listenerList.getListeners()) {
                                if (isInnerType(listener, StereotypeApplication.class)) {
                                    final AppliedStereotypeCompositeWithView composite = get(
                                            AppliedStereotypeCompositeWithView.class,
                                            get(StereotypeApplication.class, listener));
                                    if (composite != null) {
                                        composite.refreshTreeViewer();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    });
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:28,代码来源:ModelSaveListener.java

示例15: 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);
	}
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:9,代码来源:DelegatingSelectionProvider.java


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