org-netbeans-swing-outline

16:40:20.382 INFO  jd.cli.Main - Decompiling org-netbeans-swing-outline.jar
package org.netbeans.swing.etable;

import java.awt.Dimension;
import java.awt.Rectangle;
import javax.swing.JScrollPane;

class ColumnSelectionPanel$1
  extends JScrollPane
{
  ColumnSelectionPanel$1(ColumnSelectionPanel paramColumnSelectionPanel, Rectangle paramRectangle) {}
  
  public Dimension getPreferredSize()
  {
    Dimension localDimension = new Dimension(super.getPreferredSize());
    if (width > val$screenBounds.width - 100) {
      width = (val$screenBounds.width * 3 / 4);
    }
    if (height > val$screenBounds.height - 100) {
      height = (val$screenBounds.height * 3 / 4);
    }
    return localDimension;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ColumnSelectionPanel.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBoxMenuItem;

final class ColumnSelectionPanel$2
  implements ActionListener
{
  ColumnSelectionPanel$2(ETableColumnModel paramETableColumnModel, ETableColumn paramETableColumn, JCheckBoxMenuItem paramJCheckBoxMenuItem, ETable paramETable) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    val$etcm.setColumnHidden(val$etc, !val$finalChB.isSelected());
    val$table.updateColumnSelectionMouseListener();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ColumnSelectionPanel.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.util.Comparator;
import javax.swing.table.TableColumn;

class ColumnSelectionPanel$ETableColumnComparator
  implements Comparator<TableColumn>
{
  public static final ETableColumnComparator DEFAULT = new ETableColumnComparator();
  
  public int compare(TableColumn paramTableColumn1, TableColumn paramTableColumn2)
  {
    if (((paramTableColumn1 instanceof ETableColumn)) && ((paramTableColumn2 instanceof ETableColumn))) {
      ((ETableColumn)paramTableColumn1).compareTo((ETableColumn)paramTableColumn2);
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ColumnSelectionPanel.ETableColumnComparator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.KeyboardFocusManager;
import java.awt.Rectangle;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.swing.JCheckBox;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;

class ColumnSelectionPanel
  extends JPanel
{
  private static final String COLUMNS_SELECTOR_HINT = "ColumnsSelectorHint";
  private Map<ETableColumn, JCheckBox> checkBoxes = new HashMap();
  private ETableColumnModel columnModel;
  
  public ColumnSelectionPanel(ETable paramETable)
  {
    TableColumnModel localTableColumnModel = paramETable.getColumnModel();
    if (!(localTableColumnModel instanceof ETableColumnModel)) {
      return;
    }
    ETableColumnModel localETableColumnModel = (ETableColumnModel)localTableColumnModel;
    columnModel = localETableColumnModel;
    ArrayList localArrayList = Collections.list(localETableColumnModel.getColumns());
    localArrayList.addAll(hiddenColumns);
    Collections.sort(localArrayList, ETableColumnComparator.DEFAULT);
    int i = 1;
    
    JPanel localJPanel = layoutPanel(localArrayList, i, paramETable);
    Dimension localDimension = localJPanel.getPreferredSize();
    final Rectangle localRectangle = getUsableScreenBounds(getCurrentGraphicsConfiguration());
    
    Object localObject = null;
    if ((width > width - 100) || (height > height - 100))
    {
      JScrollPane local1 = new JScrollPane()
      {
        public Dimension getPreferredSize()
        {
          Dimension localDimension = new Dimension(super.getPreferredSize());
          if (width > localRectanglewidth - 100) {
            width = (localRectanglewidth * 3 / 4);
          }
          if (height > localRectangleheight - 100) {
            height = (localRectangleheight * 3 / 4);
          }
          return localDimension;
        }
      };
      local1.setViewportView(localJPanel);
      localObject = local1;
    }
    else
    {
      localObject = localJPanel;
    }
    add((Component)localObject);
  }
  
  private JPanel layoutPanel(List<TableColumn> paramList, int paramInt, ETable paramETable)
  {
    JPanel localJPanel = new JPanel(new GridBagLayout());
    HashMap localHashMap = new HashMap();
    ArrayList localArrayList = new ArrayList();
    Object localObject6;
    Object localObject7;
    JCheckBox localJCheckBox;
    for (int i = 0; i < paramList.size(); i++)
    {
      ETableColumn localETableColumn = (ETableColumn)paramList.get(i);
      Object localObject1 = new JCheckBox();
      Object localObject2 = paramETable.transformValue(localETableColumn);
      Object localObject3 = paramETable.transformValue(localETableColumn);
      localObject4 = (localObject2 == localETableColumn) || (localObject3 == null) ? localETableColumn.getHeaderValue().toString() : localObject3.toString();
      ((JCheckBox)localObject1).setText((String)localObject4);
      localObject5 = (JCheckBox)paramETable.transformValue(localObject1);
      if (localObject5 != null) {
        localObject1 = localObject5;
      }
      checkBoxes.put(localETableColumn, localObject1);
      ((JCheckBox)localObject1).setSelected(!columnModel.isColumnHidden(localETableColumn));
      ((JCheckBox)localObject1).setEnabled(localETableColumn.isHidingAllowed());
      if (!localArrayList.contains(localObject4))
      {
        localHashMap.put(localObject4, localObject1);
      }
      else
      {
        localObject6 = null;
        localObject7 = localHashMap.get(localObject4);
        if ((localObject7 instanceof JCheckBox))
        {
          localJCheckBox = (JCheckBox)localObject7;
          localObject6 = new ArrayList();
          ((ArrayList)localObject6).add(localJCheckBox);
        }
        else if ((localObject7 instanceof ArrayList))
        {
          localObject6 = (ArrayList)localObject7;
        }
        else
        {
          throw new IllegalStateException("Wrong object theFirstOne is " + localObject7);
        }
        ((ArrayList)localObject6).add(localObject1);
        localHashMap.put(localObject4, localObject6);
      }
      localArrayList.add(localObject4);
    }
    String str = (String)localArrayList.remove(0);
    Collections.sort(localArrayList, Collator.getInstance());
    localArrayList.add(0, str);
    int j = 0;
    int k = 0;
    int m = 0;
    int n = paramList.size() / paramInt;
    Object localObject4 = paramETable.transformValue("ColumnsSelectorHint");
    if (localObject4 != null)
    {
      localObject5 = new GridBagConstraints();
      gridx = 0;
      gridy = 0;
      insets = new Insets(5, 12, 12, 12);
      anchor = 18;
      localJPanel.add(new JLabel(localObject4.toString()), localObject5);
    }
    for (Object localObject5 = localArrayList.iterator(); ((Iterator)localObject5).hasNext(); j++)
    {
      if (j >= n)
      {
        j = 0;
        k++;
      }
      localObject6 = (String)((Iterator)localObject5).next();
      localObject7 = localHashMap.get(localObject6);
      localJCheckBox = null;
      if ((localObject7 instanceof JCheckBox))
      {
        localJCheckBox = (JCheckBox)localObject7;
      }
      else if ((localObject7 instanceof ArrayList))
      {
        localObject8 = (ArrayList)localObject7;
        if (m >= ((ArrayList)localObject8).size()) {
          m = 0;
        }
        localJCheckBox = (JCheckBox)((ArrayList)localObject8).get(m++);
      }
      else
      {
        throw new IllegalStateException("Wrong object obj is " + localObject7);
      }
      Object localObject8 = new GridBagConstraints();
      gridx = k;
      gridy = (j + (localObject4 == null ? j : j + 1));
      insets = new Insets(0, 12, 0, 12);
      anchor = 18;
      weightx = 1.0D;
      localJPanel.add(localJCheckBox, localObject8);
    }
    return localJPanel;
  }
  
  public void changeColumnVisibility()
  {
    if (columnModel == null) {
      return;
    }
    for (Iterator localIterator = checkBoxes.keySet().iterator(); localIterator.hasNext();)
    {
      ETableColumn localETableColumn = (ETableColumn)localIterator.next();
      JCheckBox localJCheckBox = (JCheckBox)checkBoxes.get(localETableColumn);
      columnModel.setColumnHidden(localETableColumn, !localJCheckBox.isSelected());
    }
  }
  
  static void showColumnSelectionPopup(Component paramComponent, final ETable paramETable)
  {
    if (!paramETable.isColumnHidingAllowed()) {
      return;
    }
    if (!paramETable.isPopupUsedFromTheCorner())
    {
      showColumnSelectionDialog(paramETable);
      return;
    }
    JPopupMenu localJPopupMenu = new JPopupMenu();
    TableColumnModel localTableColumnModel = paramETable.getColumnModel();
    if (!(localTableColumnModel instanceof ETableColumnModel)) {
      return;
    }
    ETableColumnModel localETableColumnModel = (ETableColumnModel)localTableColumnModel;
    ArrayList localArrayList1 = Collections.list(localETableColumnModel.getColumns());
    localArrayList1.addAll(hiddenColumns);
    Collections.sort(localArrayList1, ETableColumnComparator.DEFAULT);
    HashMap localHashMap = new HashMap();
    ArrayList localArrayList2 = new ArrayList();
    for (Iterator localIterator = localArrayList1.iterator(); localIterator.hasNext();)
    {
      localObject1 = (ETableColumn)localIterator.next();
      localObject2 = new JCheckBoxMenuItem();
      localObject3 = paramETable.transformValue(localObject1).toString();
      ((JCheckBoxMenuItem)localObject2).setText((String)localObject3);
      localObject2 = (JCheckBoxMenuItem)paramETable.transformValue(localObject2);
      ((JCheckBoxMenuItem)localObject2).setSelected(!localETableColumnModel.isColumnHidden((TableColumn)localObject1));
      ((JCheckBoxMenuItem)localObject2).setEnabled(((ETableColumn)localObject1).isHidingAllowed());
      localObject4 = localObject2;
      ((JCheckBoxMenuItem)localObject2).addActionListener(new ActionListener()
      {
        public void actionPerformed(ActionEvent paramAnonymousActionEvent)
        {
          val$etcm.setColumnHidden(localObject1, !localObject4.isSelected());
          paramETable.updateColumnSelectionMouseListener();
        }
      });
      if (!localArrayList2.contains(localObject3))
      {
        localHashMap.put(localObject3, localObject2);
      }
      else
      {
        localArrayList3 = null;
        Object localObject5 = localHashMap.get(localObject3);
        if ((localObject5 instanceof JCheckBoxMenuItem))
        {
          JCheckBoxMenuItem localJCheckBoxMenuItem = (JCheckBoxMenuItem)localObject5;
          localArrayList3 = new ArrayList();
          localArrayList3.add(localJCheckBoxMenuItem);
        }
        else if ((localObject5 instanceof ArrayList))
        {
          localArrayList3 = (ArrayList)localObject5;
        }
        else
        {
          throw new IllegalStateException("Wrong object theFirstOne is " + localObject5);
        }
        localArrayList3.add(localObject2);
        localHashMap.put(localObject3, localArrayList3);
      }
      localArrayList2.add(localObject3);
    }
    Object localObject2;
    Object localObject3;
    final Object localObject4;
    ArrayList localArrayList3;
    Collections.sort(localArrayList2, Collator.getInstance());
    int i = 0;
    for (final Object localObject1 = localArrayList2.iterator(); ((Iterator)localObject1).hasNext();)
    {
      localObject2 = (String)((Iterator)localObject1).next();
      localObject3 = localHashMap.get(localObject2);
      localObject4 = null;
      if ((localObject3 instanceof JCheckBoxMenuItem))
      {
        localObject4 = (JCheckBoxMenuItem)localObject3;
      }
      else if ((localObject3 instanceof ArrayList))
      {
        localArrayList3 = (ArrayList)localObject3;
        if (i >= localArrayList3.size()) {
          i = 0;
        }
        localObject4 = (JCheckBoxMenuItem)localArrayList3.get(i++);
      }
      else
      {
        throw new IllegalStateException("Wrong object obj is " + localObject3);
      }
      localJPopupMenu.add((JMenuItem)localObject4);
    }
    localJPopupMenu.show(paramComponent, 8, 8);
  }
  
  static void showColumnSelectionDialog(ETable paramETable)
  {
    if (!paramETable.isColumnHidingAllowed()) {
      return;
    }
    TableColumnSelector localTableColumnSelector = paramETable.getColumnSelector();
    if (localTableColumnSelector != null)
    {
      localObject = (ETableColumnModel)paramETable.getColumnModel();
      TableColumnSelector.TreeNode localTreeNode = ((ETableColumnModel)localObject).getColumnHierarchyRoot();
      String[] arrayOfString1;
      String[] arrayOfString2;
      if (localTreeNode != null)
      {
        arrayOfString1 = getAvailableColumnNames(paramETable, true);
        arrayOfString2 = localTableColumnSelector.selectVisibleColumns(localTreeNode, arrayOfString1);
        makeVisibleColumns(paramETable, arrayOfString2);
      }
      else
      {
        arrayOfString1 = getAvailableColumnNames(paramETable, false);
        arrayOfString2 = getAvailableColumnNames(paramETable, true);
        String[] arrayOfString3 = localTableColumnSelector.selectVisibleColumns(arrayOfString1, arrayOfString2);
        makeVisibleColumns(paramETable, arrayOfString3);
      }
      return;
    }
    Object localObject = new ColumnSelectionPanel(paramETable);
    int i = JOptionPane.showConfirmDialog(null, localObject, selectVisibleColumnsLabel, 2);
    if (i == 0)
    {
      ((ColumnSelectionPanel)localObject).changeColumnVisibility();
      paramETable.updateColumnSelectionMouseListener();
    }
  }
  
  private static void makeVisibleColumns(ETable paramETable, String[] paramArrayOfString)
  {
    HashSet localHashSet = new HashSet(Arrays.asList(paramArrayOfString));
    TableColumnModel localTableColumnModel = paramETable.getColumnModel();
    if (!(localTableColumnModel instanceof ETableColumnModel)) {
      return;
    }
    ETableColumnModel localETableColumnModel = (ETableColumnModel)localTableColumnModel;
    ArrayList localArrayList = Collections.list(localETableColumnModel.getColumns());
    localArrayList.addAll(hiddenColumns);
    Collections.sort(localArrayList, ETableColumnComparator.DEFAULT);
    HashMap localHashMap = new HashMap();
    for (Iterator localIterator = localArrayList.iterator(); localIterator.hasNext();)
    {
      localETableColumn = (ETableColumn)localIterator.next();
      String str = paramETable.getColumnDisplayName(localETableColumn.getHeaderValue().toString());
      localETableColumnModel.setColumnHidden(localETableColumn, !localHashSet.contains(str));
      localHashMap.put(str, localETableColumn);
    }
    ETableColumn localETableColumn;
    for (int i = 0; i < paramArrayOfString.length; i++)
    {
      localETableColumn = (ETableColumn)localHashMap.get(paramArrayOfString[i]);
      if (localETableColumn == null) {
        throw new IllegalStateException("Cannot find column with name " + paramArrayOfString[i]);
      }
      int j = localETableColumnModel.getColumnIndex(localETableColumn.getIdentifier());
      localETableColumnModel.moveColumn(j, i);
    }
  }
  
  private static String[] getAvailableColumnNames(ETable paramETable, boolean paramBoolean)
  {
    TableColumnModel localTableColumnModel = paramETable.getColumnModel();
    if (!(localTableColumnModel instanceof ETableColumnModel)) {
      return new String[0];
    }
    ETableColumnModel localETableColumnModel = (ETableColumnModel)localTableColumnModel;
    ArrayList localArrayList1 = Collections.list(localETableColumnModel.getColumns());
    if (!paramBoolean) {
      localArrayList1.addAll(hiddenColumns);
    }
    Collections.sort(localArrayList1, ETableColumnComparator.DEFAULT);
    ArrayList localArrayList2 = new ArrayList();
    for (Iterator localIterator = localArrayList1.iterator(); localIterator.hasNext();)
    {
      ETableColumn localETableColumn = (ETableColumn)localIterator.next();
      String str = paramETable.getColumnDisplayName(localETableColumn.getHeaderValue().toString());
      localArrayList2.add(str);
    }
    Collections.sort(localArrayList2, Collator.getInstance());
    return (String[])localArrayList2.toArray(new String[localArrayList2.size()]);
  }
  
  private static class ETableColumnComparator
    implements Comparator<TableColumn>
  {
    public static final ETableColumnComparator DEFAULT = new ETableColumnComparator();
    
    public int compare(TableColumn paramTableColumn1, TableColumn paramTableColumn2)
    {
      if (((paramTableColumn1 instanceof ETableColumn)) && ((paramTableColumn2 instanceof ETableColumn))) {
        ((ETableColumn)paramTableColumn1).compareTo((ETableColumn)paramTableColumn2);
      }
      return 0;
    }
  }
  
  private static GraphicsConfiguration getCurrentGraphicsConfiguration()
  {
    Component localComponent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    if (localComponent != null)
    {
      Window localWindow = SwingUtilities.getWindowAncestor(localComponent);
      if (localWindow != null) {
        return localWindow.getGraphicsConfiguration();
      }
    }
    return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
  }
  
  private static Rectangle getUsableScreenBounds(GraphicsConfiguration paramGraphicsConfiguration)
  {
    if (paramGraphicsConfiguration == null) {
      paramGraphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
    }
    return new Rectangle(paramGraphicsConfiguration.getBounds());
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ColumnSelectionPanel
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

class ETable$1
  implements ActionListener
{
  ETable$1(ETable paramETable) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    ColumnSelectionPanel.showColumnSelectionDialog(this$0);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JButton;

class ETable$2
  extends MouseAdapter
{
  ETable$2(ETable paramETable, JButton paramJButton) {}
  
  public void mouseClicked(MouseEvent paramMouseEvent)
  {
    if (paramMouseEvent.getButton() == 3) {
      ColumnSelectionPanel.showColumnSelectionPopup(val$b, this$0);
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

class ETable$3
  implements ActionListener
{
  ETable$3(ETable paramETable) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    this$0.unsetQuickFilter();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.JTextField;
import javax.swing.KeyStroke;

class ETable$4
  extends KeyAdapter
{
  private boolean armed = false;
  
  ETable$4(ETable paramETable) {}
  
  public void keyPressed(KeyEvent paramKeyEvent)
  {
    int i = paramKeyEvent.getModifiers();
    int j = paramKeyEvent.getKeyCode();
    if (((i > 0) && (i != 1)) || (paramKeyEvent.isActionKey())) {
      return;
    }
    char c = paramKeyEvent.getKeyChar();
    if ((!Character.isISOControl(c)) && (j != 16) && (j != 27))
    {
      armed = true;
      paramKeyEvent.consume();
    }
  }
  
  public void keyTyped(KeyEvent paramKeyEvent)
  {
    if (armed)
    {
      KeyStroke localKeyStroke = KeyStroke.getKeyStrokeForEvent(paramKeyEvent);
      ETable.access$1000(this$0).setText(String.valueOf(localKeyStroke.getKeyChar()));
      
      this$0.displaySearchField();
      paramKeyEvent.consume();
      armed = false;
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.AWTEvent;
import java.awt.Component;
import java.awt.Container;
import java.awt.EventQueue;
import java.awt.FocusTraversalPolicy;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.JViewport;

class ETable$CTRLTabAction
  extends AbstractAction
{
  private ETable$CTRLTabAction(ETable paramETable) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    this$0.setFocusCycleRoot(false);
    try
    {
      Container localContainer = this$0.getFocusCycleRootAncestor();
      if (localContainer != null)
      {
        Object localObject1 = this$0;
        if ((this$0.getParent() instanceof JViewport))
        {
          localObject1 = this$0.getParent().getParent();
          if (localObject1 == localContainer) {
            localObject1 = this$0;
          }
        }
        AWTEvent localAWTEvent = EventQueue.getCurrentEvent();
        int i = 0;
        if ((localAWTEvent instanceof KeyEvent)) {
          i = ((((KeyEvent)localAWTEvent).getModifiers() & 0x1) != 0) && ((((KeyEvent)localAWTEvent).getModifiersEx() & 0x40) != 0) ? 1 : 0;
        }
        Component localComponent = i != 0 ? localContainer.getFocusTraversalPolicy().getComponentAfter(localContainer, this$0) : localContainer.getFocusTraversalPolicy().getComponentAfter(localContainer, this$0);
        if (localComponent == this$0) {
          localComponent = i != 0 ? localContainer.getFocusTraversalPolicy().getFirstComponent(localContainer) : localContainer.getFocusTraversalPolicy().getLastComponent(localContainer);
        }
        localComponent.requestFocus();
      }
    }
    finally
    {
      this$0.setFocusCycleRoot(true);
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.CTRLTabAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.Component;
import java.awt.KeyboardFocusManager;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import javax.swing.JRootPane;
import javax.swing.KeyStroke;

class ETable$CancelEditAction
  extends AbstractAction
{
  private ETable$CancelEditAction(ETable paramETable) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    if ((this$0.isEditing()) || (ETable.access$2600(this$0) != null))
    {
      this$0.removeEditor();
      return;
    }
    Component localComponent = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    
    InputMap localInputMap = this$0.getRootPane().getInputMap(1);
    ActionMap localActionMap = this$0.getRootPane().getActionMap();
    
    KeyStroke localKeyStroke = KeyStroke.getKeyStroke(27, 0, false);
    Object localObject = localInputMap.get(localKeyStroke);
    if (localObject == null) {
      localObject = "Cancel";
    }
    if (localObject != null)
    {
      Action localAction = localActionMap.get(localObject);
      if (localAction != null)
      {
        String str = (String)localAction.getValue("ActionCommandKey");
        if (str == null) {
          str = localObject.toString();
        }
        localAction.actionPerformed(new ActionEvent(this, 1001, str));
      }
    }
  }
  
  public boolean isEnabled()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.CancelEditAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

class ETable$ColumnSelectionMouseListener
  extends MouseAdapter
{
  private ETable$ColumnSelectionMouseListener(ETable paramETable) {}
  
  public void mouseClicked(MouseEvent paramMouseEvent)
  {
    if (paramMouseEvent.getButton() == 3) {
      ColumnSelectionPanel.showColumnSelectionDialog(this$0);
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.ColumnSelectionMouseListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

class ETable$CompareQuickFilter
  implements ActionListener, QuickFilter
{
  private int column;
  private Object value;
  private boolean greater;
  private boolean equalsCounts;
  
  public ETable$CompareQuickFilter(ETable paramETable, int paramInt, Object paramObject, boolean paramBoolean1, boolean paramBoolean2)
  {
    column = paramInt;
    value = paramObject;
    greater = paramBoolean1;
    equalsCounts = paramBoolean2;
  }
  
  public boolean accept(Object paramObject)
  {
    if (equalsCounts)
    {
      if (greater) {
        return doCompare(value, paramObject) <= 0;
      }
      return doCompare(value, paramObject) >= 0;
    }
    if (greater) {
      return doCompare(value, paramObject) < 0;
    }
    return doCompare(value, paramObject) > 0;
  }
  
  private int doCompare(Object paramObject1, Object paramObject2)
  {
    if ((paramObject1 == null) && (paramObject2 == null)) {
      return 0;
    }
    if (paramObject1 == null) {
      return -1;
    }
    if (paramObject2 == null) {
      return 1;
    }
    if (((paramObject1 instanceof Comparable)) && (paramObject1.getClass().isAssignableFrom(paramObject2.getClass())))
    {
      Comparable localComparable = (Comparable)paramObject1;
      return localComparable.compareTo(paramObject2);
    }
    return paramObject1.toString().compareTo(paramObject2.toString());
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    this$0.setQuickFilter(column, this);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.CompareQuickFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;

class ETable$EditAction
  extends AbstractAction
{
  private ETable$EditAction(ETable paramETable) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    int i = this$0.getSelectedRow();
    int j = this$0.getSelectedColumn();
    this$0.editCellAt(i, j, null);
  }
  
  public boolean isEnabled()
  {
    return (this$0.getSelectedRow() != -1) && (this$0.getSelectedColumn() != -1) && (!this$0.isEditing());
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.EditAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JRootPane;

class ETable$EnterAction
  extends AbstractAction
{
  private ETable$EnterAction(ETable paramETable) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    JRootPane localJRootPane = this$0.getRootPane();
    if (localJRootPane != null)
    {
      JButton localJButton = this$0.getRootPane().getDefaultButton();
      if ((localJButton != null) && (localJButton.isEnabled())) {
        localJButton.doClick();
      }
    }
  }
  
  public boolean isEnabled()
  {
    return (!this$0.isEditing()) && (!ETable.access$2000(this$0));
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.EnterAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

class ETable$EqualsQuickFilter
  implements ActionListener, QuickFilter
{
  private int column;
  private Object value;
  private boolean equals;
  
  public ETable$EqualsQuickFilter(ETable paramETable, int paramInt, Object paramObject, boolean paramBoolean)
  {
    column = paramInt;
    value = paramObject;
    equals = paramBoolean;
  }
  
  public boolean accept(Object paramObject)
  {
    if ((value == null) && (paramObject == null)) {
      return equals;
    }
    if ((value == null) || (paramObject == null)) {
      return !equals;
    }
    if (equals) {
      return value.equals(paramObject);
    }
    return !value.equals(paramObject);
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    this$0.setQuickFilter(column, this);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.EqualsQuickFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.event.TableModelEvent;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;

class ETable$HeaderMouseListener
  extends MouseAdapter
{
  private ETable$HeaderMouseListener(ETable paramETable) {}
  
  public void mouseClicked(MouseEvent paramMouseEvent)
  {
    if (paramMouseEvent.getButton() == 3)
    {
      ColumnSelectionPanel.showColumnSelectionPopup(paramMouseEvent.getComponent(), this$0);
      return;
    }
    TableColumn localTableColumn1 = ETable.access$1500(this$0, paramMouseEvent.getPoint());
    if ((localTableColumn1 == null) && (paramMouseEvent.getClickCount() == 1))
    {
      int i = this$0.columnAtPoint(paramMouseEvent.getPoint());
      if (i < 0) {
        return;
      }
      TableColumnModel localTableColumnModel = this$0.getColumnModel();
      if ((localTableColumnModel instanceof ETableColumnModel))
      {
        ETableColumnModel localETableColumnModel = (ETableColumnModel)localTableColumnModel;
        TableColumn localTableColumn2 = localTableColumnModel.getColumn(i);
        if ((localTableColumn2 instanceof ETableColumn))
        {
          ETableColumn localETableColumn2 = (ETableColumn)localTableColumn2;
          if (!localETableColumn2.isSortingAllowed()) {
            return;
          }
          int[] arrayOfInt = ETable.access$1600(this$0);
          int j = this$0.getSelectedColumn();
          this$0.clearSelection();
          boolean bool = (paramMouseEvent.getModifiers() & 0x1) != 1;
          localETableColumnModel.toggleSortedColumn(localETableColumn2, bool);
          ETable.access$1700(this$0);
          ETable.access$1801(this$0, new TableModelEvent(this$0.getModel(), 0, this$0.getRowCount()));
          if (arrayOfInt.length > 0) {
            ETable.access$1900(this$0, arrayOfInt, j);
          }
          this$0.getTableHeader().resizeAndRepaint();
        }
      }
    }
    if ((localTableColumn1 != null) && (paramMouseEvent.getClickCount() == 2)) {
      if ((localTableColumn1 instanceof ETableColumn))
      {
        ETableColumn localETableColumn1 = (ETableColumn)localTableColumn1;
        localETableColumn1.updatePreferredWidth(this$0, true);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.HeaderMouseListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.Component;
import java.awt.Container;
import java.awt.FocusTraversalPolicy;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JRootPane;

final class ETable$NavigationAction
  extends AbstractAction
{
  private boolean direction;
  
  public ETable$NavigationAction(ETable paramETable, boolean paramBoolean)
  {
    direction = paramBoolean;
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    if (this$0.isEditing()) {
      this$0.removeEditor();
    }
    int j;
    int i;
    if (direction)
    {
      if (this$0.getSelectedColumn() == this$0.getColumnCount() - 1)
      {
        j = 0;
        i = this$0.getSelectedRow() + 1;
      }
      else
      {
        j = this$0.getSelectedColumn() + 1;
        i = this$0.getSelectedRow();
      }
    }
    else if (this$0.getSelectedColumn() == 0)
    {
      j = this$0.getColumnCount() - 1;
      i = this$0.getSelectedRow() - 1;
    }
    else
    {
      i = this$0.getSelectedRow();
      j = this$0.getSelectedColumn() - 1;
    }
    if ((i >= this$0.getRowCount()) || (i < 0))
    {
      Object localObject1 = this$0.getFocusCycleRootAncestor();
      
      Object localObject2 = direction ? ((Container)localObject1).getFocusTraversalPolicy().getComponentAfter((Container)localObject1, this$0.getParent()) : ((Container)localObject1).getFocusTraversalPolicy().getComponentBefore((Container)localObject1, this$0);
      Object localObject3;
      if (localObject2 == this$0)
      {
        localObject3 = ((Container)localObject1).getFocusCycleRootAncestor();
        if (localObject3 != null)
        {
          localObject2 = direction ? ((Container)localObject3).getFocusTraversalPolicy().getComponentAfter((Container)localObject3, (Component)localObject1) : ((Container)localObject3).getFocusTraversalPolicy().getComponentBefore((Container)localObject3, (Component)localObject1);
          
          localObject1 = localObject3;
        }
      }
      if ((localObject2 == this$0) && 
        (((Container)localObject1).getFocusTraversalPolicy().getFirstComponent((Container)localObject1) != null)) {
        localObject2 = ((Container)localObject1).getFocusTraversalPolicy().getFirstComponent((Container)localObject1);
      }
      if (localObject2 == this$0)
      {
        localObject3 = this$0.getRootPane();
        JButton localJButton = ((JRootPane)localObject3).getDefaultButton();
        if (localJButton != null) {
          localObject2 = localJButton;
        }
      }
      if (localObject2 != null)
      {
        if (localObject2 == this$0) {
          this$0.changeSelection(direction ? 0 : this$0.getRowCount() - 1, direction ? 0 : this$0.getColumnCount() - 1, false, false);
        } else {
          ((Component)localObject2).requestFocus();
        }
        return;
      }
    }
    this$0.changeSelection(i, j, false, false);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.NavigationAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.util.Comparator;

class ETable$OriginalRowComparator
  implements Comparator<ETable.RowMapping>
{
  public int compare(ETable.RowMapping paramRowMapping1, ETable.RowMapping paramRowMapping2)
  {
    int i = paramRowMapping1.getModelRowIndex();
    int j = paramRowMapping2.getModelRowIndex();
    return i == j ? 0 : i < j ? -1 : 1;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.OriginalRowComparator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import javax.swing.table.TableModel;

public final class ETable$RowMapping
{
  private int originalIndex;
  private TableModel model;
  
  public ETable$RowMapping(int paramInt, TableModel paramTableModel)
  {
    originalIndex = paramInt;
    model = paramTableModel;
  }
  
  public int getModelRowIndex()
  {
    return originalIndex;
  }
  
  public Object getModelObject(int paramInt)
  {
    return model.getValueAt(originalIndex, paramInt);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.RowMapping
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.Component;
import java.awt.Container;
import java.awt.ContainerOrderFocusTraversalPolicy;

class ETable$STPolicy
  extends ContainerOrderFocusTraversalPolicy
{
  private ETable$STPolicy(ETable paramETable) {}
  
  public Component getComponentAfter(Container paramContainer, Component paramComponent)
  {
    if (ETable.access$2000(this$0)) {
      return this$0;
    }
    Component localComponent = super.getComponentAfter(paramContainer, paramComponent);
    return localComponent;
  }
  
  public Component getComponentBefore(Container paramContainer, Component paramComponent)
  {
    if (ETable.access$2000(this$0)) {
      return this$0;
    }
    return super.getComponentBefore(paramContainer, paramComponent);
  }
  
  public Component getFirstComponent(Container paramContainer)
  {
    if ((!ETable.access$2000(this$0)) && (this$0.isEditing())) {
      return ETable.access$2100(this$0);
    }
    return this$0;
  }
  
  public Component getDefaultComponent(Container paramContainer)
  {
    if ((ETable.access$2000(this$0)) && (this$0.isEditing()) && (ETable.access$2200(this$0).isShowing())) {
      return ETable.access$2300(this$0);
    }
    return this$0;
  }
  
  protected boolean accept(Component paramComponent)
  {
    if ((this$0.isEditing()) && (ETable.access$2400(this$0))) {
      return ETable.access$2500(this$0, paramComponent);
    }
    return (super.accept(paramComponent)) && (paramComponent.isShowing());
  }
}

/* Location:
 * Qualified Name:     org.netbeans.swing.etable.ETable.STPolicy
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.swing.etable;

import java.awt.Component;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Enumeration;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.table.TableColumnModel;

class ETable$SearchComboListener
  extends KeyAdapter
  implements FocusListener, ItemListener
{
  ETable$SearchComboListener(ETable paramETable) {}
  
  public void itemStateChanged(ItemEvent paramItemEvent)
  {
    Object localObject1 = ETable.access$1300(this$0).getSelectedItem();
    for (Object localObject2 = this$0.getColumnModel().getColumns(); ((Enumeration)localObject2).hasMoreElements();)
    {
      Object localObject3 = ((Enumeration)localObject2).nextElement();
      if ((localObject3 instanceof ETableColumn))
      {
        ETableColumn localETableColumn = (ETableColumn)localObject3;
        Object localObject4 = localETableColumn.getHeaderValue();
        String str = "";
        if (localObject4 != null) {
          str = localObject4.toString();
        }
        str = this$0.getColumnDisplayName(str);
        if (str.equals(localObject1)) {
          ETable.access$1402(this$0, localETableColumn);
        }
      }
    }
    localObject2 = ETable.access$1000(this$0).getText();
    ETable.access$1000(this$0).setText("");
    ETable.access$1000(this$0).setText((String)localObject2);
    ETable.access$1000(this$0).requestFocus();
  }
  
  publ
1 2 3 4 5 6 7

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