Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.ListenerList


    Assert.isNotNull(document);
    fDocument= document;
    fHistory= OperationHistoryFactory.getOperationHistory();
    fUndoContext= new ObjectUndoContext(fDocument);
    fConnected= new ArrayList();
    fDocumentUndoListeners= new ListenerList(ListenerList.IDENTITY);
  }
View Full Code Here


 
  /**
   * Constructs a new string variable manager.
   */
  private StringVariableManager() {
    fListeners = new ListenerList();
 
View Full Code Here

    /* (non-Javadoc)
   * @see org.eclipse.ui.console.IConsoleManager#addConsoleListener(org.eclipse.ui.console.IConsoleListener)
   */
  public void addConsoleListener(IConsoleListener listener) {
    if (fListeners == null) {
      fListeners = new ListenerList();
    }
    fListeners.add(listener);
  }
View Full Code Here

   * @param listener
   *            the event listener to add
   */
  public void addHyperlinkListener(IHyperlinkListener listener) {
    if (listeners == null)
      listeners = new ListenerList();
    listeners.add(listener);
  }
View Full Code Here

   * @param console
   */
  private void activateParticipants(IConsole console) {
    // activate
    if (console != null && fActive) {
      final ListenerList listeners = getParticipants(console);
      if (listeners != null) {
        Object[] participants = listeners.getListeners();
          for (int i = 0; i < participants.length; i++) {
            final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
            SafeRunner.run(new ISafeRunnable() {
            public void run() throws Exception {
              participant.activated();
            }
            public void handleException(Throwable exception) {
              ConsolePlugin.log(exception);
              listeners.remove(participant);
            }
          });
          }
      }
    }
View Full Code Here

   */
  protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
      IConsole console = (IConsole)fPartToConsole.get(part);
     
    // dispose page participants
    ListenerList listeners = (ListenerList) fConsoleToPageParticipants.remove(console);
    if (listeners != null) {
      Object[] participants = listeners.getListeners();
      for (int i = 0; i < participants.length; i++) {
              final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
              SafeRunner.run(new ISafeRunnable() {
          public void run() throws Exception {
            participant.dispose();
View Full Code Here

    page.createControl(getPageBook());
    console.addPropertyChangeListener(this);
   
    // initialize page participants
    IConsolePageParticipant[] consoleParticipants = ((ConsoleManager)getConsoleManager()).getPageParticipants(console);
    final ListenerList participants = new ListenerList();
    for (int i = 0; i < consoleParticipants.length; i++) {
      participants.add(consoleParticipants[i]);
    }
    fConsoleToPageParticipants.put(console, participants);
    Object[] listeners = participants.getListeners();
    for (int i = 0; i < listeners.length; i++) {
            final IConsolePageParticipant participant = (IConsolePageParticipant) listeners[i];
            SafeRunner.run(new ISafeRunnable() {
        public void run() throws Exception {
          participant.init(page, console);
        }
        public void handleException(Throwable exception) {
          ConsolePlugin.log(exception);
          participants.remove(participant);
        }
      });
        }
   
    PageRec rec = new PageRec(dummyPart, page);
View Full Code Here

    public Object getAdapter(Class key) {
        Object adpater = super.getAdapter(key);
        if (adpater == null) {
            IConsole console = getConsole();
            if (console != null) {
                ListenerList listeners = getParticipants(console);
                // an adapter can be asked for before the console participants are created
                if (listeners != null) {
                  Object[] participants = listeners.getListeners();
                    for (int i = 0; i < participants.length; i++) {
                        IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
                        adpater = participant.getAdapter(key);
                        if (adpater != null) {
                            return adpater;
View Full Code Here

   * @param console console to deactivate
   */
  private void deactivateParticipants(IConsole console) {
    // deactivate
      if (console != null) {
      final ListenerList listeners = getParticipants(console);
      if (listeners != null) {
        Object[] participants = listeners.getListeners();
          for (int i = 0; i < participants.length; i++) {
            final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
            SafeRunner.run(new ISafeRunnable() {
            public void run() throws Exception {
              participant.deactivated();
            }
            public void handleException(Throwable exception) {
              ConsolePlugin.log(exception);
              listeners.remove(participant);
            }
          });
                }
      }
      }
View Full Code Here

            .arraycopy(listenerLists, 0,
                listenerLists = new ListenerList[length + 1],
                0, length);
      }
      listenerTypes[length] = listenerType;
      listenerLists[length] = new ListenerList();
      listenerTypeIndex = length;
    }
    boolean hadListeners = hasListeners();
    listenerLists[listenerTypeIndex].add(listener);
    if (!hadListeners && hasListeners()) {
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.ListenerList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.