Codota Logo
CollectionEvent.getElements
Code IndexAdd Codota to your IDE (free)

How to use
getElements
method
in
com.ochafik.util.listenable.CollectionEvent

Best Java code snippets using com.ochafik.util.listenable.CollectionEvent.getElements (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: jtrfp/terminal-recall

@Override
public void collectionChanged(CollectionEvent<T> e) {
  switch(e.getType()){
  case ADDED:
  ls.fireAdded(CompoundListenableCollection.this, e.getElements());
  break;
  case REMOVED:
  ls.fireRemoved(CompoundListenableCollection.this, e.getElements());
  break;
  case UPDATED:
  ls.fireUpdated(CompoundListenableCollection.this, e.getElements());
  break;
  default:
  break;
  }//end EventTypes
}};
private final CollectionListener<ListenableCollection<T>> outerListener = new CollectionListener<ListenableCollection<T>>(){
origin: com.nativelibs4java/ochafik-util

  public void collectionChanged(CollectionEvent<T> e) {
    if (listeners != null && !listeners.isEmpty()) {
      Collection<T> filteredElements = e.getElements();
      CollectionEvent<T> filteredEvent = new CollectionEvent<T>(FilteredListenableCollection.this, filteredElements, e.getType(), e.getFirstIndex(), e.getLastIndex());
      for (CollectionListener<T> listener : listeners) {
        listener.collectionChanged(filteredEvent);
      }
    }
  }
});
origin: jtrfp/terminal-recall

@Override
public void collectionChanged(CollectionEvent<ListenableCollection<T>> e) {
  switch(e.getType()){
  case ADDED:
  for(ListenableCollection<T> coll:e.getElements()){
    delegate.addComponent(coll);
    coll.addCollectionListener(innerListener);
    ls.fireAdded(CompoundListenableCollection.this, coll);
  }//end for(collections added)
  break;
  case REMOVED:
  for(ListenableCollection<T> coll:e.getElements()){
    delegate.removeComponent(coll);
    coll.removeCollectionListener(innerListener);
    ls.fireRemoved(CompoundListenableCollection.this, coll);
  }//end for(collections removed)
  break;
  case UPDATED:
  // ????
  break;
  default:
  break;
  }//end EventTypes
}};
origin: com.nativelibs4java/ochafik-util

ListenableCollection<T> source = e.getSource(), recipient = source == a ? b : a;
for (T t : e.getElements()) {
  switch (e.getType()) {
  case ADDED:
origin: com.nativelibs4java/ochafik-util

  public void collectionChanged(CollectionEvent<U> e) {
    // Do not propagate the event if we triggered it
    if (currentlyCausingChange)
      return;
    
    // Only propagate if someone is listening (CollectionSupport already tries not to fire anything when there is no listener, but here we are trying to avoid to create the wrapped elements collection)
    if (collectionSupport == null || !collectionSupport.hasListeners())
      return;
    
    // Adapt the collection of changed / added / removed elements in the event
    collectionSupport.fireEvent(
      AdaptedCollection.this, 
      new AdaptedCollection<U, V>(e.getElements(), AdaptedCollection.this.forwardAdapter, AdaptedCollection.this.backwardAdapter), 
      e.getType(), 
      e.getFirstIndex(), 
      e.getLastIndex());
  }
});
com.ochafik.util.listenableCollectionEventgetElements

Javadoc

Get the elements affected by the event.

Popular methods of CollectionEvent

  • getType
    Get the event type
  • <init>
  • getFirstIndex
    Get the index of the first affected element in the source, or -1 if not applicable
  • getLastIndex
    Get the index of the last affected element in the source, or -1 if not applicable
  • getSource

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • addToBackStack (FragmentTransaction)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now