org-netbeans-core-multiview

16:39:33.217 INFO  jd.cli.Main - Decompiling org-netbeans-core-multiview.jar
package org.netbeans.core.api.multiview;

import org.netbeans.core.multiview.Accessor;
import org.netbeans.core.multiview.MultiViewHandlerDelegate;
import org.netbeans.core.spi.multiview.MultiViewDescription;

class AccessorImpl
  extends Accessor
{
  static void createAccesor()
  {
    if (DEFAULT == null) {
      DEFAULT = new AccessorImpl();
    }
  }
  
  public MultiViewPerspective createPerspective(MultiViewDescription paramMultiViewDescription)
  {
    return new MultiViewPerspective(paramMultiViewDescription);
  }
  
  public MultiViewHandler createHandler(MultiViewHandlerDelegate paramMultiViewHandlerDelegate)
  {
    return new MultiViewHandler(paramMultiViewHandlerDelegate);
  }
  
  public MultiViewDescription extractDescription(MultiViewPerspective paramMultiViewPerspective)
  {
    return paramMultiViewPerspective.getDescription();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.api.multiview.AccessorImpl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.api.multiview;

import org.netbeans.core.multiview.MultiViewHandlerDelegate;

public final class MultiViewHandler
{
  private MultiViewHandlerDelegate del;
  
  MultiViewHandler(MultiViewHandlerDelegate paramMultiViewHandlerDelegate)
  {
    del = paramMultiViewHandlerDelegate;
  }
  
  public MultiViewPerspective[] getPerspectives()
  {
    return del.getDescriptions();
  }
  
  public MultiViewPerspective getSelectedPerspective()
  {
    return del.getSelectedDescription();
  }
  
  public void requestActive(MultiViewPerspective paramMultiViewPerspective)
  {
    del.requestActive(paramMultiViewPerspective);
  }
  
  public void requestVisible(MultiViewPerspective paramMultiViewPerspective)
  {
    del.requestVisible(paramMultiViewPerspective);
  }
  
  static {}
}

/* Location:
 * Qualified Name:     org.netbeans.core.api.multiview.MultiViewHandler
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.api.multiview;

import java.awt.Image;
import org.netbeans.core.spi.multiview.MultiViewDescription;
import org.openide.util.HelpCtx;

public final class MultiViewPerspective
{
  private MultiViewDescription description;
  
  MultiViewPerspective(MultiViewDescription paramMultiViewDescription)
  {
    description = paramMultiViewDescription;
  }
  
  MultiViewDescription getDescription()
  {
    return description;
  }
  
  public int getPersistenceType()
  {
    return description.getPersistenceType();
  }
  
  public String getDisplayName()
  {
    return description.getDisplayName();
  }
  
  public Image getIcon()
  {
    return description.getIcon();
  }
  
  public HelpCtx getHelpCtx()
  {
    return description.getHelpCtx();
  }
  
  public String preferredID()
  {
    return description.preferredID();
  }
  
  static {}
}

/* Location:
 * Qualified Name:     org.netbeans.core.api.multiview.MultiViewPerspective
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.api.multiview;

import javax.swing.Action;
import javax.swing.JComponent;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.openide.util.Lookup;

final class MultiViewPerspectiveComponent
{
  private MultiViewElement element;
  
  MultiViewPerspectiveComponent(MultiViewElement paramMultiViewElement)
  {
    element = paramMultiViewElement;
  }
  
  MultiViewElement getElement()
  {
    return element;
  }
  
  public JComponent getVisualRepresentation()
  {
    return element.getVisualRepresentation();
  }
  
  public JComponent getToolbarRepresentation()
  {
    return element.getToolbarRepresentation();
  }
  
  public Action[] getActions()
  {
    return element.getActions();
  }
  
  public Lookup getLookup()
  {
    return element.getLookup();
  }
  
  static {}
}

/* Location:
 * Qualified Name:     org.netbeans.core.api.multiview.MultiViewPerspectiveComponent
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.api.multiview;

import org.netbeans.core.multiview.MultiViewCloneableTopComponent;
import org.netbeans.core.multiview.MultiViewTopComponent;
import org.openide.windows.TopComponent;

public final class MultiViews
{
  public static MultiViewHandler findMultiViewHandler(TopComponent paramTopComponent)
  {
    if (paramTopComponent != null)
    {
      if ((paramTopComponent instanceof MultiViewTopComponent)) {
        return new MultiViewHandler(((MultiViewTopComponent)paramTopComponent).getMultiViewHandlerDelegate());
      }
      if ((paramTopComponent instanceof MultiViewCloneableTopComponent)) {
        return new MultiViewHandler(((MultiViewCloneableTopComponent)paramTopComponent).getMultiViewHandlerDelegate());
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.api.multiview.MultiViews
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import org.netbeans.core.api.multiview.MultiViewHandler;
import org.netbeans.core.api.multiview.MultiViewPerspective;
import org.netbeans.core.spi.multiview.MultiViewDescription;

public abstract class Accessor
{
  protected static Accessor DEFAULT = null;
  
  public abstract MultiViewPerspective createPerspective(MultiViewDescription paramMultiViewDescription);
  
  public abstract MultiViewHandler createHandler(MultiViewHandlerDelegate paramMultiViewHandlerDelegate);
  
  public abstract MultiViewDescription extractDescription(MultiViewPerspective paramMultiViewPerspective);
  
  static
  {
    Class localClass = MultiViewPerspective.class;
    try
    {
      Class.forName(localClass.getName(), true, localClass.getClassLoader());
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.Accessor
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

class EditorsAction$1 {}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.EditorsAction.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.netbeans.core.api.multiview.MultiViewHandler;
import org.netbeans.core.api.multiview.MultiViewPerspective;
import org.netbeans.core.api.multiview.MultiViews;
import org.openide.windows.TopComponent;

class EditorsAction$UpdatingMenu$1
  implements ActionListener
{
  EditorsAction$UpdatingMenu$1(EditorsAction.UpdatingMenu paramUpdatingMenu, TopComponent paramTopComponent, String[] paramArrayOfString) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    MultiViewHandler localMultiViewHandler = MultiViews.findMultiViewHandler(val$tc);
    if (localMultiViewHandler == null) {
      return;
    }
    MultiViewPerspective localMultiViewPerspective = null;
    MultiViewPerspective[] arrayOfMultiViewPerspective = localMultiViewHandler.getPerspectives();
    assert (arrayOfMultiViewPerspective.length == val$names.length) : "Arrays must have the same length";
    for (int i = 0; i < arrayOfMultiViewPerspective.length; i++) {
      if (paramActionEvent.getActionCommand().equals(val$names[i]))
      {
        localMultiViewPerspective = arrayOfMultiViewPerspective[i];
        break;
      }
    }
    if (localMultiViewPerspective != null) {
      localMultiViewHandler.requestActive(localMultiViewPerspective);
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.EditorsAction.UpdatingMenu.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.SwingUtilities;
import org.netbeans.core.api.multiview.MultiViewHandler;
import org.netbeans.core.api.multiview.MultiViewPerspective;
import org.netbeans.core.api.multiview.MultiViews;
import org.openide.awt.DynamicMenuContent;
import org.openide.awt.Mnemonics;
import org.openide.windows.TopComponent;
import org.openide.windows.TopComponent.Registry;
import org.openide.windows.WindowManager;

final class EditorsAction$UpdatingMenu
  extends JMenu
  implements DynamicMenuContent
{
  public JComponent[] synchMenuPresenters(JComponent[] paramArrayOfJComponent)
  {
    return getMenuPresenters();
  }
  
  public JComponent[] getMenuPresenters()
  {
    assert (SwingUtilities.isEventDispatchThread()) : "Must be called from AWT";
    removeAll();
    final TopComponent localTopComponent = WindowManager.getDefault().getRegistry().getActivated();
    if (localTopComponent != null)
    {
      setEnabled(true);
      MultiViewHandler localMultiViewHandler = MultiViews.findMultiViewHandler(localTopComponent);
      if (localMultiViewHandler != null)
      {
        ButtonGroup localButtonGroup = new ButtonGroup();
        MultiViewPerspective[] arrayOfMultiViewPerspective = localMultiViewHandler.getPerspectives();
        final String[] arrayOfString = new String[arrayOfMultiViewPerspective.length];
        for (int i = 0; i < arrayOfMultiViewPerspective.length; i++)
        {
          MultiViewPerspective localMultiViewPerspective = arrayOfMultiViewPerspective[i];
          
          JRadioButtonMenuItem localJRadioButtonMenuItem = new JRadioButtonMenuItem();
          arrayOfString[i] = localMultiViewPerspective.getDisplayName();
          Mnemonics.setLocalizedText(localJRadioButtonMenuItem, localMultiViewPerspective.getDisplayName());
          localJRadioButtonMenuItem.setActionCommand(localMultiViewPerspective.getDisplayName());
          localJRadioButtonMenuItem.addActionListener(new ActionListener()
          {
            public void actionPerformed(ActionEvent paramAnonymousActionEvent)
            {
              MultiViewHandler localMultiViewHandler = MultiViews.findMultiViewHandler(localTopComponent);
              if (localMultiViewHandler == null) {
                return;
              }
              MultiViewPerspective localMultiViewPerspective = null;
              MultiViewPerspective[] arrayOfMultiViewPerspective = localMultiViewHandler.getPerspectives();
              assert (arrayOfMultiViewPerspective.length == arrayOfString.length) : "Arrays must have the same length";
              for (int i = 0; i < arrayOfMultiViewPerspective.length; i++) {
                if (paramAnonymousActionEvent.getActionCommand().equals(arrayOfString[i]))
                {
                  localMultiViewPerspective = arrayOfMultiViewPerspective[i];
                  break;
                }
              }
              if (localMultiViewPerspective != null) {
                localMultiViewHandler.requestActive(localMultiViewPerspective);
              }
            }
          });
          if (localMultiViewPerspective.getDisplayName().equals(localMultiViewHandler.getSelectedPerspective().getDisplayName())) {
            localJRadioButtonMenuItem.setSelected(true);
          }
          localButtonGroup.add(localJRadioButtonMenuItem);
          add(localJRadioButtonMenuItem);
        }
      }
      else
      {
        setEnabled(false);
      }
    }
    else
    {
      setEnabled(false);
    }
    return new JComponent[] { this };
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.EditorsAction.UpdatingMenu
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractAction;
import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.SwingUtilities;
import org.netbeans.core.api.multiview.MultiViewHandler;
import org.netbeans.core.api.multiview.MultiViewPerspective;
import org.netbeans.core.api.multiview.MultiViews;
import org.openide.awt.DynamicMenuContent;
import org.openide.awt.Mnemonics;
import org.openide.util.NbBundle;
import org.openide.util.actions.Presenter.Menu;
import org.openide.windows.TopComponent;
import org.openide.windows.TopComponent.Registry;
import org.openide.windows.WindowManager;

public class EditorsAction
  extends AbstractAction
  implements Presenter.Menu
{
  public EditorsAction()
  {
    super(NbBundle.getMessage(EditorsAction.class, "CTL_EditorsAction"));
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    if (!$assertionsDisabled) {
      throw new AssertionError();
    }
  }
  
  public JMenuItem getMenuPresenter()
  {
    UpdatingMenu localUpdatingMenu = new UpdatingMenu(null);
    String str = NbBundle.getMessage(EditorsAction.class, "CTL_EditorsAction");
    Mnemonics.setLocalizedText(localUpdatingMenu, str);
    return localUpdatingMenu;
  }
  
  private static final class UpdatingMenu
    extends JMenu
    implements DynamicMenuContent
  {
    public JComponent[] synchMenuPresenters(JComponent[] paramArrayOfJComponent)
    {
      return getMenuPresenters();
    }
    
    public JComponent[] getMenuPresenters()
    {
      assert (SwingUtilities.isEventDispatchThread()) : "Must be called from AWT";
      removeAll();
      final TopComponent localTopComponent = WindowManager.getDefault().getRegistry().getActivated();
      if (localTopComponent != null)
      {
        setEnabled(true);
        MultiViewHandler localMultiViewHandler = MultiViews.findMultiViewHandler(localTopComponent);
        if (localMultiViewHandler != null)
        {
          ButtonGroup localButtonGroup = new ButtonGroup();
          MultiViewPerspective[] arrayOfMultiViewPerspective = localMultiViewHandler.getPerspectives();
          final String[] arrayOfString = new String[arrayOfMultiViewPerspective.length];
          for (int i = 0; i < arrayOfMultiViewPerspective.length; i++)
          {
            MultiViewPerspective localMultiViewPerspective = arrayOfMultiViewPerspective[i];
            
            JRadioButtonMenuItem localJRadioButtonMenuItem = new JRadioButtonMenuItem();
            arrayOfString[i] = localMultiViewPerspective.getDisplayName();
            Mnemonics.setLocalizedText(localJRadioButtonMenuItem, localMultiViewPerspective.getDisplayName());
            localJRadioButtonMenuItem.setActionCommand(localMultiViewPerspective.getDisplayName());
            localJRadioButtonMenuItem.addActionListener(new ActionListener()
            {
              public void actionPerformed(ActionEvent paramAnonymousActionEvent)
              {
                MultiViewHandler localMultiViewHandler = MultiViews.findMultiViewHandler(localTopComponent);
                if (localMultiViewHandler == null) {
                  return;
                }
                MultiViewPerspective localMultiViewPerspective = null;
                MultiViewPerspective[] arrayOfMultiViewPerspective = localMultiViewHandler.getPerspectives();
                assert (arrayOfMultiViewPerspective.length == arrayOfString.length) : "Arrays must have the same length";
                for (int i = 0; i < arrayOfMultiViewPerspective.length; i++) {
                  if (paramAnonymousActionEvent.getActionCommand().equals(arrayOfString[i]))
                  {
                    localMultiViewPerspective = arrayOfMultiViewPerspective[i];
                    break;
                  }
                }
                if (localMultiViewPerspective != null) {
                  localMultiViewHandler.requestActive(localMultiViewPerspective);
                }
              }
            });
            if (localMultiViewPerspective.getDisplayName().equals(localMultiViewHandler.getSelectedPerspective().getDisplayName())) {
              localJRadioButtonMenuItem.setSelected(true);
            }
            localButtonGroup.add(localJRadioButtonMenuItem);
            add(localJRadioButtonMenuItem);
          }
        }
        else
        {
          setEnabled(false);
        }
      }
      else
      {
        setEnabled(false);
      }
      return new JComponent[] { this };
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.EditorsAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import org.netbeans.core.api.multiview.MultiViewHandler;
import org.netbeans.core.api.multiview.MultiViewPerspective;
import org.netbeans.core.api.multiview.MultiViews;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent.Registry;
import org.openide.windows.WindowManager;

public class GetLeftEditorAction
  extends AbstractAction
{
  public GetLeftEditorAction()
  {
    putValue("Name", NbBundle.getMessage(GetLeftEditorAction.class, "GetLeftEditorAction.name"));
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    WindowManager localWindowManager = WindowManager.getDefault();
    MultiViewHandler localMultiViewHandler = MultiViews.findMultiViewHandler(localWindowManager.getRegistry().getActivated());
    if (localMultiViewHandler != null)
    {
      MultiViewPerspective localMultiViewPerspective = localMultiViewHandler.getSelectedPerspective();
      MultiViewPerspective[] arrayOfMultiViewPerspective = localMultiViewHandler.getPerspectives();
      for (int i = 0; i < arrayOfMultiViewPerspective.length; i++) {
        if (localMultiViewPerspective.getDisplayName().equals(arrayOfMultiViewPerspective[i].getDisplayName()))
        {
          int j = i != 0 ? i - 1 : arrayOfMultiViewPerspective.length - 1;
          localMultiViewHandler.requestActive(arrayOfMultiViewPerspective[j]);
        }
      }
    }
    else
    {
      Toolkit.getDefaultToolkit().beep();
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.GetLeftEditorAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import org.netbeans.core.api.multiview.MultiViewHandler;
import org.netbeans.core.api.multiview.MultiViewPerspective;
import org.netbeans.core.api.multiview.MultiViews;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent.Registry;
import org.openide.windows.WindowManager;

public class GetRightEditorAction
  extends AbstractAction
{
  public GetRightEditorAction()
  {
    putValue("Name", NbBundle.getMessage(GetRightEditorAction.class, "GetRightEditorAction.name"));
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    WindowManager localWindowManager = WindowManager.getDefault();
    MultiViewHandler localMultiViewHandler = MultiViews.findMultiViewHandler(localWindowManager.getRegistry().getActivated());
    if (localMultiViewHandler != null)
    {
      MultiViewPerspective localMultiViewPerspective = localMultiViewHandler.getSelectedPerspective();
      MultiViewPerspective[] arrayOfMultiViewPerspective = localMultiViewHandler.getPerspectives();
      for (int i = 0; i < arrayOfMultiViewPerspective.length; i++) {
        if (localMultiViewPerspective.equals(arrayOfMultiViewPerspective[i]))
        {
          int j = i != arrayOfMultiViewPerspective.length - 1 ? i + 1 : 0;
          localMultiViewHandler.requestActive(arrayOfMultiViewPerspective[j]);
        }
      }
    }
    else
    {
      Toolkit.getDefaultToolkit().beep();
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.GetRightEditorAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import java.awt.Component;
import java.awt.KeyboardFocusManager;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.JComponent;
import org.openide.windows.TopComponent;

final class MultiViewActionMap
  extends ActionMap
{
  private ActionMap delegate;
  private ActionMap topComponentMap;
  private TopComponent component;
  private boolean preventRecursive = false;
  private Object LOCK = new Object();
  
  public MultiViewActionMap(TopComponent paramTopComponent, ActionMap paramActionMap)
  {
    topComponentMap = paramActionMap;
    component = paramTopComponent;
  }
  
  public void setDelegateMap(ActionMap paramActionMap)
  {
    delegate = paramActionMap;
  }
  
  public int size()
  {
    return keys().length;
  }
  
  public Action get(Object paramObject)
  {
    ActionMap localActionMap = topComponentMap;
    if (localActionMap != null)
    {
      Action localAction1 = localActionMap.get(paramObject);
      if (localAction1 != null) {
        return localAction1;
      }
    }
    localActionMap = delegate;
    if (localActionMap != null) {
      synchronized (LOCK)
      {
        if (preventRecursive)
        {
          preventRecursive = false;
          return null;
        }
        preventRecursive = true;
        localAction2 = localActionMap.get(paramObject);
        preventRecursive = false;
        if (localAction2 != null) {
          return localAction2;
        }
      }
    }
    ??? = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    Action localAction2 = null;
    while ((??? != null) && (??? != component))
    {
      if ((localAction2 == null) && ((??? instanceof JComponent)))
      {
        localActionMap = ((JComponent)???).getActionMap();
        if (localActionMap != null) {
          localAction2 = localActionMap.get(paramObject);
        }
      }
      ??? = ((Component)???).getParent();
    }
    return ??? == component ? localAction2 : null;
  }
  
  public Object[] allKeys()
  {
    return keys(true);
  }
  
  public Object[] keys()
  {
    return keys(false);
  }
  
  private Object[] keys(boolean paramBoolean)
  {
    HashSet localHashSet = new HashSet();
    Object localObject;
    if (delegate != null)
    {
      if (paramBoolean) {
        localObject = delegate.allKeys();
      } else {
        localObject = delegate.keys();
      }
      if (null != localObject) {
        localHashSet.addAll(Arrays.asList((Object[])localObject));
      }
    }
    if (topComponentMap != null)
    {
      if (paramBoolean) {
        localObject = Arrays.asList(topComponentMap.allKeys());
      } else {
        localObject = Arrays.asList(topComponentMap.keys());
      }
      localHashSet.addAll((Collection)localObject);
    }
    return localHashSet.toArray();
  }
  
  public void remove(Object paramObject)
  {
    topComponentMap.remove(paramObject);
  }
  
  public void setParent(ActionMap paramActionMap)
  {
    topComponentMap.setParent(paramActionMap);
  }
  
  public void clear()
  {
    topComponentMap.clear();
  }
  
  public void put(Object paramObject, Action paramAction)
  {
    topComponentMap.put(paramObject, paramAction);
  }
  
  public ActionMap getParent()
  {
    return topComponentMap.getParent();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewActionMap
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

class MultiViewCloneableTopComponent$1
  implements Runnable
{
  MultiViewCloneableTopComponent$1(MultiViewCloneableTopComponent paramMultiViewCloneableTopComponent) {}
  
  public void run()
  {
    this$0.peer.updateName();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewCloneableTopComponent.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import java.io.ObjectStreamException;
import java.io.Serializable;
import javax.swing.Action;
import org.netbeans.core.spi.multiview.MultiViewDescription;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.openide.windows.TopComponent;

class MultiViewCloneableTopComponent$ActReqObserver
  implements Serializable, MultiViewElementCallbackDelegate
{
  private static final long serialVersionUID = -3126744916624172415L;
  private MultiViewDescription description;
  
  MultiViewCloneableTopComponent$ActReqObserver(MultiViewCloneableTopComponent paramMultiViewCloneableTopComponent, MultiViewDescription paramMultiViewDescription)
  {
    description = paramMultiViewDescription;
  }
  
  public void requestActive()
  {
    boolean bool = this$0.peer.isActivated();
    if (!bool) {
      this$0.requestActive();
    }
    if (this$0.peer.model.getActiveDescription() != description)
    {
      if (bool) {
        this$0.peer.model.getActiveElement().componentDeactivated();
      }
      this$0.peer.tabs.changeActiveManually(description);
      if (bool) {
        this$0.peer.model.getActiveElement().componentActivated();
      }
    }
  }
  
  public void requestVisible()
  {
    this$0.peer.tabs.changeVisibleManually(description);
  }
  
  public Action[] createDefaultActions()
  {
    return this$0.getDefaultTCActions();
  }
  
  public void updateTitle(String paramString)
  {
    this$0.setDisplayName(paramString);
  }
  
  public Object writeReplace()
    throws ObjectStreamException
  {
    return null;
  }
  
  public Object readResolve()
    throws ObjectStreamException
  {
    return null;
  }
  
  public boolean isSelectedElement()
  {
    return description.equals(this$0.peer.model.getActiveDescription());
  }
  
  public TopComponent getTopComponent()
  {
    return this$0;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewCloneableTopComponent.ActReqObserver
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.logging.Logger;
import javax.swing.Action;
import javax.swing.JEditorPane;
import javax.swing.SwingUtilities;
import org.netbeans.core.spi.multiview.CloseOperationHandler;
import org.netbeans.core.spi.multiview.MultiViewDescription;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.MultiViewElementCallback;
import org.netbeans.core.spi.multiview.SourceViewMarker;
import org.openide.awt.UndoRedo;
import org.openide.text.CloneableEditorSupport.Pane;
import org.openide.util.HelpCtx;
import org.openide.windows.CloneableTopComponent;
import org.openide.windows.TopComponent;

public final class MultiViewCloneableTopComponent
  extends CloneableTopComponent
  implements MultiViewModel.ActionRequestObserverFactory, CloneableEditorSupport.Pane
{
  MultiViewPeer peer;
  
  public MultiViewCloneableTopComponent()
  {
    peer = new MultiViewPeer(this, this);
    
    peer.initComponents();
    setFocusCycleRoot(false);
    setName("");
    
    associateLookup(peer.getLookup());
  }
  
  public void setMultiViewDescriptions(MultiViewDescription[] paramArrayOfMultiViewDescription, MultiViewDescription paramMultiViewDescription)
  {
    peer.setMultiViewDescriptions(paramArrayOfMultiViewDescription, paramMultiViewDescription);
  }
  
  public void setCloseOperationHandler(CloseOperationHandler paramCloseOperationHandler)
  {
    peer.setCloseOperationHandler(paramCloseOperationHandler);
  }
  
  private void setDeserializedMultiViewDescriptions(MultiViewDescription[] paramArrayOfMultiViewDescription, MultiViewDescription paramMultiViewDescription, Map paramMap)
  {
    peer.setDeserializedMultiViewDescriptions(paramArrayOfMultiViewDescription, paramMultiViewDescription, paramMap);
  }
  
  MultiViewModel getModel()
  {
    return peer.getModel();
  }
  
  protected void componentClosed()
  {
    super.componentClosed();
    peer.peerComponentClosed();
  }
  
  protected void componentShowing()
  {
    super.componentShowing();
    peer.peerComponentShowing();
  }
  
  protected void componentHidden()
  {
    super.componentHidden();
    peer.peerComponentHidden();
  }
  
  protected void componentDeactivated()
  {
    super.componentDeactivated();
    peer.peerComponentDeactivated();
  }
  
  protected void componentActivated()
  {
    super.componentActivated();
    peer.peerComponentActivated();
  }
  
  protected void componentOpened()
  {
    super.componentOpened();
    peer.peerComponentOpened();
  }
  
  public boolean requestFocusInWindow()
  {
    return peer.requestFocusInWindow();
  }
  
  public void requestFocus()
  {
    peer.requestFocus();
  }
  
  public Action[] getActions()
  {
    Action[] arrayOfAction1 = super.getActions();
    Action[] arrayOfAction2 = peer.peerGetActions(arrayOfAction1);
    return arrayOfAction2;
  }
  
  public MultiViewHandlerDelegate getMultiViewHandlerDelegate()
  {
    return peer.getMultiViewHandlerDelegate();
  }
  
  public int getPersistenceType()
  {
    return peer.getPersistenceType();
  }
  
  protected String preferredID()
  {
    return peer.preferredID();
  }
  
  public void writeExternal(ObjectOutput paramObjectOutput)
    throws IOException
  {
    super.writeExternal(paramObjectOutput);
    peer.peerWriteExternal(paramObjectOutput);
  }
  
  public void readExternal(ObjectInput paramObjectInput)
    throws IOException, ClassNotFoundException
  {
    super.readExternal(paramObjectInput);
    peer.peerReadExternal(paramObjectInput);
  }
  
  Action[] getDefaultTCActions()
  {
    return super.getActions();
  }
  
  public MultiViewElementCallback createElementCallback(MultiViewDescription paramMultiViewDescription)
  {
    return SpiAccessor.DEFAULT.createCallback(new ActReqObserver(paramMultiViewDescription));
  }
  
  public CloneableTopComponent getComponent()
  {
    return this;
  }
  
  public JEditorPane getEditorPane()
  {
    if ((peer == null) || (peer.model == null)) {
      return null;
    }
    MultiViewElement localMultiViewElement = findPaneElement();
    if (localMultiViewElement != null)
    {
      CloneableEditorSupport.Pane localPane = (CloneableEditorSupport.Pane)localMultiViewElement.getVisualRepresentation();
      return localPane.getEditorPane();
    }
    return null;
  }
  
  private MultiViewElement findPaneElement()
  {
    MultiViewElement localMultiViewElement = peer.model.getActiveElement(false);
    if ((localMultiViewElement != null) && ((localMultiViewElement.getVisualRepresentation() instanceof CloneableEditorSupport.Pane))) {
      return localMultiViewElement;
    }
    Collection localCollection = peer.model.getCreatedElements();
    Iterator localIterator = localCollection.iterator();
    while (localIterator.hasNext())
    {
      localMultiViewElement = (MultiViewElement)localIterator.next();
      if ((localMultiViewElement.getVisualRepresentation() instanceof CloneableEditorSupport.Pane)) {
        return localMultiViewElement;
      }
    }
    MultiViewDescription[] arrayOfMultiViewDescription1 = peer.model.getDescriptions();
    for (MultiViewDescription localMultiViewDescription : arrayOfMultiViewDescription1) {
      if ((localMultiViewDescription instanceof SourceViewMarker))
      {
        localMultiViewElement = peer.model.getElementForDescription(localMultiViewDescription);
        if ((localMultiViewElement.getVisualRepresentation() instanceof CloneableEditorSupport.Pane)) {
          return localMultiViewElement;
        }
        Logger.getLogger(getClass().getName()).info("MultiViewDescription " + localMultiViewDescription.getDisplayName() + "(" + localMultiViewDescription.getClass() + ") claimed to contain sources, but it's MutliViewElement.getVisualRepresentation() didn't return a valid CloeanbleEditorSupport.Pane instance.");
      }
    }
    return null;
  }
  
  public HelpCtx getHelpCtx()
  {
    return peer.getHelpCtx();
  }
  
  public String toString()
  {
    return "MVCTC[name=" + getDisplayName() + ", peer=" + peer + "]";
  }
  
  public UndoRedo getUndoRedo()
  {
    UndoRedo localUndoRedo = peer.peerGetUndoRedo();
    if (localUndoRedo == null) {
      localUndoRedo = super.getUndoRedo();
    }
    return localUndoRedo;
  }
  
  public boolean canClose()
  {
    return peer.canClose();
  }
  
  public void updateName()
  {
    if (peer != null) {
      if (SwingUtilities.isEventDispatchThread()) {
        peer.updateName();
      } else {
        SwingUtilities.invokeLater(new Runnable()
        {
          public void run()
          {
            peer.updateName();
          }
        });
      }
    }
  }
  
  public void ensureVisible()
  {
    MultiViewElement localMultiViewElement = findPaneElement();
    if (localMultiViewElement != null)
    {
      open();
      MultiViewElementCallback localMultiViewElementCallback = peer.getModel().getCallbackForElement(localMultiViewElement);
      localMultiViewElementCallback.requestVisible();
    }
  }
  
  class ActReqObserver
    implements Serializable, MultiViewElementCallbackDelegate
  {
    private static final long serialVersionUID = -3126744916624172415L;
    private MultiViewDescription description;
    
    ActReqObserver(MultiViewDescription paramMultiViewDescription)
    {
      description = paramMultiViewDescription;
    }
    
    public void requestActive()
    {
      boolean bool = peer.isActivated();
      if (!bool) {
        MultiViewCloneableTopComponent.this.requestActive();
      }
      if (peer.model.getActiveDescription() != description)
      {
        if (bool) {
          peer.model.getActiveElement().componentDeactivated();
        }
        peer.tabs.changeActiveManually(description);
        if (bool) {
          peer.model.getActiveElement().componentActivated();
        }
      }
    }
    
    public void requestVisible()
    {
      peer.tabs.changeVisibleManually(description);
    }
    
    public Action[] createDefaultActions()
    {
      return getDefaultTCActions();
    }
    
    public void updateTitle(String paramString)
    {
      setDisplayName(paramString);
    }
    
    public Object writeReplace()
      throws ObjectStreamException
    {
      return null;
    }
    
    public Object readResolve()
      throws ObjectStreamException
    {
      return null;
    }
    
    public boolean isSelectedElement()
    {
      return description.equals(peer.model.getActiveDescription());
    }
    
    public TopComponent getTopComponent()
    {
      return MultiViewCloneableTopComponent.this;
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewCloneableTopComponent
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import javax.swing.Action;
import org.openide.windows.TopComponent;

public abstract interface MultiViewElementCallbackDelegate
{
  public abstract void requestActive();
  
  public abstract void requestVisible();
  
  public abstract Action[] createDefaultActions();
  
  public abstract void updateTitle(String paramString);
  
  public abstract boolean isSelectedElement();
  
  public abstract TopComponent getTopComponent();
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewElementCallbackDelegate
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import org.netbeans.core.api.multiview.MultiViewPerspective;

public abstract interface MultiViewHandlerDelegate
{
  public abstract MultiViewPerspective[] getDescriptions();
  
  public abstract MultiViewPerspective getSelectedDescription();
  
  public abstract void requestActive(MultiViewPerspective paramMultiViewPerspective);
  
  public abstract void requestVisible(MultiViewPerspective paramMultiViewPerspective);
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewHandlerDelegate
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

class MultiViewModel$1 {}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewModel.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import org.netbeans.core.spi.multiview.MultiViewDescription;
import org.netbeans.core.spi.multiview.MultiViewElementCallback;

abstract interface MultiViewModel$ActionRequestObserverFactory
{
  public abstract MultiViewElementCallback createElementCallback(MultiViewDescription paramMultiViewDescription);
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewModel.ActionRequestObserverFactory
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import org.netbeans.core.spi.multiview.MultiViewDescription;

class MultiViewModel$BtnGroup
  extends ButtonGroup
{
  private MultiViewModel$BtnGroup(MultiViewModel paramMultiViewModel) {}
  
  public void setSelected(ButtonModel paramButtonModel, boolean paramBoolean)
  {
    super.setSelected(paramButtonModel, paramBoolean);
    if ((getSelection() instanceof TabsComponent.TabsButtonModel))
    {
      TabsComponent.TabsButtonModel localTabsButtonModel = (TabsComponent.TabsButtonModel)paramButtonModel;
      MultiViewDescription localMultiViewDescription = localTabsButtonModel.getButtonsDescription();
      this$0.setActiveDescription(localMultiViewDescription);
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewModel.BtnGroup
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import org.netbeans.core.spi.multiview.MultiViewDescription;

abstract interface MultiViewModel$ElementSelectionListener
{
  public abstract void selectionChanged(MultiViewDescription paramMultiViewDescription1, MultiViewDescription paramMultiViewDescription2);
  
  public abstract void selectionActivatedByButton();
}

/* Location:
 * Qualified Name:     org.netbeans.core.multiview.MultiViewModel.ElementSelectionListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.core.multiview;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import org.netbeans.core.api.multiview.MultiViewPerspective;
import org.netbeans.core.spi.multiview.MultiViewDescription;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.MultiViewElementCallback;

class MultiViewModel
{
  private MultiViewDescription currentEditor;
  private Map<MultiViewDescription, MultiViewElement> nestedElements;
  private Map<MultiViewElement, MultiViewElementCallback> nestedCallbacks;
  private Map<MultiViewDescription, MultiViewPerspective> nestedPerspectives;
  private MultiViewDescription[] descriptions;
  private ButtonGroup group;
  private Collection<MultiViewElement> shownElements;
  private ArrayList<ElementSelectionListener> listeners;
  private ActionRequestObserverFactory observerFactory;
  
  MultiViewModel(MultiViewDescription[] paramArrayOfMultiViewDescription, MultiViewDescription paramMultiViewDescription, ActionRequestObserverFactory paramActionRequestObserverFactory)
  {
    this(paramArrayOfMultiViewDescription, paramMultiViewDescription, paramActionRequestObserverFactory, Collections.emptyMap());
  }
  
  MultiViewModel(MultiViewDescription[] paramArrayOfMultiViewDescription, MultiViewDescription paramMultiViewDescription, ActionRequestObserverFactory paramActionRequestObserverFactory, Map<MultiViewDescription, MultiViewEle
1 2 3 4

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