Beispiel #1
0
 /*
  * Note: When the list of connections grows large copying will be longer
  * and longer, so it's better to return the previous set then to lock and
  * wait until the copy is completed, later this will be changed to using an
  * array so that the problem is not here and done w/o synch.
  *
  * large is 3000+ connecations.
  */
 public Conversation[] getArray() {
   if (hasChanged || convArr == null) {
     hasChanged = false;
     try {
       Conversation[] tmp = (Conversation[]) allConversations.toArray(new Conversation[] {});
       convArr = tmp;
     } catch (Exception e) {
     }
   }
   return convArr;
 }
Beispiel #2
0
 /**
  * Returns an array of all action names in this action set that should be cached; namely, <code>
  * BeanShellAction</code>s.
  *
  * @since jEdit 4.2pre1
  */
 public String[] getCacheableActionNames() {
   LinkedList<String> retVal = new LinkedList<String>();
   for (Object obj : actions.values()) {
     if (obj == placeholder) {
       // ??? this should only be called with
       // fully loaded action set
       Log.log(Log.WARNING, this, "Action set not up " + "to date");
     } else if (obj instanceof JEditBeanShellAction)
       retVal.add(((JEditBeanShellAction) obj).getName());
   }
   return retVal.toArray(new String[retVal.size()]);
 } // }}}
 /**
  * Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The
  * array should be ordered according to preference for providing the data (from most richly
  * descriptive to least descriptive).
  *
  * @return an array of data flavors in which this data can be transferred
  */
 @Override
 public DataFlavor[] getTransferDataFlavors() {
   return (DataFlavor[]) flavors.toArray(new DataFlavor[transferables.size()]);
 }