Java 类org.eclipse.core.runtime.ListenerList 实例源码

项目:Eclipse-Postfix-Code-Completion    文件:SelectionProviderMediator.java   
/**
 * @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);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:SelectionListenerWithASTManager.java   
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);
        }
    };
}
项目:gef-gwt    文件:ExternalActionManager.java   
/**
 * @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;
    }
}
项目:gef-gwt    文件:ExternalActionManager.java   
/**
 * @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]);
        }
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:SelectionProviderMediator.java   
/**
 * @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);
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:SelectionListenerWithASTManager.java   
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);
        }
    };
}
项目:Environment    文件:ProjectEditorSelectionService.java   
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());
        }

    }
}
项目:FindBug-for-Domino-Designer    文件:PathsProvider.java   
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);
    }
项目:Pydev    文件:ScriptConsole.java   
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());
}
项目:goclipse    文件:ProblemsLabelDecorator.java   
@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);
    }
}
项目:Source    文件:SelectionProviderIntermediate.java   
/**
 * 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);
    }
}
项目:Source    文件:SelectionProviderIntermediate.java   
/**
 * 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);
    }
}
项目:APICloud-Studio    文件:ProfileManager.java   
/**
 * 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();
}
项目:Eclipse-Postfix-Code-Completion    文件:WorkingSetModel.java   
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);
}
项目:gef-gwt    文件:ToolBarManager2.java   
/**
 * @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();
}
项目:gef-gwt    文件:EventManager.java   
/**
 * 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();
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:WorkingSetModel.java   
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);
}
项目:NIEM-Modeling-Tool    文件:ModelSaveListener.java   
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();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    });
}
项目:elexis-3-core    文件:DelegatingSelectionProvider.java   
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);
    }
}
项目:elexis-3-core    文件:CodesSelectionComposite.java   
public CodesSelectionComposite(Composite parent, int style){
    super(parent, style);
    currentSelection = new ArrayList<>();
    selectionChangedListeners = new ListenerList<>();

    createContent();
}
项目:elexis-3-core    文件:ElexisEventDispatcher.java   
private ElexisEventDispatcher(){
    super(ElexisEventDispatcher.class.getName());
    setSystem(true);
    setUser(false);
    setPriority(Job.SHORT);
    listeners = new ListenerList<ElexisEventListener>();
    dispatchers = new HashMap<Class<?>, IElexisEventDispatcher>();
    eventQueue = new PriorityQueue<ElexisEvent>(50);
    eventCopy = new ArrayList<ElexisEvent>(50);

    elexisUIContext = new ElexisContext();
}
项目:psf-import    文件:PsfImportWizardFilesSelectionPage.java   
/**
 * 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();
}
项目:DarwinSPL    文件:DwprofileTextHover.java   
public SimpleSelectionProvider() {
    selectionChangedListeners = new ListenerList();
}
项目:DarwinSPL    文件:HyexpressionTextHover.java   
public SimpleSelectionProvider() {
    selectionChangedListeners = new ListenerList();
}
项目:DarwinSPL    文件:HyvalidityformulaTextHover.java   
public SimpleSelectionProvider() {
    selectionChangedListeners = new ListenerList();
}
项目:DarwinSPL    文件:HydatavalueTextHover.java   
public SimpleSelectionProvider() {
    selectionChangedListeners = new ListenerList();
}
项目:DarwinSPL    文件:HymappingTextHover.java   
public SimpleSelectionProvider() {
    selectionChangedListeners = new ListenerList();
}
项目:DarwinSPL    文件:HyconstraintsTextHover.java   
public SimpleSelectionProvider() {
    selectionChangedListeners = new ListenerList();
}
项目:DarwinSPL    文件:HymanifestTextHover.java   
public SimpleSelectionProvider() {
    selectionChangedListeners = new ListenerList();
}
项目:eclipse.jdt.ls    文件:PreferenceManager.java   
public PreferenceManager() {
    preferences = new Preferences();
    preferencesChangeListeners = new ListenerList<>();
    initialize();
}
项目:turnus    文件:TurnusProcess.java   
/**
 * Creates a new monitor.
 */
public TurnusMonitor() {
    contents = "";
    list = new ListenerList();
}
项目:che    文件:WorkspaceTracker.java   
private WorkspaceTracker() {
  fListeners = new ListenerList();
}
项目:APICloud-Studio    文件:CListViewer.java   
/**
 * Initialize the listeners list.
 */
private void init()
{
    listeners = new ListenerList();
}
项目:APICloud-Studio    文件:ProblemMarkerManager.java   
public ProblemMarkerManager()
{
    fListeners = new ListenerList();
    fResourcesWithMarkerChanges = new HashSet<IResource>();
    fResourcesWithAnnotationChanges = new HashSet<IResource>();
}
项目:mytourbook    文件:MP.java   
public static ListenerList getTileListeners() {
    return _tileListeners;
}
项目:mytourbook    文件:MP.java   
public static ListenerList getTileListeners() {
    return _tileListeners;
}
项目:Eclipse-Postfix-Code-Completion    文件:WorkspaceTracker.java   
private WorkspaceTracker() {
    fListeners= new ListenerList();
}
项目:Eclipse-Postfix-Code-Completion    文件:CompilationUnitDocumentProvider.java   
public GlobalAnnotationModelListener() {
    fListenerList= new ListenerList(ListenerList.IDENTITY);
}
项目:Eclipse-Postfix-Code-Completion    文件:SimpleSelectionProvider.java   
/**
 * Create a new SimpleSelectionProvider
 */
public SimpleSelectionProvider() {
    fSelectionChangedListeners= new ListenerList();
}
项目:Eclipse-Postfix-Code-Completion    文件:ProblemMarkerManager.java   
public ProblemMarkerManager() {
    fListeners= new ListenerList();
    fResourcesWithMarkerChanges= new HashSet<IResource>();
    fResourcesWithAnnotationChanges= new HashSet<IResource>();
}