當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。