org-netbeans-modules-autoupdate-ui

16:39:51.514 INFO  jd.cli.Main - Decompiling org-netbeans-modules-autoupdate-ui.jar
package org.netbeans.modules.autoupdate.ui;

import java.util.Comparator;

class AvailableTableModel$1
  implements Comparator<Unit>
{
  AvailableTableModel$1(AvailableTableModel paramAvailableTableModel, boolean paramBoolean, Object paramObject) {}
  
  public int compare(Unit paramUnit1, Unit paramUnit2)
  {
    Unit localUnit1 = val$sortAscending ? paramUnit1 : paramUnit2;
    Unit localUnit2 = val$sortAscending ? paramUnit2 : paramUnit1;
    if (this$0.getColumnName(0).equals(val$columnIdentifier))
    {
      if (!$assertionsDisabled) {
        throw new AssertionError(val$columnIdentifier.toString());
      }
    }
    else
    {
      if (this$0.getColumnName(1).equals(val$columnIdentifier)) {
        return Unit.compareDisplayNames(localUnit1, localUnit2);
      }
      if (this$0.getColumnName(2).equals(val$columnIdentifier)) {
        return Unit.compareCategories(localUnit1, localUnit2);
      }
      if (this$0.getColumnName(3).equals(val$columnIdentifier)) {
        return Unit.Available.compareSourceCategories(localUnit1, localUnit2);
      }
    }
    return 0;
  }
}

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

import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.swing.table.JTableHeader;
import org.netbeans.api.autoupdate.OperationContainer;
import org.netbeans.api.autoupdate.OperationContainer.OperationInfo;
import org.netbeans.api.autoupdate.UpdateElement;
import org.netbeans.api.autoupdate.UpdateUnit;
import org.netbeans.api.autoupdate.UpdateUnitProvider.CATEGORY;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor.Message;
import org.openide.util.NbBundle;

public class AvailableTableModel
  extends UnitCategoryTableModel
{
  private OperationContainer container = Containers.forAvailable();
  private OperationContainer containerCustom = Containers.forCustomInstall();
  private static String col0;
  private static String col1;
  private static String col2;
  private static String col3;
  
  public AvailableTableModel(List<UpdateUnit> paramList)
  {
    setUnits(paramList);
  }
  
  public final void setUnits(List<UpdateUnit> paramList)
  {
    setData(Utilities.makeAvailableCategories(paramList, false));
  }
  
  public void setValueAt(Object paramObject, int paramInt1, int paramInt2)
  {
    if (isExpansionControlAtRow(paramInt1)) {
      return;
    }
    if (paramInt2 == 1) {
      return;
    }
    super.setValueAt(paramObject, paramInt1, paramInt2);
    if (paramObject == null) {
      return;
    }
    Unit.Available localAvailable = (Unit.Available)getUnitAtRow(paramInt1);
    assert ((paramObject instanceof Boolean)) : (paramObject + " must be instanceof Boolean.");
    boolean bool = localAvailable.isMarked();
    if (((Boolean)paramObject).booleanValue() != bool)
    {
      localAvailable.setMarked(!bool);
      if (localAvailable.isMarked() != bool)
      {
        fireButtonsChange();
      }
      else
      {
        String str = getBundle("NotificationAlreadyPreparedToIntsall", new Object[] { localAvailable.getDisplayName() });
        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(str));
      }
    }
  }
  
  public Object getValueAt(int paramInt1, int paramInt2)
  {
    Object localObject = null;
    if (isExpansionControlAtRow(paramInt1)) {
      return "";
    }
    Unit.Available localAvailable = (Unit.Available)getUnitAtRow(paramInt1);
    if (localAvailable == null) {
      return null;
    }
    switch (paramInt2)
    {
    case 0: 
      localObject = localAvailable.isMarked() ? Boolean.TRUE : Boolean.FALSE;
      break;
    case 1: 
      localObject = localAvailable.getDisplayName();
      break;
    case 2: 
      localObject = localAvailable.getCategoryName();
      break;
    case 3: 
      localObject = localAvailable.getSourceCategory();
    }
    return localObject;
  }
  
  public int getColumnCount()
  {
    return 4;
  }
  
  public Class getColumnClass(int paramInt)
  {
    Class localClass = null;
    switch (paramInt)
    {
    case 0: 
      localClass = Boolean.class;
      break;
    case 1: 
      localClass = String.class;
      break;
    case 2: 
      localClass = String.class;
      break;
    case 3: 
      localClass = UpdateUnitProvider.CATEGORY.class;
    }
    return localClass;
  }
  
  public String getColumnName(int paramInt)
  {
    switch (paramInt)
    {
    case 0: 
      if (col0 == null) {
        col0 = getBundle("AvailableTableModel_Columns_Install", new Object[0]);
      }
      return col0;
    case 1: 
      if (col1 == null) {
        col1 = getBundle("AvailableTableModel_Columns_Name", new Object[0]);
      }
      return col1;
    case 2: 
      if (col2 == null) {
        col2 = getBundle("AvailableTableModel_Columns_Category", new Object[0]);
      }
      return col2;
    case 3: 
      if (col3 == null) {
        col3 = getBundle("AvailableTableModel_Source_Category", new Object[0]);
      }
      return col3;
    }
    if (!$assertionsDisabled) {
      throw new AssertionError();
    }
    return super.getColumnName(paramInt);
  }
  
  public String getToolTipText(int paramInt1, int paramInt2)
  {
    if (paramInt2 == 3)
    {
      UpdateUnitProvider.CATEGORY localCATEGORY = (UpdateUnitProvider.CATEGORY)getValueAt(paramInt1, 3);
      return Utilities.getCategoryName(localCATEGORY);
    }
    return super.getToolTipText(paramInt1, paramInt2);
  }
  
  public int getPreferredWidth(JTableHeader paramJTableHeader, int paramInt)
  {
    int i = super.getMinWidth(paramJTableHeader, paramInt);
    switch (paramInt)
    {
    case 1: 
      return i * 4;
    case 2: 
      return i * 2;
    }
    return i;
  }
  
  public UnitCategoryTableModel.Type getType()
  {
    return UnitCategoryTableModel.Type.AVAILABLE;
  }
  
  public boolean isSortAllowed(Object paramObject)
  {
    boolean bool = getColumnName(0).equals(paramObject);
    return !bool;
  }
  
  protected Comparator<Unit> getComparator(final Object paramObject, final boolean paramBoolean)
  {
    new Comparator()
    {
      public int compare(Unit paramAnonymousUnit1, Unit paramAnonymousUnit2)
      {
        Unit localUnit1 = paramBoolean ? paramAnonymousUnit1 : paramAnonymousUnit2;
        Unit localUnit2 = paramBoolean ? paramAnonymousUnit2 : paramAnonymousUnit1;
        if (getColumnName(0).equals(paramObject))
        {
          if (!$assertionsDisabled) {
            throw new AssertionError(paramObject.toString());
          }
        }
        else
        {
          if (getColumnName(1).equals(paramObject)) {
            return Unit.compareDisplayNames(localUnit1, localUnit2);
          }
          if (getColumnName(2).equals(paramObject)) {
            return Unit.compareCategories(localUnit1, localUnit2);
          }
          if (getColumnName(3).equals(paramObject)) {
            return Unit.Available.compareSourceCategories(localUnit1, localUnit2);
          }
        }
        return 0;
      }
    };
  }
  
  public int getDownloadSize()
  {
    int i = 0;
    assert ((container != null) || (containerCustom != null)) : "OperationContainer found when asking for download size.";
    HashSet localHashSet1 = new HashSet();
    localHashSet1.addAll(container.listAll());
    localHashSet1.addAll(containerCustom.listAll());
    HashSet localHashSet2 = new HashSet();
    for (Iterator localIterator = localHashSet1.iterator(); localIterator.hasNext();)
    {
      localObject = (OperationContainer.OperationInfo)localIterator.next();
      localHashSet2.add(((OperationContainer.OperationInfo)localObject).getUpdateElement());
      localHashSet2.addAll(((OperationContainer.OperationInfo)localObject).getRequiredElements());
    }
    Object localObject;
    for (localIterator = localHashSet2.iterator(); localIterator.hasNext();)
    {
      localObject = (UpdateElement)localIterator.next();
      i += ((UpdateElement)localObject).getDownloadSize();
    }
    return i;
  }
  
  private String getBundle(String paramString, Object... paramVarArgs)
  {
    return NbBundle.getMessage(getClass(), paramString, paramVarArgs);
  }
  
  public String getTabTooltipText()
  {
    if (isTabEnabled()) {
      return super.getTabTooltipText();
    }
    return NbBundle.getMessage(PluginManagerUI.class, "PluginManagerUI_UnitTab_Available_ToolTip");
  }
  
  public String getTabTitle()
  {
    return NbBundle.getMessage(PluginManagerUI.class, "PluginManagerUI_UnitTab_Available_Title");
  }
  
  public int getTabIndex()
  {
    return 1;
  }
  
  public boolean isTabEnabled()
  {
    return true;
  }
  
  public boolean needsRestart()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.autoupdate.ui.AvailableTableModel
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.autoupdate.ui;

import java.awt.Color;
import javax.swing.text.DefaultHighlighter.DefaultHighlightPainter;

class ColorHighlighter$ColorHighlightPainter
  extends DefaultHighlighter.DefaultHighlightPainter
{
  public ColorHighlighter$ColorHighlightPainter(ColorHighlighter paramColorHighlighter, Color paramColor)
  {
    super(paramColor);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.autoupdate.ui.ColorHighlighter.ColorHighlightPainter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.autoupdate.ui;

import java.awt.Color;
import javax.swing.text.BadLocationException;
import javax.swing.text.DefaultHighlighter.DefaultHighlightPainter;
import javax.swing.text.Document;
import javax.swing.text.Highlighter;
import javax.swing.text.Highlighter.Highlight;
import javax.swing.text.Highlighter.HighlightPainter;
import javax.swing.text.JTextComponent;

public class ColorHighlighter
{
  private JTextComponent comp;
  private Highlighter.HighlightPainter painter;
  
  public ColorHighlighter(JTextComponent paramJTextComponent, Color paramColor)
  {
    comp = paramJTextComponent;
    painter = new ColorHighlightPainter(paramColor);
  }
  
  public int highlight(String paramString)
  {
    Highlighter localHighlighter = comp.getHighlighter();
    for (Object localObject2 : localHighlighter.getHighlights()) {
      if ((((Highlighter.Highlight)localObject2).getPainter() instanceof ColorHighlightPainter)) {
        localHighlighter.removeHighlight(localObject2);
      }
    }
    if ((paramString == null) || (paramString.equals(""))) {
      return -1;
    }
    ??? = null;
    try
    {
      Document localDocument = comp.getDocument();
      ??? = localDocument.getText(0, localDocument.getLength()).toLowerCase();
    }
    catch (BadLocationException localBadLocationException1)
    {
      return -1;
    }
    paramString = paramString.toLowerCase();
    int j = 0;
    ??? = -1;
    int m = paramString.length();
    while ((j = ((String)???).indexOf(paramString, j)) != -1)
    {
      int n = j + m;
      try
      {
        localHighlighter.addHighlight(j, n, painter);
      }
      catch (BadLocationException localBadLocationException2) {}
      if (??? == -1) {
        ??? = j;
      }
      j = n;
    }
    return ???;
  }
  
  class ColorHighlightPainter
    extends DefaultHighlighter.DefaultHighlightPainter
  {
    public ColorHighlightPainter(Color paramColor)
    {
      super();
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.autoupdate.ui.ColorHighlighter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.autoupdate.ui;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import org.netbeans.api.autoupdate.InstallSupport;
import org.netbeans.api.autoupdate.OperationContainer;
import org.netbeans.api.autoupdate.OperationSupport;

public class Containers
{
  private static Reference<OperationContainer<InstallSupport>> INSTALL;
  private static Reference<OperationContainer<InstallSupport>> INTERNAL_UPDATE;
  private static Reference<OperationContainer<InstallSupport>> UPDATE;
  private static Reference<OperationContainer<InstallSupport>> INSTALL_FOR_NBMS;
  private static Reference<OperationContainer<InstallSupport>> UPDATE_FOR_NBMS;
  private static Reference<OperationContainer<OperationSupport>> UNINSTALL;
  private static Reference<OperationContainer<OperationSupport>> ENABLE;
  private static Reference<OperationContainer<OperationSupport>> DISABLE;
  private static Reference<OperationContainer<OperationSupport>> CUSTOM_INSTALL;
  private static Reference<OperationContainer<OperationSupport>> CUSTOM_UNINSTALL;
  
  public static void initNotify()
  {
    try
    {
      forAvailableNbms().removeAll();
      forUpdateNbms().removeAll();
      forAvailable().removeAll();
      forUninstall().removeAll();
      forUpdate().removeAll();
      forEnable().removeAll();
      forDisable().removeAll();
      forCustomInstall().removeAll();
      forCustomUninstall().removeAll();
      forInternalUpdate().removeAll();
    }
    catch (NullPointerException localNullPointerException) {}
  }
  
  public static OperationContainer<InstallSupport> forAvailableNbms()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (INSTALL_FOR_NBMS != null) {
        localOperationContainer = (OperationContainer)INSTALL_FOR_NBMS.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForInstall();
        INSTALL_FOR_NBMS = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
  
  public static OperationContainer<InstallSupport> forUpdateNbms()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (UPDATE_FOR_NBMS != null) {
        localOperationContainer = (OperationContainer)UPDATE_FOR_NBMS.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForUpdate();
        UPDATE_FOR_NBMS = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
  
  public static OperationContainer<InstallSupport> forAvailable()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (INSTALL != null) {
        localOperationContainer = (OperationContainer)INSTALL.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForInstall();
        INSTALL = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
  
  public static OperationContainer<InstallSupport> forUpdate()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (UPDATE != null) {
        localOperationContainer = (OperationContainer)UPDATE.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForUpdate();
        UPDATE = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
  
  public static OperationContainer<OperationSupport> forUninstall()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (UNINSTALL != null) {
        localOperationContainer = (OperationContainer)UNINSTALL.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForUninstall();
        UNINSTALL = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
  
  public static OperationContainer<OperationSupport> forEnable()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (ENABLE != null) {
        localOperationContainer = (OperationContainer)ENABLE.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForEnable();
        ENABLE = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
  
  public static OperationContainer<OperationSupport> forDisable()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (DISABLE != null) {
        localOperationContainer = (OperationContainer)DISABLE.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForDisable();
        DISABLE = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
  
  public static OperationContainer<OperationSupport> forCustomInstall()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (CUSTOM_INSTALL != null) {
        localOperationContainer = (OperationContainer)CUSTOM_INSTALL.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForCustomInstallComponent();
        CUSTOM_INSTALL = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
  
  public static OperationContainer<OperationSupport> forCustomUninstall()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (CUSTOM_UNINSTALL != null) {
        localOperationContainer = (OperationContainer)CUSTOM_UNINSTALL.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForCustomUninstallComponent();
        CUSTOM_UNINSTALL = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
  
  public static OperationContainer<InstallSupport> forInternalUpdate()
  {
    synchronized (Containers.class)
    {
      OperationContainer localOperationContainer = null;
      if (INTERNAL_UPDATE != null) {
        localOperationContainer = (OperationContainer)INTERNAL_UPDATE.get();
      }
      if (localOperationContainer == null)
      {
        localOperationContainer = OperationContainer.createForInternalUpdate();
        INTERNAL_UPDATE = new WeakReference(localOperationContainer);
      }
      return localOperationContainer;
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.autoupdate.ui.Containers
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.autoupdate.ui;

import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkEvent.EventType;
import javax.swing.event.HyperlinkListener;

class DetailsPanel$1
  implements HyperlinkListener
{
  DetailsPanel$1(DetailsPanel paramDetailsPanel) {}
  
  public void hyperlinkUpdate(HyperlinkEvent paramHyperlinkEvent)
  {
    if ((HyperlinkEvent.EventType.ACTIVATED == paramHyperlinkEvent.getEventType()) && 
      (paramHyperlinkEvent.getURL() != null)) {
      Utilities.showURL(paramHyperlinkEvent.getURL());
    }
  }
}

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

import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import javax.accessibility.AccessibleContext;
import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.JViewport;
import javax.swing.border.Border;
import javax.swing.border.CompoundBorder;
import javax.swing.border.MatteBorder;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkEvent.EventType;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.StyledEditorKit;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.StyleSheet;
import org.openide.util.NbBundle;

public class DetailsPanel
  extends JTextPane
{
  private JScrollPane scrollPane;
  private HeaderPanel header;
  private JLabel title;
  private JButton button;
  private JButton button2;
  private JPanel rightCornerHeader;
  private HyperlinkListener hyperlinkListener;
  
  public DetailsPanel()
  {
    initComponents2();
    HTMLEditorKitEx localHTMLEditorKitEx = new HTMLEditorKitEx();
    
    StyleSheet localStyleSheet1 = localHTMLEditorKitEx.getStyleSheet();
    if (localStyleSheet1.getStyleSheets() == null)
    {
      StyleSheet localStyleSheet2 = new StyleSheet();
      Font localFont = new JList().getFont();
      int i = localFont.getSize();
      localStyleSheet2.addRule("body { font-size: " + i + "; font-family: " + localFont.getName() + "; }");
      
      localStyleSheet2.addStyleSheet(localStyleSheet1);
      localHTMLEditorKitEx.setStyleSheet(localStyleSheet2);
    }
    setEditorKit(localHTMLEditorKitEx);
    addHyperlinkListener(new HyperlinkListener()
    {
      public void hyperlinkUpdate(HyperlinkEvent paramAnonymousHyperlinkEvent)
      {
        if ((HyperlinkEvent.EventType.ACTIVATED == paramAnonymousHyperlinkEvent.getEventType()) && 
          (paramAnonymousHyperlinkEvent.getURL() != null)) {
          Utilities.showURL(paramAnonymousHyperlinkEvent.getURL());
        }
      }
    });
    setEditable(false);
    setPreferredSize(new Dimension(300, 80));
    getAccessibleContext().setAccessibleName(NbBundle.getMessage(DetailsPanel.class, "ACN_DetailsPanel"));
  }
  
  public void addNotify()
  {
    super.addNotify();
    getScrollPane();
  }
  
  public void removeNotify()
  {
    setEditorKit(new StyledEditorKit());
    if (hyperlinkListener != null) {
      removeHyperlinkListener(hyperlinkListener);
    }
    scrollPane = null;
    super.removeNotify();
  }
  
  JScrollPane getScrollPane()
  {
    if (scrollPane == null)
    {
      Container localContainer1 = getParent();
      if ((localContainer1 instanceof JViewport))
      {
        Container localContainer2 = localContainer1.getParent();
        if ((localContainer2 instanceof JScrollPane)) {
          scrollPane = ((JScrollPane)localContainer2);
        }
      }
    }
    return scrollPane;
  }
  
  public void setTitle(String paramString)
  {
    getScrollPane().setColumnHeaderView(paramString != null ? header : null);
    getScrollPane().setCorner("UPPER_RIGHT_CORNER", paramString != null ? rightCornerHeader : null);
    if (paramString != null) {
      title.setText("<html><h3>" + paramString + "</h3></html>");
    }
  }
  
  public void setActionListener(Action paramAction)
  {
    button.setVisible(paramAction != null);
    button.setEnabled(paramAction != null);
    if (paramAction != null)
    {
      button.setAction(paramAction);
      button.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DetailsPanel.class, "ACN_DetailsPanel_Button", button.getName()));
    }
  }
  
  public void setActionListener2(Action paramAction)
  {
    button2.setVisible(paramAction != null);
    button2.setEnabled(paramAction != null);
    if (paramAction != null)
    {
      button2.setAction(paramAction);
      button2.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DetailsPanel.class, "ACN_DetailsPanel_Button", button2.getName()));
    }
  }
  
  public void setEnabled(boolean paramBoolean)
  {
    super.setEnabled(paramBoolean);
    title.setEnabled(paramBoolean);
    button.setEnabled(paramBoolean);
  }
  
  JEditorPane getDetails()
  {
    return this;
  }
  
  public void setText(String paramString)
  {
    super.setText(paramString);
    validate();
  }
  
  HeaderPanel getHeader()
  {
    return header;
  }
  
  private void initComponents2()
  {
    header = new HeaderPanel();
    title = header.getTitle();
    button = header.getButton();
    button2 = header.getButton2();
    MatteBorder localMatteBorder = BorderFactory.createMatteBorder(0, 0, 1, 0, Color.gray);
    Border localBorder = BorderFactory.createEmptyBorder(3, 3, 3, 3);
    CompoundBorder localCompoundBorder = BorderFactory.createCompoundBorder(localMatteBorder, localBorder);
    header.setBorder(localCompoundBorder);
    button.setVisible(false);
    button2.setVisible(false);
    rightCornerHeader = new JPanel();
    rightCornerHeader.setBorder(localCompoundBorder);
    
    Color localColor = UnitTable.getDarkerColor(getBackground());
    header.setBackground(localColor);
    if (button != null) {
      button.setOpaque(false);
    }
    if (button2 != null) {
      button2.setOpaque(false);
    }
    rightCornerHeader.setBackground(localColor);
    setBorder(BorderFactory.createEmptyBorder(3, 3, 0, 0));
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.autoupdate.ui.DetailsPanel
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.autoupdate.ui;

import javax.swing.text.AttributeSet;
import javax.swing.text.Element;
import javax.swing.text.StyleConstants;
import javax.swing.text.View;
import javax.swing.text.html.HTML.Tag;
import javax.swing.text.html.HTMLEditorKit.HTMLFactory;

class HTMLEditorKitEx$1
  extends HTMLEditorKit.HTMLFactory
{
  HTMLEditorKitEx$1(HTMLEditorKitEx paramHTMLEditorKitEx) {}
  
  public View create(Element paramElement)
  {
    Object localObject = paramElement.getAttributes().getAttribute(StyleConstants.NameAttribute);
    return localObject == HTML.Tag.IMG ? new HTMLEditorKitEx.CachedImageView(paramElement) : super.create(paramElement);
  }
}

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

import java.awt.Image;
import java.util.Map;
import javax.swing.ImageIcon;
import javax.swing.text.Element;
import javax.swing.text.html.ImageView;

class HTMLEditorKitEx$CachedImageView
  extends ImageView
{
  HTMLEditorKitEx$CachedImageView(Element paramElement)
  {
    super(paramElement);
  }
  
  public Image getImage()
  {
    ImageIcon localImageIcon = (ImageIcon)HTMLEditorKitEx.access$000().get(getImageURL());
    return localImageIcon != null ? localImageIcon.getImage() : super.getImage();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.autoupdate.ui.HTMLEditorKitEx.CachedImageView
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.autoupdate.ui;

import java.awt.Image;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import javax.swing.ImageIcon;
import javax.swing.text.AttributeSet;
import javax.swing.text.Element;
import javax.swing.text.StyleConstants;
import javax.swing.text.View;
import javax.swing.text.ViewFactory;
import javax.swing.text.html.HTML.Tag;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.HTMLEditorKit.HTMLFactory;
import javax.swing.text.html.ImageView;
import org.netbeans.api.autoupdate.UpdateUnitProvider.CATEGORY;

public class HTMLEditorKitEx
  extends HTMLEditorKit
{
  private static final Map<URL, ImageIcon> ICONS = new HashMap();
  
  static
  {
    URL localURL1 = Utilities.getCategoryIcon(UpdateUnitProvider.CATEGORY.STANDARD);
    ICONS.put(localURL1, new ImageIcon(localURL1));
    
    URL localURL2 = Utilities.getCategoryIcon(UpdateUnitProvider.CATEGORY.BETA);
    ICONS.put(localURL2, new ImageIcon(localURL2));
    
    URL localURL3 = Utilities.getCategoryIcon(UpdateUnitProvider.CATEGORY.COMMUNITY);
    ICONS.put(localURL3, new ImageIcon(localURL3));
  }
  
  public ViewFactory getViewFactory()
  {
    new HTMLEditorKit.HTMLFactory()
    {
      public View create(Element paramAnonymousElement)
      {
        Object localObject = paramAnonymousElement.getAttributes().getAttribute(StyleConstants.NameAttribute);
        return localObject == HTML.Tag.IMG ? new HTMLEditorKitEx.CachedImageView(paramAnonymousElement) : super.create(paramAnonymousElement);
      }
    };
  }
  
  private static class CachedImageView
    extends ImageView
  {
    CachedImageView(Element paramElement)
    {
      super();
    }
    
    public Image getImage()
    {
      ImageIcon localImageIcon = (ImageIcon)HTMLEditorKitEx.ICONS.get(getImageURL());
      return localImageIcon != null ? localImageIcon.getImage() : super.getImage();
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.autoupdate.ui.HTMLEditorKitEx
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.autoupdate.ui;

import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import org.openide.util.NbBundle;

public class HeaderPanel
  extends JPanel
{
  private JButton button;
  private JButton button2;
  private JLabel title;
  
  public HeaderPanel()
  {
    initComponents();
  }
  
  public Dimension getPreferredSize()
  {
    Dimension localDimension = super.getPreferredSize();
    width = getParentgetSizewidth;
    return localDimension;
  }
  
  private void initComponents()
  {
    title = new JLabel();
    button = new JButton();
    button2 = new JButton();
    
    setLayout(new GridBagLayout());
    
    title.setText("jLabel1");
    GridBagConstraints localGridBagConstraints = new GridBagConstraints();
    fill = 2;
    weightx = 1.0D;
    add(title, localGridBagConstraints);
    
    button.setText("jButton1");
    button.setOpaque(false);
    localGridBagConstraints = new GridBagConstraints();
    gridx = 2;
    gridy = 0;
    add(button, localGridBagConstraints);
    
    button2.setText(NbBundle.getMessage(HeaderPanel.class, "HeaderPanel.button2.text"));
    button2.setOpaque(false);
    localGridBagConstraints = new GridBagConstraints();
    gridx = 1;
    gridy = 0;
    anchor = 13;
    insets = new Insets(0, 5, 0, 5);
    add(button2, localGridBagConstraints);
  }
  
  JLabel getTitle()
  {
    return title;
  }
  
  JButton getButton()
  {
    return button;
  }
  
  JButton getButton2()
  {
    return button2;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.autoupdate.ui.HeaderPanel
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.autoupdate.ui;

import java.util.Comparator;

class InstalledTableModel$1
  implements Comparator<Unit>
{
  InstalledTableModel$1(InstalledTableModel paramInstalledTableModel, boolean paramBoolean, Object paramObject) {}
  
  public int compare(Unit paramUnit1, Unit paramUnit2)
  {
    Unit localUnit1 = val$sortAscending ? paramUnit1 : paramUnit2;
    Unit localUnit2 = val$sortAscending ? paramUnit2 : paramUnit1;
    if (this$0.getColumnName(0).equals(val$columnIdentifier))
    {
      if (!$assertionsDisabled) {
        throw new AssertionError(val$columnIdentifier.toString());
      }
    }
    else
    {
      if (this$0.getColumnName(1).equals(val$columnIdentifier)) {
        return Unit.compareDisplayNames(localUnit1, localUnit2);
      }
      if (this$0.getColumnName(2).equals(val$columnIdentifier)) {
        return Unit.compareCategories(localUnit1, localUnit2);
      }
      if (this$0.getColumnName(3).equals(val$columnIdentifier)) {
        return Unit.Installed.compareEnabledState(localUnit1, localUnit2);
      }
    }
    return 0;
  }
}

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

import java.util.Comparator;
import java.util.List;
import java.util.logging.Logger;
import javax.swing.table.JTableHeader;
import org.netbeans.api.autoupdate.OperationContainer;
import org.netbeans.api.autoupdate.OperationSupport;
import org.netbeans.api.autoupdate.UpdateElement;
import org.netbeans.api.autoupdate.UpdateUnit;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor.Message;
import org.openide.util.NbBundle;

public class InstalledTableModel
  extends UnitCategoryTableModel
{
  static final String STATE_ENABLED = NbBundle.getMessage(UpdateTableModel.class, "InstalledTableModel_State_Enabled");
  static final String STATE_DISABLED = NbBundle.getMessage(UpdateTableModel.class, "InstalledTableModel_State_Disabled");
  private OperationContainer<OperationSupport> enableContainer = Containers.forEnable();
  private OperationContainer<OperationSupport> disableContainer = Containers.forDisable();
  private OperationContainer<OperationSupport> uninstallContainer = Containers.forUninstall();
  private OperationContainer<OperationSupport> containerCustom = Containers.forCustomUninstall();
  private final Logger err = Logger.getLogger("org.netbeans.modules.autoupdate.ui.InstalledTableModel");
  private static String col0;
  private static String col1;
  private static String col2;
  private static String col3;
  private boolean twoViews = true;
  
  public InstalledTableModel(List<UpdateUnit> paramList)
  {
    setUnits(paramList);
  }
  
  public final void setUnits(List<UpdateUnit> paramList)
  {
    setData(Utilities.makeInstalledCategories(paramList));
  }
  
  final void setUnits(List<UpdateUnit> paramList1, List<UpdateUnit> paramList2)
  {
    if (paramList2.isEmpty())
    {
      setUnits(paramList1);
      twoViews = false;
    }
    else
    {
      setUnits(paramList2);
      twoViews = true;
    }
  }
  
  boolean supportsTwoViews()
  {
    return twoViews;
  }
  
  public String getToolTipText(int paramInt1, int paramInt2)
  {
    Unit.Installed localInstalled;
    String str;
    UpdateElement localUpdateElement;
    if (paramInt2 == 3)
    {
      localInstalled = (Unit.Installed)getUnitAtRow(paramInt1);
      assert (localInstalled != null) : ("Unit must found at row " + paramInt1);
      str = null;
      localUpdateElement = localInstalled.getRelevantElement();
      UpdateUnit localUpdateUnit = localInstalled.getRelevantElement().getUpdateUnit();
      if (localUpdateUnit.isPending())
      {
        if ((localUpdateElement.getUpdateUnit().getInstalled() == null) || (!localUpdateElement.getUpdateUnit().getInstalled().equals(localUpdateElement))) {
          str = "InstallTab_PendingForInstall_Tooltip";
        } else {
          str = "InstallTab_PendingForDeactivate_Tooltip";
        }
      }
      else if (localUpdateElement.isEnabled()) {
        str = "InstallTab_Active_Tooltip";
      } else {
        str = "InstallTab_InActive_Tooltip";
      }
      return str != null ? getBundle(str, new Object[0]) : null;
    }
    if (paramInt2 == 0)
    {
      localInstalled = (Unit.Installed)getUnitAtRow(paramInt1);
      assert (localInstalled != null) : ("Unit must found at row " + paramInt1);
      str = null;
      localUpdateElement = localInstalled.getRelevantElement();
      if (!localInstalled.canBeMarked()) {
        str = "InstallTab_ReadOnly_Tooltip";
      }
      return str != null ? getBundle(str, new Object[] { localUpdateElement.getDisplayName() }) : super.getToolTipText(paramInt1, paramInt2);
    }
    return super.getToolTipText(paramInt1, paramInt2);
  }
  
  public void setValueAt(Object paramObject, int paramInt1, int paramInt2)
  {
    super.setValueAt(paramObject, paramInt1, paramInt2);
    if (paramInt2 == 1) {
      return;
    }
    assert (paramInt2 == 0) : "First column.";
    if (paramObject == null) {
      return;
    }
    Unit.Installed localInstalled = (Unit.Installed)getUnitAtRow(paramInt1);
    assert ((paramObject instanceof Boolean)) : (paramObject + " must be instanceof Boolean.");
    boolean bool = localInstalled.isMarked();
    if (((Boolean)paramObject).booleanValue() != bool)
    {
      localInstalled.setMarked(!bool);
      if (localInstalled.isMarked() != bool)
      {
        fireButtonsChange();
      }
      else
      {
        String str = getBundle("NotificationAlreadyPreparedToIntsall", new Object[] { localInstalled.getDisplayName() });
        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(str));
      }
    }
  }
  
  public Object getValueAt(int paramInt1, int paramInt2)
  {
    Object localObject = null;
    
    Unit.Installed localInstalled = (Unit.Installed)getUnitAtRow(paramInt1);
    switch (paramInt2)
    {
    case 0: 
      localObject = localInstalled.isMarked() ? Boolean.TRUE : Boolean.FALSE;
      break;
    case 1: 
      localObject = localInstalled.getDisplayName();
      break;
    case 2: 
      localObject = localInstalled.getCategoryName();
      break;
    case 3: 
      localObject = Boolean.valueOf(localInstalled.getRelevantElement().isEnabled());
    }
    return localObject;
  }
  
  public int getColumnCount()
  {
    return 4;
  }
  
  public Class getColumnClass(int paramInt)
  {
    Class localClass = null;
    switch (paramInt)
    {
    case 0: 
      localClass = Boolean.class;
      break;
    case 1: 
      localClass = String.class;
      break;
    case 2: 
      localClass = String.class;
      break;
    case 3: 
      localClass = Boolean.class;
    }
    return localClass;
  }
  
  public String getColumnName(int paramInt)
  {
    switch (paramInt)
    {
    case 0: 
      if (col0 == null) {
        col0 = getBundle("InstalledTableModel_Columns_Uninstall", new Object[0]);
      }
      return col0;
    case 1: 
      if (col1 == null) {
        col1 = getBundle("InstalledTableModel_Columns_Name", new Object[0]);
      }
      return col1;
    case 2: 
      if (col2 == null) {
        col2 = getBundle("InstalledTableModel_Columns_Category", new Object[0]);
      }
      return col2;
    case 3: 
      if (col3 == null) {
        col3 = getBundle("InstalledTableModel_Columns_Enabled", new Object[0]);
      }
      return col3;
    }
    if (!$assertionsDisabled) {
      throw new AssertionError();
    }
    return super.getColumnName(paramInt);
  }
  
  public int getMinWidth(JTableHeader paramJTableHeader, int paramInt)
  {
    return super.getMinWidth(paramJTableHeader, paramInt);
  }
  
  public int getPreferredWidth(JTableHeader paramJTableHeader, int paramInt)
  {
    int i = super.getMinWidth(paramJTableHeader, paramInt);
    switch (paramInt)
    {
    case 1: 
      return i * 5;
    case 2: 
      return i * 3;
    }
    return i;
  }
  
  public UnitCategoryTableModel.Type getType()
  {
    return UnitCategoryTableModel.Type.INSTALLED;
  }
  
  public boolean isSortAllowed(Object paramObject)
  {
    boolean bool = getColumnName(0).equals(paramObject);
    return !bool;
  }
  
  protected Comparator<Unit> getComparator(final Object paramObject, final boolean paramBoolean)
  {
    new Comparator()
    {
      public int compare(Unit paramAnonymousUnit1, Unit paramAnonymousUnit2)
      {
        Unit localUnit1 = paramBoolean ? paramAnonymousUnit1 : paramAnonymousUnit2;
        Unit localUnit2 = paramBoolean ? paramAnonymousUnit2 : paramAnonymousUnit1;
        if (getColumnName(0).equals(paramObject))
        {
          if (!$assertionsDisabled) {
            throw new AssertionError(paramObject.toString());
          }
        }
        else
        {
          if (getColumnName(1).equals(paramObject)) {
            return Unit.compareDisplayNames(localUnit1, localUnit2);
          }
          if (getColumnName(2).equals(paramObject)) {
            return Unit.compareCategories(localUnit1, localUnit2);
          }
          if (getColumnName(3).equals(paramObject)) {
            return Unit.Installed.compareEnabledState(localUnit1, loc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

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