org-openide-explorer

16:40:30.638 INFO  jd.cli.Main - Decompiling org-openide-explorer.jar
package org.netbeans.modules.openide.explorer;

import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.util.ArrayList;
import org.openide.util.datatransfer.ExTransferable.Single;

final class ExternalDragAndDrop$1
  extends ExTransferable.Single
{
  ExternalDragAndDrop$1(DataFlavor paramDataFlavor, ArrayList paramArrayList)
  {
    super(paramDataFlavor);
  }
  
  protected Object getData()
    throws IOException, UnsupportedFlavorException
  {
    return val$fileList;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.ExternalDragAndDrop.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.openide.util.datatransfer.ExTransferable;
import org.openide.util.datatransfer.ExTransferable.Multi;
import org.openide.util.datatransfer.ExTransferable.Single;
import org.openide.util.datatransfer.MultiTransferObject;

public class ExternalDragAndDrop
{
  public static Transferable maybeAddExternalFileDnd(ExTransferable.Multi paramMulti)
  {
    Object localObject = paramMulti;
    try
    {
      MultiTransferObject localMultiTransferObject = (MultiTransferObject)paramMulti.getTransferData(ExTransferable.multiFlavor);
      final ArrayList localArrayList = new ArrayList(localMultiTransferObject.getCount());
      for (int i = 0; i < localMultiTransferObject.getCount(); i++) {
        if (localMultiTransferObject.isDataFlavorSupported(i, DataFlavor.javaFileListFlavor))
        {
          List localList = (List)localMultiTransferObject.getTransferData(i, DataFlavor.javaFileListFlavor);
          localArrayList.addAll(localList);
        }
      }
      if (!localArrayList.isEmpty())
      {
        ExTransferable localExTransferable = ExTransferable.create(paramMulti);
        localExTransferable.put(new ExTransferable.Single(DataFlavor.javaFileListFlavor)
        {
          protected Object getData()
            throws IOException, UnsupportedFlavorException
          {
            return localArrayList;
          }
        });
        localObject = localExTransferable;
      }
    }
    catch (UnsupportedFlavorException localUnsupportedFlavorException)
    {
      Logger.getLogger(ExternalDragAndDrop.class.getName()).log(Level.INFO, null, localUnsupportedFlavorException);
    }
    catch (IOException localIOException)
    {
      Logger.getLogger(ExternalDragAndDrop.class.getName()).log(Level.INFO, null, localIOException);
    }
    return (Transferable)localObject;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.ExternalDragAndDrop
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

class NodeOperationImpl$1 {}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.NodeOperationImpl.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

import javax.swing.JPanel;
import org.openide.explorer.ExplorerManager;
import org.openide.explorer.ExplorerManager.Provider;

final class NodeOperationImpl$EP
  extends JPanel
  implements ExplorerManager.Provider
{
  private ExplorerManager em = new ExplorerManager();
  
  public ExplorerManager getExplorerManager()
  {
    return em;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.NodeOperationImpl.EP
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import javax.swing.JDialog;
import javax.swing.JPanel;
import org.openide.explorer.ExplorerManager;
import org.openide.explorer.ExplorerManager.Provider;
import org.openide.explorer.propertysheet.PropertySheet;
import org.openide.explorer.view.BeanTreeView;
import org.openide.nodes.Node;
import org.openide.nodes.NodeAcceptor;
import org.openide.nodes.NodeOperation;
import org.openide.util.UserCancelException;

public final class NodeOperationImpl
  extends NodeOperation
{
  public boolean customize(Node paramNode)
  {
    Component localComponent = paramNode.getCustomizer();
    if (localComponent == null) {
      return false;
    }
    JDialog localJDialog = new JDialog();
    localJDialog.setModal(false);
    localJDialog.setTitle(paramNode.getDisplayName());
    localJDialog.getContentPane().setLayout(new BorderLayout());
    localJDialog.getContentPane().add(localComponent, "Center");
    localJDialog.setDefaultCloseOperation(2);
    localJDialog.pack();
    localJDialog.setVisible(true);
    return true;
  }
  
  public void explore(Node paramNode)
  {
    JDialog localJDialog = new JDialog();
    localJDialog.setTitle(paramNode.getDisplayName());
    localJDialog.setModal(false);
    localJDialog.getContentPane().setLayout(new BorderLayout());
    EP localEP = new EP(null);
    localEP.getExplorerManager().setRootContext(paramNode);
    localEP.setLayout(new BorderLayout());
    localEP.add(new BeanTreeView(), "Center");
    localJDialog.getContentPane().add(localEP, "Center");
    localJDialog.setDefaultCloseOperation(2);
    localJDialog.pack();
    localJDialog.setVisible(true);
  }
  
  public Node[] select(String paramString1, String paramString2, Node paramNode, NodeAcceptor paramNodeAcceptor, Component paramComponent)
    throws UserCancelException
  {
    JDialog localJDialog = new JDialog();
    localJDialog.setTitle(paramString1);
    localJDialog.setModal(true);
    localJDialog.getContentPane().setLayout(new BorderLayout());
    EP localEP = new EP(null);
    localEP.getExplorerManager().setRootContext(paramNode);
    localEP.setLayout(new BorderLayout());
    localEP.add(new BeanTreeView(), "Center");
    localJDialog.getContentPane().add(localEP, "Center");
    if (paramComponent != null) {
      localJDialog.getContentPane().add(paramComponent, "North");
    }
    localJDialog.pack();
    localJDialog.setVisible(true);
    Node[] arrayOfNode = localEP.getExplorerManager().getSelectedNodes();
    localJDialog.dispose();
    return arrayOfNode;
  }
  
  public void showProperties(Node paramNode)
  {
    showProperties(new Node[] { paramNode });
  }
  
  public void showProperties(Node[] paramArrayOfNode)
  {
    PropertySheet localPropertySheet = new PropertySheet();
    localPropertySheet.setNodes(paramArrayOfNode);
    JDialog localJDialog = new JDialog();
    localJDialog.setTitle("Properties");
    localJDialog.setModal(true);
    localJDialog.getContentPane().setLayout(new BorderLayout());
    localJDialog.getContentPane().add(localPropertySheet, "Center");
    localJDialog.pack();
    localJDialog.setVisible(true);
    localJDialog.dispose();
  }
  
  private static final class EP
    extends JPanel
    implements ExplorerManager.Provider
  {
    private ExplorerManager em = new ExplorerManager();
    
    public ExplorerManager getExplorerManager()
    {
      return em;
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.NodeOperationImpl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

import java.util.Map;
import java.util.WeakHashMap;

public class TTVEnvBridge
{
  private static Map<Object, TTVEnvBridge> bridges = new WeakHashMap();
  Object[] beans = null;
  
  public static TTVEnvBridge getInstance(Object paramObject)
  {
    TTVEnvBridge localTTVEnvBridge = (TTVEnvBridge)bridges.get(paramObject);
    if (localTTVEnvBridge == null)
    {
      localTTVEnvBridge = new TTVEnvBridge();
      bridges.put(paramObject, localTTVEnvBridge);
    }
    return localTTVEnvBridge;
  }
  
  public static TTVEnvBridge findInstance(Object paramObject)
  {
    return (TTVEnvBridge)bridges.get(paramObject);
  }
  
  public void setCurrentBeans(Object[] paramArrayOfObject)
  {
    beans = paramArrayOfObject;
  }
  
  public void clear()
  {
    beans = null;
  }
  
  public Object[] getCurrentBeans()
  {
    if (beans == null) {
      return new Object[0];
    }
    return beans;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.TTVEnvBridge
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

import javax.swing.JComponent;
import javax.swing.event.ChangeListener;

public abstract class TabbedContainerBridge
{
  public static TabbedContainerBridge getDefault()
  {
    return new TabbedContainerBridgeImpl();
  }
  
  public abstract JComponent createTabbedContainer();
  
  public abstract void setInnerComponent(JComponent paramJComponent1, JComponent paramJComponent2);
  
  public abstract JComponent getInnerComponent(JComponent paramJComponent);
  
  public abstract Object[] getItems(JComponent paramJComponent);
  
  public abstract void setItems(JComponent paramJComponent, Object[] paramArrayOfObject, String[] paramArrayOfString);
  
  public abstract void attachSelectionListener(JComponent paramJComponent, ChangeListener paramChangeListener);
  
  public abstract void detachSelectionListener(JComponent paramJComponent, ChangeListener paramChangeListener);
  
  public abstract Object getSelectedItem(JComponent paramJComponent);
  
  public abstract void setSelectedItem(JComponent paramJComponent, Object paramObject);
  
  public abstract boolean setSelectionByName(JComponent paramJComponent, String paramString);
  
  public abstract String getCurrentSelectedTabName(JComponent paramJComponent);
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.TabbedContainerBridge
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

import java.util.List;
import javax.swing.JComponent;
import javax.swing.SingleSelectionModel;
import javax.swing.event.ChangeListener;
import org.netbeans.swing.tabcontrol.ComponentConverter;
import org.netbeans.swing.tabcontrol.ComponentConverter.Fixed;
import org.netbeans.swing.tabcontrol.TabData;
import org.netbeans.swing.tabcontrol.TabDataModel;
import org.netbeans.swing.tabcontrol.TabbedContainer;

class TabbedContainerBridgeImpl
  extends TabbedContainerBridge
{
  public void attachSelectionListener(JComponent paramJComponent, ChangeListener paramChangeListener)
  {
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent;
    localTabbedContainer.getSelectionModel().addChangeListener(paramChangeListener);
  }
  
  public JComponent createTabbedContainer()
  {
    return new TabbedContainer(3);
  }
  
  public void detachSelectionListener(JComponent paramJComponent, ChangeListener paramChangeListener)
  {
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent;
    localTabbedContainer.getSelectionModel().removeChangeListener(paramChangeListener);
  }
  
  public Object[] getItems(JComponent paramJComponent)
  {
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent;
    List localList = localTabbedContainer.getModel().getTabs();
    Object[] arrayOfObject = new Object[localList.size()];
    for (int i = 0; i < arrayOfObject.length; i++) {
      arrayOfObject[i] = ((TabData)localList.get(i)).getUserObject();
    }
    return arrayOfObject;
  }
  
  public Object getSelectedItem(JComponent paramJComponent)
  {
    Object localObject = null;
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent;
    int i = localTabbedContainer.getSelectionModel().getSelectedIndex();
    if (i != -1) {
      localObject = localTabbedContainer.getModel().getTab(i).getUserObject();
    }
    return localObject;
  }
  
  public void setSelectedItem(JComponent paramJComponent, Object paramObject)
  {
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent;
    TabDataModel localTabDataModel = localTabbedContainer.getModel();
    int i = localTabDataModel.size();
    for (int j = 0; j < i; j++)
    {
      TabData localTabData = localTabDataModel.getTab(j);
      if (localTabData.getUserObject() == paramObject)
      {
        localTabbedContainer.getSelectionModel().setSelectedIndex(j);
        break;
      }
    }
  }
  
  public boolean setSelectionByName(JComponent paramJComponent, String paramString)
  {
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent;
    TabDataModel localTabDataModel = localTabbedContainer.getModel();
    int i = localTabDataModel.size();
    for (int j = 0; j < i; j++)
    {
      TabData localTabData = localTabDataModel.getTab(j);
      if (paramString.equals(localTabData.getText()))
      {
        localTabbedContainer.getSelectionModel().setSelectedIndex(j);
        return true;
      }
    }
    return false;
  }
  
  public String getCurrentSelectedTabName(JComponent paramJComponent)
  {
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent;
    int i = localTabbedContainer.getSelectionModel().getSelectedIndex();
    if (i != -1)
    {
      TabData localTabData = localTabbedContainer.getModel().getTab(i);
      return localTabData.getText();
    }
    return null;
  }
  
  public void setInnerComponent(JComponent paramJComponent1, JComponent paramJComponent2)
  {
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent1;
    ComponentConverter.Fixed localFixed = new ComponentConverter.Fixed(paramJComponent2);
    localTabbedContainer.setComponentConverter(localFixed);
  }
  
  public JComponent getInnerComponent(JComponent paramJComponent)
  {
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent;
    return (JComponent)localTabbedContainer.getComponentConverter().getComponent(null);
  }
  
  public void setItems(JComponent paramJComponent, Object[] paramArrayOfObject, String[] paramArrayOfString)
  {
    TabbedContainer localTabbedContainer = (TabbedContainer)paramJComponent;
    assert (paramArrayOfObject.length == paramArrayOfString.length);
    TabData[] arrayOfTabData = new TabData[paramArrayOfObject.length];
    for (int i = 0; i < paramArrayOfObject.length; i++) {
      arrayOfTabData[i] = new TabData(paramArrayOfObject[i], null, paramArrayOfString[i], null);
    }
    localTabbedContainer.getModel().setTabs(arrayOfTabData);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.TabbedContainerBridgeImpl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.logging.LogRecord;

final class UIException$AnnException
  extends Exception
  implements Callable<LogRecord[]>
{
  private List<LogRecord> records;
  
  public String getMessage()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    String str = "";
    for (LogRecord localLogRecord : records) {
      if (localLogRecord.getMessage() != null)
      {
        localStringBuilder.append(str);
        localStringBuilder.append(localLogRecord.getMessage());
        str = "\n";
      }
    }
    return localStringBuilder.toString();
  }
  
  static AnnException findOrCreate(Throwable paramThrowable, boolean paramBoolean)
  {
    if ((paramThrowable instanceof AnnException)) {
      return (AnnException)paramThrowable;
    }
    if (paramThrowable.getCause() == null)
    {
      if (paramBoolean) {
        paramThrowable.initCause(new AnnException());
      }
      return (AnnException)paramThrowable.getCause();
    }
    return findOrCreate(paramThrowable.getCause(), paramBoolean);
  }
  
  public synchronized void addRecord(LogRecord paramLogRecord)
  {
    if (records == null) {
      records = new ArrayList();
    }
    records.add(paramLogRecord);
  }
  
  public LogRecord[] call()
  {
    List localList = records;
    LogRecord[] arrayOfLogRecord = new LogRecord[0];
    return localList == null ? arrayOfLogRecord : (LogRecord[])localList.toArray(arrayOfLogRecord);
  }
  
  public void printStackTrace(PrintStream paramPrintStream)
  {
    super.printStackTrace(paramPrintStream);
    logRecords(paramPrintStream);
  }
  
  public void printStackTrace(PrintWriter paramPrintWriter)
  {
    super.printStackTrace(paramPrintWriter);
    logRecords(paramPrintWriter);
  }
  
  public void printStackTrace()
  {
    printStackTrace(System.err);
  }
  
  private void logRecords(Appendable paramAppendable)
  {
    List localList = records;
    if (localList == null) {
      return;
    }
    try
    {
      for (LogRecord localLogRecord : localList)
      {
        if (localLogRecord.getMessage() != null) {
          paramAppendable.append(localLogRecord.getMessage()).append('\n');
        }
        if (localLogRecord.getThrown() != null)
        {
          StringWriter localStringWriter = new StringWriter();
          localLogRecord.getThrown().printStackTrace(new PrintWriter(localStringWriter));
          paramAppendable.append(localStringWriter.toString()).append('\n');
        }
      }
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.UIException.AnnException
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

import java.util.logging.Level;

final class UIException$OwnLevel
  extends Level
{
  public static final Level USER = new OwnLevel("USER", 1973);
  
  private UIException$OwnLevel(String paramString, int paramInt)
  {
    super(paramString, paramInt);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.UIException.OwnLevel
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.openide.explorer;

import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import org.openide.util.Exceptions;

public final class UIException
{
  public static void annotateUser(Throwable paramThrowable1, String paramString1, String paramString2, Throwable paramThrowable2, Date paramDate)
  {
    AnnException localAnnException = AnnException.findOrCreate(paramThrowable1, true);
    LogRecord localLogRecord = new LogRecord(OwnLevel.USER, paramString1);
    if (paramThrowable2 != null) {
      localLogRecord.setThrown(paramThrowable2);
    }
    localAnnException.addRecord(localLogRecord);
    if (paramString2 != null) {
      Exceptions.attachLocalizedMessage(paramThrowable1, paramString2);
    }
  }
  
  private static final class OwnLevel
    extends Level
  {
    public static final Level USER = new OwnLevel("USER", 1973);
    
    private OwnLevel(String paramString, int paramInt)
    {
      super(paramInt);
    }
  }
  
  private static final class AnnException
    extends Exception
    implements Callable<LogRecord[]>
  {
    private List<LogRecord> records;
    
    public String getMessage()
    {
      StringBuilder localStringBuilder = new StringBuilder();
      String str = "";
      for (LogRecord localLogRecord : records) {
        if (localLogRecord.getMessage() != null)
        {
          localStringBuilder.append(str);
          localStringBuilder.append(localLogRecord.getMessage());
          str = "\n";
        }
      }
      return localStringBuilder.toString();
    }
    
    static AnnException findOrCreate(Throwable paramThrowable, boolean paramBoolean)
    {
      if ((paramThrowable instanceof AnnException)) {
        return (AnnException)paramThrowable;
      }
      if (paramThrowable.getCause() == null)
      {
        if (paramBoolean) {
          paramThrowable.initCause(new AnnException());
        }
        return (AnnException)paramThrowable.getCause();
      }
      return findOrCreate(paramThrowable.getCause(), paramBoolean);
    }
    
    public synchronized void addRecord(LogRecord paramLogRecord)
    {
      if (records == null) {
        records = new ArrayList();
      }
      records.add(paramLogRecord);
    }
    
    public LogRecord[] call()
    {
      List localList = records;
      LogRecord[] arrayOfLogRecord = new LogRecord[0];
      return localList == null ? arrayOfLogRecord : (LogRecord[])localList.toArray(arrayOfLogRecord);
    }
    
    public void printStackTrace(PrintStream paramPrintStream)
    {
      super.printStackTrace(paramPrintStream);
      logRecords(paramPrintStream);
    }
    
    public void printStackTrace(PrintWriter paramPrintWriter)
    {
      super.printStackTrace(paramPrintWriter);
      logRecords(paramPrintWriter);
    }
    
    public void printStackTrace()
    {
      printStackTrace(System.err);
    }
    
    private void logRecords(Appendable paramAppendable)
    {
      List localList = records;
      if (localList == null) {
        return;
      }
      try
      {
        for (LogRecord localLogRecord : localList)
        {
          if (localLogRecord.getMessage() != null) {
            paramAppendable.append(localLogRecord.getMessage()).append('\n');
          }
          if (localLogRecord.getThrown() != null)
          {
            StringWriter localStringWriter = new StringWriter();
            localLogRecord.getThrown().printStackTrace(new PrintWriter(localStringWriter));
            paramAppendable.append(localStringWriter.toString()).append('\n');
          }
        }
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.openide.explorer.UIException
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.explorer;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.openide.nodes.Node;
import org.openide.util.Lookup.Item;
import org.openide.util.Lookup.Result;
import org.openide.util.LookupEvent;
import org.openide.util.LookupListener;

final class DefaultEMLookup$NoNodeLookup$ExclusionResult<T>
  extends Lookup.Result<T>
  implements LookupListener
{
  private final Lookup.Result<T> delegate;
  private final Map<Node, Object> verboten;
  private final List<LookupListener> listeners = new ArrayList();
  
  public DefaultEMLookup$NoNodeLookup$ExclusionResult(Lookup.Result<T> paramResult, Map<Node, Object> paramMap)
  {
    delegate = paramResult;
    verboten = paramMap;
  }
  
  public Collection<? extends T> allInstances()
  {
    Collection localCollection = delegate.allInstances();
    ArrayList localArrayList = new ArrayList(localCollection.size());
    for (Object localObject : localCollection) {
      if (!verboten.containsKey(localObject)) {
        localArrayList.add(localObject);
      }
    }
    return localArrayList;
  }
  
  public Set<Class<? extends T>> allClasses()
  {
    return delegate.allClasses();
  }
  
  public Collection<? extends Lookup.Item<T>> allItems()
  {
    Collection localCollection = delegate.allItems();
    ArrayList localArrayList = new ArrayList(localCollection.size());
    for (Lookup.Item localItem : localCollection) {
      if (!verboten.containsKey(localItem.getInstance())) {
        localArrayList.add(localItem);
      }
    }
    return localArrayList;
  }
  
  public void addLookupListener(LookupListener paramLookupListener)
  {
    synchronized (listeners)
    {
      if (listeners.isEmpty()) {
        delegate.addLookupListener(this);
      }
      listeners.add(paramLookupListener);
    }
  }
  
  public void removeLookupListener(LookupListener paramLookupListener)
  {
    synchronized (listeners)
    {
      listeners.remove(paramLookupListener);
      if (listeners.isEmpty()) {
        delegate.removeLookupListener(this);
      }
    }
  }
  
  public void resultChanged(LookupEvent paramLookupEvent)
  {
    LookupEvent localLookupEvent = new LookupEvent(this);
    LookupListener[] arrayOfLookupListener;
    synchronized (listeners)
    {
      arrayOfLookupListener = (LookupListener[])listeners.toArray(new LookupListener[listeners.size()]);
    }
    for (int i = 0; i < arrayOfLookupListener.length; i++) {
      arrayOfLookupListener[i].resultChanged(localLookupEvent);
    }
  }
}

/* Location:
 * Qualified Name:     org.openide.explorer.DefaultEMLookup.NoNodeLookup.ExclusionResult
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.explorer;

import java.util.ArrayList;
import java.util.Collection;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.openide.nodes.Node;
import org.openide.util.Lookup;
import org.openide.util.Lookup.Item;
import org.openide.util.Lookup.Result;
import org.openide.util.Lookup.Template;
import org.openide.util.LookupEvent;
import org.openide.util.LookupListener;

final class DefaultEMLookup$NoNodeLookup
  extends Lookup
{
  private final Lookup delegate;
  private final Map<Node, Object> verboten;
  
  public DefaultEMLookup$NoNodeLookup(Lookup paramLookup, Node[] paramArrayOfNode)
  {
    delegate = paramLookup;
    verboten = new IdentityHashMap();
    for (int i = 0; i < paramArrayOfNode.length; verboten.put(paramArrayOfNode[(i++)], DefaultEMLookup.access$000())) {}
  }
  
  public <T> T lookup(Class<T> paramClass)
  {
    if (paramClass == Node.class) {
      return null;
    }
    Object localObject1 = delegate.lookup(paramClass);
    if (verboten.containsKey(localObject1))
    {
      Iterator localIterator = lookup(new Lookup.Template(paramClass)).allInstances().iterator();
      while (localIterator.hasNext())
      {
        Object localObject2 = localIterator.next();
        if (!verboten.containsKey(localObject2)) {
          return (T)localObject2;
        }
      }
      return null;
    }
    return (T)localObject1;
  }
  
  public <T> Lookup.Result<T> lookup(Lookup.Template<T> paramTemplate)
  {
    Class localClass = paramTemplate.getType();
    if (localClass == Node.class) {
      return Lookup.EMPTY.lookup(new Lookup.Template(localClass));
    }
    return new ExclusionResult(delegate.lookup(paramTemplate), verboten);
  }
  
  private static final class ExclusionResult<T>
    extends Lookup.Result<T>
    implements LookupListener
  {
    private final Lookup.Result<T> delegate;
    private final Map<Node, Object> verboten;
    private final List<LookupListener> listeners = new ArrayList();
    
    public ExclusionResult(Lookup.Result<T> paramResult, Map<Node, Object> paramMap)
    {
      delegate = paramResult;
      verboten = paramMap;
    }
    
    public Collection<? extends T> allInstances()
    {
      Collection localCollection = delegate.allInstances();
      ArrayList localArrayList = new ArrayList(localCollection.size());
      for (Object localObject : localCollection) {
        if (!verboten.containsKey(localObject)) {
          localArrayList.add(localObject);
        }
      }
      return localArrayList;
    }
    
    public Set<Class<? extends T>> allClasses()
    {
      return delegate.allClasses();
    }
    
    public Collection<? extends Lookup.Item<T>> allItems()
    {
      Collection localCollection = delegate.allItems();
      ArrayList localArrayList = new ArrayList(localCollection.size());
      for (Lookup.Item localItem : localCollection) {
        if (!verboten.containsKey(localItem.getInstance())) {
          localArrayList.add(localItem);
        }
      }
      return localArrayList;
    }
    
    public void addLookupListener(LookupListener paramLookupListener)
    {
      synchronized (listeners)
      {
        if (listeners.isEmpty()) {
          delegate.addLookupListener(this);
        }
        listeners.add(paramLookupListener);
      }
    }
    
    public void removeLookupListener(LookupListener paramLookupListener)
    {
      synchronized (listeners)
      {
        listeners.remove(paramLookupListener);
        if (listeners.isEmpty()) {
          delegate.removeLookupListener(this);
        }
      }
    }
    
    public void resultChanged(LookupEvent paramLookupEvent)
    {
      LookupEvent localLookupEvent = new LookupEvent(this);
      LookupListener[] arrayOfLookupListener;
      synchronized (listeners)
      {
        arrayOfLookupListener = (LookupListener[])listeners.toArray(new LookupListener[listeners.size()]);
      }
      for (int i = 0; i < arrayOfLookupListener.length; i++) {
        arrayOfLookupListener[i].resultChanged(localLookupEvent);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.openide.explorer.DefaultEMLookup.NoNodeLookup
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.explorer;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
import javax.swing.ActionMap;
import org.openide.nodes.Node;
import org.openide.util.Lookup;
import org.openide.util.Lookup.Item;
import org.openide.util.Lookup.Result;
import org.openide.util.Lookup.Template;
import org.openide.util.LookupEvent;
import org.openide.util.LookupListener;
import org.openide.util.WeakListeners;
import org.openide.util.lookup.Lookups;
import org.openide.util.lookup.ProxyLookup;

final class DefaultEMLookup
  extends ProxyLookup
  implements LookupListener, PropertyChangeListener
{
  private static final Object PRESENT = new Object();
  private ExplorerManager tc;
  private LookupListener listener;
  private Map<Lookup, Lookup.Result> attachedTo;
  private Lookup actionMap;
  
  public DefaultEMLookup(ExplorerManager paramExplorerManager, ActionMap paramActionMap)
  {
    tc = paramExplorerManager;
    listener = ((LookupListener)WeakListeners.create(LookupListener.class, this, null));
    actionMap = Lookups.singleton(paramActionMap);
    
    paramExplorerManager.addPropertyChangeListener(WeakListeners.propertyChange(this, paramExplorerManager));
    
    updateLookups(paramExplorerManager.getSelectedNodes());
  }
  
  public void updateLookups(Node[] paramArrayOfNode)
  {
    if (paramArrayOfNode == null) {
      paramArrayOfNode = new Node[0];
    }
    Lookup[] arrayOfLookup = new Lookup[paramArrayOfNode.length];
    Object localObject1;
    synchronized (this)
    {
      if (attachedTo == null) {
        localObject1 = Collections.emptyMap();
      } else {
        localObject1 = new HashMap(attachedTo);
      }
    }
    for (??? = 0; ??? < paramArrayOfNode.length; ???++)
    {
      arrayOfLookup[???] = paramArrayOfNode[???].getLookup();
      if (localObject1 != null) {
        ((Map)localObject1).remove(paramArrayOfNode[???]);
      }
    }
    for (??? = ((Map)localObject1).values().iterator(); ((Iterator)???).hasNext();)
    {
      Lookup.Result localResult = (Lookup.Result)((Iterator)???).next();
      localResult.removeLookupListener(listener);
    }
    synchronized (this)
    {
      attachedTo = null;
    }
    setLookups(new Lookup[] { new NoNodeLookup(new ProxyLookup(arrayOfLookup), paramArrayOfNode), Lookups.fixed((Object[])paramArrayOfNode), actionMap });
  }
  
  public void resultChanged(LookupEvent paramLookupEvent)
  {
    updateLookups(tc.getSelectedNodes());
  }
  
  private static boolean isNodeQuery(Class<?> paramClass)
  {
    return (Node.class.isAssignableFrom(paramClass)) || (paramClass.isAssignableFrom(Node.class));
  }
  
  protected synchronized void beforeLookup(Lookup.Template<?> paramTemplate)
  {
    if ((attachedTo == null) && (isNodeQuery(paramTemplate.getType())))
    {
      Lookup[] arrayOfLookup = getLookups();
      
      attachedTo = new WeakHashMap(arrayOfLookup.length * 2);
      for (int i = 0; i < arrayOfLookup.length - 2; i++)
      {
        Lookup.Result localResult = arrayOfLookup[i].lookup(paramTemplate);
        localResult.addLookupListener(listener);
        attachedTo.put(arrayOfLookup[i], localResult);
      }
    }
  }
  
  public void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
  {
    if ("selectedNodes" == paramPropertyChangeEvent.getPropertyName()) {
      updateLookups((Node[])paramPropertyChangeEvent.getNewValue());
    }
  }
  
  private static final class NoNodeLookup
    extends Lookup
  {
    private final Lookup delegate;
    private final Map<Node, Object> verboten;
    
    public NoNodeLookup(Lookup paramLookup, Node[] paramArrayOfNode)
    {
      delegate = paramLookup;
      verboten = new IdentityHashMap();
      for (int i = 0; i < paramArrayOfNode.length; verboten.put(paramArrayOfNode[(i++)], DefaultEMLookup.PRESENT)) {}
    }
    
    public <T> T lookup(Class<T> paramClass)
    {
      if (paramClass == Node.class) {
        return null;
      }
      Object localObject1 = delegate.lookup(paramClass);
      if (verboten.containsKey(localObject1))
      {
        Iterator localIterator = lookup(new Lookup.Template(paramClass)).allInstances().iterator();
        while (localIterator.hasNext())
        {
          Object localObject2 = localIterator.next();
          if (!verboten.containsKey(localObject2)) {
            return (T)localObject2;
          }
        }
        return null;
      }
      return (T)localObject1;
    }
    
    public <T> Lookup.Result<T> lookup(Lookup.Template<T> paramTemplate)
    {
      Class localClass = paramTemplate.getType();
      if (localClass == Node.class) {
        return Lookup.EMPTY.lookup(new Lookup.Template(localClass));
      }
      return new ExclusionResult(delegate.lookup(paramTemplate), verboten);
    }
    
    private static final class ExclusionResult<T>
      extends Lookup.Result<T>
      implements LookupListener
    {
      private final Lookup.Result<T> delegate;
      private final Map<Node, Object> verboten;
      private final List<LookupListener> listeners = new ArrayList();
      
      public ExclusionResult(Lookup.Result<T> paramResult, Map<Node, Object> paramMap)
      {
        delegate = paramResult;
        verboten = paramMap;
      }
      
      public Collection<? extends T> allInstances()
      {
        Collection localCollection = delegate.allInstances();
        ArrayList localArrayList = new ArrayList(localCollection.size());
        for (Object localObject : localCollection) {
          if (!verboten.containsKey(localObject)) {
            localArrayList.add(localObject);
          }
        }
        return localArrayList;
      }
      
      public Set<Class<? extends T>> allClasses()
      {
        return delegate.allClasses();
      }
      
      public Collection<? extends Lookup.Item<T>> allItems()
      {
        Collection localCollection = delegate.allItems();
        ArrayList localArrayList = new ArrayList(localCollection.size());
        for (Lookup.Item localItem : localCollection) {
          if (!verboten.containsKey(localItem.getInstance())) {
            localArrayList.add(localItem);
          }
        }
        return localArrayList;
      }
      
      public void addLookupListener(LookupListener paramLookupListener)
      {
        synchronized (listeners)
        {
          if (listeners.isEmpty()) {
            delegate.addLookupListener(this);
          }
          listeners.add(paramLookupListener);
        }
      }
      
      public void removeLookupListener(LookupListener paramLookupListener)
      {
        synchronized (listeners)
        {
          listeners.remove(paramLookupListener);
          if (listeners.isEmpty()) {
            delegate.removeLookupListener(this);
          }
        }
      }
      
      public void resultChanged(LookupEvent paramLookupEvent)
      {
        LookupEvent localLookupEvent = new LookupEvent(this);
        LookupListener[] arrayOfLookupListener;
        synchronized (listeners)
        {
          arrayOfLookupListener = (LookupListener[])listeners.toArray(new LookupListener[listeners.size()]);
        }
        for (int i = 0; i < arrayOfLookupListener.length; i++) {
          arrayOfLookupListener[i].resultChanged(localLookupEvent);
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.openide.explorer.DefaultEMLookup
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.explorer;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.Timer;
import org.openide.util.Mutex;
import org.openide.util.WeakListeners;
import org.openide.util.datatransfer.ClipboardEvent;
import org.openide.util.datatransfer.ClipboardListener;

class ExplorerActionsImpl$ActionStateUpdater
  implements PropertyChangeListener, ClipboardListener, ActionListener, Runnable
{
  private final Timer timer;
  private final PropertyChangeListener weakL;
  
  ExplorerActionsImpl$ActionStateUpdater(ExplorerActionsImpl paramExplorerActionsImpl, ExplorerManager paramExplorerManager)
  {
    timer = new Timer(200, this);
    timer.setCoalesce(true);
    timer.setRepeats(false);
    weakL = WeakListeners.propertyChange(this, paramExplorerManager);
    paramExplorerManager.addPropertyChangeListener(weakL);
  }
  
  void unlisten(ExplorerManager paramExplorerManager)
  {
    paramExplorerManager.removePropertyChangeListener(weakL);
  }
  
  boolean updateScheduled()
  {
    return timer.isRunning();
  }
  
  public synchronized void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
  {
    timer.restart();
  }
  
  public void clipboardChanged(ClipboardEvent paramClipboardEvent)
  {
    if (!paramClipboardEvent.isConsumed()) {
      Mutex.EVENT.readAccess(this);
    }
  }
  
  public void run()
  {
    ExplorerManager localExplorerManager = ExplorerActionsImpl.access$300(this$0);
    if (localExplorerManager != null) {
      ExplorerActionsImpl.access$500(this$0, localExplorerManager.getSelectedNodes());
    }
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    ExplorerActionsImpl.access$200(this$0, true);
  }
  
  public void update()
  {
    if (timer.isRunning())
    {
      timer.stop();
      ExplorerActionsImpl.access$200(this$0, true);
    }
  }
}

/* Location:
 * Qualified Name:     org.openide.explorer.ExplorerActionsImpl.ActionStateUpdater
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openide.explorer;

import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.AbstractAction;
import org.netbeans.modules.openide.explorer.ExternalDragAndDrop;
import org.openide.nodes.Node;
import org.openide.util.datatransfer.ExTransferable.Multi;

class ExplorerActionsImpl$CopyCutActionPerformer
  extends AbstractAction
{
  private boolean copyCut;
  
  public ExplorerActionsImpl$CopyCutActionPerformer(ExplorerActionsImpl paramExplorerActionsImpl, boolean paramBoolean)
  {
    copyCut = paramBoolean;
  }
  
  public boolean isEnabled()
  {
    if
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd