org-netbeans-modules-autoupdate-ui

ectionModel().setSelectionInterval(m, m);
                    Rectangle localRectangle2 = getCellRect(m, 0, true);
                    scrollRectToVisible(localRectangle2);
                  }
                }
              }
            }
          }
        }
      });
      setReorderingAllowed(false);
    }
    
    public void setDraggedColumn(TableColumn paramTableColumn)
    {
      if ((null != paramTableColumn) && (paramTableColumn.getModelIndex() == 0)) {
        return;
      }
      super.setDraggedColumn(paramTableColumn);
    }
    
    public void setDefaultRenderer(TableCellRenderer paramTableCellRenderer)
    {
      if (!(paramTableCellRenderer instanceof SortColumnHeaderRenderer))
      {
        sortingRenderer = new SortColumnHeaderRenderer((UnitCategoryTableModel)getModel(), paramTableCellRenderer);
        paramTableCellRenderer = sortingRenderer;
      }
      super.setDefaultRenderer(paramTableCellRenderer);
    }
    
    public void setResizingColumn(TableColumn paramTableColumn)
    {
      if ((null != getResizingColumn()) && (null == paramTableColumn)) {}
      super.setResizingColumn(paramTableColumn);
    }
    
    public void setDefaultSorting()
    {
      if (sortingRenderer != null) {
        sortingRenderer.setDefaultSorting();
      }
    }
  }
  
  private class MoreRenderer
    extends DefaultTableCellRenderer
  {
    private MoreRenderer() {}
    
    public Component getTableCellRendererComponent(JTable paramJTable, Object paramObject, boolean paramBoolean1, boolean paramBoolean2, int paramInt1, int paramInt2)
    {
      Object localObject = super.getTableCellRendererComponent(paramJTable, paramObject, paramBoolean1, paramBoolean2, paramInt1, paramInt2);
      if ((localObject == null) || (paramObject == null)) {
        return (Component)localObject;
      }
      if ((paramInt2 == 1) && ((localObject instanceof JLabel)))
      {
        JLabel localJLabel = (JLabel)localObject;
        StringBuilder localStringBuilder = new StringBuilder();
        if ((paramBoolean1) || (paramBoolean2)) {
          localStringBuilder.append("<b>").append(model.getExpansionControlText()).append("</b>");
        } else {
          localStringBuilder.append(model.getExpansionControlText());
        }
        setEnabled(paramBoolean1);
        localJLabel.setText("<html><a href=\"\">" + localStringBuilder.toString() + "</a></html>");
      }
      else if (paramInt2 != 1)
      {
        localObject = new JLabel();
      }
      return (Component)localObject;
    }
  }
}

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

import java.util.Comparator;

class UpdateTableModel$1
  implements Comparator<Unit>
{
  UpdateTableModel$1(UpdateTableModel paramUpdateTableModel, 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);
      }
    }
    return 0;
  }
}

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

public class UpdateTableModel$DisplayName
{
  public UpdateTableModel$DisplayName(UpdateTableModel paramUpdateTableModel, String paramString) {}
}

/* Location:
 * Qualified Name:     org.netbeans.modules.autoupdate.ui.UpdateTableModel.DisplayName
 * 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.InstallSupport;
import org.netbeans.api.autoupdate.OperationContainer;
import org.netbeans.api.autoupdate.OperationContainer.OperationInfo;
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 UpdateTableModel
  extends UnitCategoryTableModel
{
  private OperationContainer<InstallSupport> container = Containers.forUpdate();
  private OperationContainer<OperationSupport> containerCustom = Containers.forCustomInstall();
  private static String col0;
  private static String col1;
  private static String col2;
  
  public UpdateTableModel(List<UpdateUnit> paramList)
  {
    setUnits(paramList);
  }
  
  public final void setUnits(List<UpdateUnit> paramList)
  {
    setData(Utilities.makeUpdateCategories(paramList, false));
  }
  
  public void setValueAt(Object paramObject, int paramInt1, int paramInt2)
  {
    if (isExpansionControlAtRow(paramInt1)) {
      return;
    }
    if (paramInt2 == 1) {
      return;
    }
    super.setValueAt(paramObject, paramInt1, paramInt2);
    Unit localUnit = getUnitAtRow(paramInt1);
    assert ((paramObject instanceof Boolean)) : (paramObject + " must be instanceof Boolean.");
    boolean bool = localUnit.isMarked();
    if (((Boolean)paramObject).booleanValue() != bool)
    {
      localUnit.setMarked(!bool);
      if (localUnit.isMarked() != bool)
      {
        fireButtonsChange();
      }
      else
      {
        String str = NbBundle.getMessage(UpdateTableModel.class, "NotificationAlreadyPreparedToIntsall", localUnit.getDisplayName());
        DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(str));
      }
    }
  }
  
  public Object getValueAt(int paramInt1, int paramInt2)
  {
    Object localObject = null;
    if (isExpansionControlAtRow(paramInt1)) {
      return "";
    }
    Unit localUnit = getUnitAtRow(paramInt1);
    switch (paramInt2)
    {
    case 0: 
      localObject = localUnit.isMarked() ? Boolean.TRUE : Boolean.FALSE;
      break;
    case 1: 
      localObject = localUnit.getDisplayName();
      break;
    case 2: 
      localObject = localUnit.getCategoryName();
    }
    return localObject;
  }
  
  public int getColumnCount()
  {
    return 3;
  }
  
  public Class getColumnClass(int paramInt)
  {
    Class localClass = null;
    switch (paramInt)
    {
    case 0: 
      localClass = Boolean.class;
      break;
    case 1: 
      localClass = DisplayName.class;
      break;
    case 2: 
      localClass = String.class;
    }
    return localClass;
  }
  
  public String getColumnName(int paramInt)
  {
    switch (paramInt)
    {
    case 0: 
      if (col0 == null) {
        col0 = getBundle("UpdateTableModel_Columns_Update");
      }
      return col0;
    case 1: 
      if (col1 == null) {
        col1 = getBundle("UpdateTableModel_Columns_Name");
      }
      return col1;
    case 2: 
      if (col2 == null) {
        col2 = getBundle("UpdateTableModel_Columns_Category");
      }
      return col2;
    }
    if (!$assertionsDisabled) {
      throw new AssertionError();
    }
    return super.getColumnName(paramInt);
  }
  
  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.UPDATE;
  }
  
  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);
          }
        }
        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)
  {
    return NbBundle.getMessage(getClass(), paramString);
  }
  
  public String getTabTitle()
  {
    return NbBundle.getMessage(PluginManagerUI.class, "PluginManagerUI_UnitTab_Update_Title");
  }
  
  public String getTabTooltipText()
  {
    if (isTabEnabled()) {
      return super.getTabTooltipText();
    }
    return NbBundle.getMessage(PluginManagerUI.class, "PluginManagerUI_UnitTab_Update_ToolTip");
  }
  
  public int getTabIndex()
  {
    return 0;
  }
  
  public boolean isTabEnabled()
  {
    return true;
  }
  
  public boolean needsRestart()
  {
    return true;
  }
  
  public class DisplayName
  {
    public DisplayName(String paramString) {}
  }
}

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

public abstract interface UpdateUnitListener
{
  public abstract void updateUnitsChanged();
  
  public abstract void buttonsChanged();
  
  public abstract void filterChanged();
}

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

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Set;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import org.openide.util.NbBundle;

class UpdateUnitProviderPanel$1
  implements DocumentListener
{
  UpdateUnitProviderPanel$1(UpdateUnitProviderPanel paramUpdateUnitProviderPanel) {}
  
  public void insertUpdate(DocumentEvent paramDocumentEvent)
  {
    update();
  }
  
  public void removeUpdate(DocumentEvent paramDocumentEvent)
  {
    update();
  }
  
  public void changedUpdate(DocumentEvent paramDocumentEvent)
  {
    update();
  }
  
  private void update()
  {
    this$0.updateErrorMessage(getErrorMessage());
  }
  
  private String getErrorMessage()
  {
    String str1 = this$0.getProviderName();
    String str2 = this$0.getProviderURL();
    if (str1.length() == 0) {
      return NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.error.name.short");
    }
    if (str2.length() == 0) {
      return NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.error.url.short");
    }
    if (((!UpdateUnitProviderPanel.access$000(this$0)) || (!str1.equals(UpdateUnitProviderPanel.access$100(this$0)))) && (UpdateUnitProviderPanel.access$200(this$0).contains(str1))) {
      return NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.error.name.dup");
    }
    int i = 1;
    try
    {
      new URI(str2).toURL();
      if ((str2.startsWith("http:")) && (!str2.startsWith("http://"))) {
        i = 0;
      }
      if (i != 0) {
        if ((str1 + "_removed").length() > 80) {
          i = 0;
        }
      }
    }
    catch (MalformedURLException localMalformedURLException)
    {
      i = 0;
    }
    catch (URISyntaxException localURISyntaxException)
    {
      i = 0;
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      i = 0;
    }
    if (i == 0) {
      return NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.error.url.invalid");
    }
    return null;
  }
}

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

import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.JTextField;

class UpdateUnitProviderPanel$2
  implements FocusListener
{
  int currentSelectionStart = 0;
  int currentSelectionEnd = 0;
  
  UpdateUnitProviderPanel$2(UpdateUnitProviderPanel paramUpdateUnitProviderPanel) {}
  
  public void focusGained(FocusEvent paramFocusEvent)
  {
    if (paramFocusEvent.getOppositeComponent() != null) {
      UpdateUnitProviderPanel.access$300(this$0).selectAll();
    } else {
      UpdateUnitProviderPanel.access$300(this$0).select(currentSelectionStart, currentSelectionEnd);
    }
  }
  
  public void focusLost(FocusEvent paramFocusEvent)
  {
    currentSelectionStart = UpdateUnitProviderPanel.access$300(this$0).getSelectionStart();
    currentSelectionEnd = UpdateUnitProviderPanel.access$300(this$0).getSelectionEnd();
    UpdateUnitProviderPanel.access$300(this$0).select(0, 0);
  }
}

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

import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import javax.swing.JTextField;

class UpdateUnitProviderPanel$3
  implements FocusListener
{
  int currentSelectionStart = 0;
  int currentSelectionEnd = 0;
  
  UpdateUnitProviderPanel$3(UpdateUnitProviderPanel paramUpdateUnitProviderPanel) {}
  
  public void focusGained(FocusEvent paramFocusEvent)
  {
    if (paramFocusEvent.getOppositeComponent() != null) {
      UpdateUnitProviderPanel.access$400(this$0).selectAll();
    } else {
      UpdateUnitProviderPanel.access$400(this$0).select(currentSelectionStart, currentSelectionEnd);
    }
  }
  
  public void focusLost(FocusEvent paramFocusEvent)
  {
    currentSelectionStart = UpdateUnitProviderPanel.access$400(this$0).getSelectionStart();
    currentSelectionEnd = UpdateUnitProviderPanel.access$400(this$0).getSelectionEnd();
    UpdateUnitProviderPanel.access$400(this$0).select(0, 0);
  }
}

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

import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashSet;
import java.util.Set;
import javax.accessibility.AccessibleContext;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.GroupLayout.ParallelGroup;
import javax.swing.GroupLayout.SequentialGroup;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.Document;
import org.netbeans.api.autoupdate.UpdateUnitProvider;
import org.netbeans.api.autoupdate.UpdateUnitProviderFactory;
import org.openide.awt.Mnemonics;
import org.openide.util.ImageUtilities;
import org.openide.util.NbBundle;

public class UpdateUnitProviderPanel
  extends JPanel
{
  private DocumentListener listener;
  private FocusListener focusNameListener;
  private FocusListener focusUrlListener;
  private JButton bOK = new JButton(NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel_OK"));
  private Set<String> namesOfProviders = null;
  private boolean isEdit;
  private String originalName;
  private Icon errorIcon = ImageUtilities.loadImageIcon("org/netbeans/modules/autoupdate/ui/resources/error.png", false);
  private JCheckBox cbActive;
  private JLabel errorLabel;
  private JLabel lName;
  private JLabel lURL;
  private JTextField tfName;
  private JTextField tfURL;
  
  public UpdateUnitProviderPanel(boolean paramBoolean1, String paramString1, String paramString2, boolean paramBoolean2)
  {
    isEdit = paramBoolean2;
    originalName = paramString1;
    initComponents();
    addListeners();
    tfURL.setText(paramString2);
    tfName.setText(paramString1);
    cbActive.setSelected(paramBoolean1);
    getAccessibleContext().setAccessibleName("ACN_UpdateCenterCustomizer");
    getAccessibleContext().setAccessibleDescription("ACD_UpdateCenterCustomizer");
  }
  
  JButton getOKButton()
  {
    return bOK;
  }
  
  public void addNotify()
  {
    super.addNotify();
    addListeners();
  }
  
  public void updateErrorMessage(String paramString)
  {
    if (paramString == null)
    {
      errorLabel.setText("");
      errorLabel.setIcon(null);
      bOK.setEnabled(true);
    }
    else
    {
      errorLabel.setText(paramString);
      errorLabel.setIcon(errorIcon);
      bOK.setEnabled(false);
    }
  }
  
  private void addListeners()
  {
    if (listener == null)
    {
      listener = new DocumentListener()
      {
        public void insertUpdate(DocumentEvent paramAnonymousDocumentEvent)
        {
          update();
        }
        
        public void removeUpdate(DocumentEvent paramAnonymousDocumentEvent)
        {
          update();
        }
        
        public void changedUpdate(DocumentEvent paramAnonymousDocumentEvent)
        {
          update();
        }
        
        private void update()
        {
          updateErrorMessage(getErrorMessage());
        }
        
        private String getErrorMessage()
        {
          String str1 = getProviderName();
          String str2 = getProviderURL();
          if (str1.length() == 0) {
            return NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.error.name.short");
          }
          if (str2.length() == 0) {
            return NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.error.url.short");
          }
          if (((!isEdit) || (!str1.equals(originalName))) && (UpdateUnitProviderPanel.this.getNamesOfProviders().contains(str1))) {
            return NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.error.name.dup");
          }
          int i = 1;
          try
          {
            new URI(str2).toURL();
            if ((str2.startsWith("http:")) && (!str2.startsWith("http://"))) {
              i = 0;
            }
            if (i != 0) {
              if ((str1 + "_removed").length() > 80) {
                i = 0;
              }
            }
          }
          catch (MalformedURLException localMalformedURLException)
          {
            i = 0;
          }
          catch (URISyntaxException localURISyntaxException)
          {
            i = 0;
          }
          catch (IllegalArgumentException localIllegalArgumentException)
          {
            i = 0;
          }
          if (i == 0) {
            return NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.error.url.invalid");
          }
          return null;
        }
      };
      focusNameListener = new FocusListener()
      {
        int currentSelectionStart = 0;
        int currentSelectionEnd = 0;
        
        public void focusGained(FocusEvent paramAnonymousFocusEvent)
        {
          if (paramAnonymousFocusEvent.getOppositeComponent() != null) {
            tfName.selectAll();
          } else {
            tfName.select(currentSelectionStart, currentSelectionEnd);
          }
        }
        
        public void focusLost(FocusEvent paramAnonymousFocusEvent)
        {
          currentSelectionStart = tfName.getSelectionStart();
          currentSelectionEnd = tfName.getSelectionEnd();
          tfName.select(0, 0);
        }
      };
      tfName.addFocusListener(focusNameListener);
      
      focusUrlListener = new FocusListener()
      {
        int currentSelectionStart = 0;
        int currentSelectionEnd = 0;
        
        public void focusGained(FocusEvent paramAnonymousFocusEvent)
        {
          if (paramAnonymousFocusEvent.getOppositeComponent() != null) {
            tfURL.selectAll();
          } else {
            tfURL.select(currentSelectionStart, currentSelectionEnd);
          }
        }
        
        public void focusLost(FocusEvent paramAnonymousFocusEvent)
        {
          currentSelectionStart = tfURL.getSelectionStart();
          currentSelectionEnd = tfURL.getSelectionEnd();
          tfURL.select(0, 0);
        }
      };
      tfURL.addFocusListener(focusUrlListener);
      
      tfName.getDocument().addDocumentListener(listener);
      tfURL.getDocument().addDocumentListener(listener);
    }
  }
  
  private Set<String> getNamesOfProviders()
  {
    if (namesOfProviders == null)
    {
      namesOfProviders = new HashSet();
      for (UpdateUnitProvider localUpdateUnitProvider : UpdateUnitProviderFactory.getDefault().getUpdateUnitProviders(false)) {
        namesOfProviders.add(localUpdateUnitProvider.getDisplayName());
      }
    }
    return namesOfProviders;
  }
  
  private void removeListener()
  {
    if (listener != null)
    {
      tfName.getDocument().removeDocumentListener(listener);
      tfURL.getDocument().removeDocumentListener(listener);
      tfName.removeFocusListener(focusNameListener);
      tfURL.removeFocusListener(focusUrlListener);
      listener = null;
    }
  }
  
  public void removeNotify()
  {
    super.removeNotify();
    removeListener();
  }
  
  public String getDisplayName()
  {
    return NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel_displayName");
  }
  
  public boolean isActive()
  {
    return cbActive.isSelected();
  }
  
  public String getProviderName()
  {
    return tfName.getText().trim();
  }
  
  public String getProviderURL()
  {
    return tfURL.getText().trim();
  }
  
  private void initComponents()
  {
    lName = new JLabel();
    tfName = new JTextField();
    lURL = new JLabel();
    tfURL = new JTextField();
    cbActive = new JCheckBox();
    errorLabel = new JLabel();
    
    lName.setLabelFor(tfName);
    Mnemonics.setLocalizedText(lName, NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.lName.text"));
    
    lURL.setLabelFor(tfURL);
    Mnemonics.setLocalizedText(lURL, NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.lURL.text"));
    
    Mnemonics.setLocalizedText(cbActive, NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.cbActive.text"));
    cbActive.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    
    GroupLayout localGroupLayout = new GroupLayout(this);
    setLayout(localGroupLayout);
    localGroupLayout.setHorizontalGroup(localGroupLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout.createSequentialGroup().addContainerGap().addGroup(localGroupLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(errorLabel, -1, 534, 32767).addGroup(localGroupLayout.createSequentialGroup().addGroup(localGroupLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(lName).addComponent(lURL)).addGap(15, 15, 15).addGroup(localGroupLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(tfURL, -1, 474, 32767).addComponent(tfName, -1, 474, 32767).addComponent(cbActive)))).addContainerGap()));
    
    localGroupLayout.setVerticalGroup(localGroupLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout.createSequentialGroup().addContainerGap().addGroup(localGroupLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(lName).addComponent(tfName, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(cbActive).addGap(24, 24, 24).addGroup(localGroupLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(lURL).addComponent(tfURL, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 20, 32767).addComponent(errorLabel).addContainerGap()));
    
    lName.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.lName.adesc"));
    lURL.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.lURL.adesc"));
    cbActive.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(UpdateUnitProviderPanel.class, "UpdateUnitProviderPanel.cbActive.adesc"));
  }
}

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

import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.RequestProcessor.Task;

class Utilities$1$1
  implements Runnable
{
  Utilities$1$1(Utilities.1 param1, RequestProcessor.Task paramTask, long paramLong, ProgressHandle paramProgressHandle) {}
  
  public void run()
  {
    int i = 0;
    while (!val$runnableTask.isFinished()) {
      try
      {
        if (val$friendlyEstimatedTime * 10L > i++)
        {
          val$handle.progress(this$0.val$progressDisplayName, i);
        }
        else
        {
          val$handle.switchToIndeterminate();
          val$handle.progress(this$0.val$progressDisplayName);
          return;
        }
        Thread.sleep(100L);
      }
      catch (InterruptedException localInterruptedException) {}
    }
  }
}

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

import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.Task;
import org.openide.util.TaskListener;

class Utilities$1$2
  implements TaskListener
{
  Utilities$1$2(Utilities.1 param1, ProgressHandle paramProgressHandle) {}
  
  public void taskFinished(Task paramTask)
  {
    paramTask.removeTaskListener(this);
    val$handle.finish();
  }
}

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

import javax.swing.JComponent;
import javax.swing.JLabel;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.util.RequestProcessor;
import org.openide.util.RequestProcessor.Task;
import org.openide.util.Task;
import org.openide.util.TaskListener;

final class Utilities$1
  implements Runnable
{
  Utilities$1(String paramString, PluginManagerUI paramPluginManagerUI, long paramLong, Runnable paramRunnable) {}
  
  public void run()
  {
    final ProgressHandle localProgressHandle = ProgressHandleFactory.createHandle(val$progressDisplayName);
    JComponent localJComponent = ProgressHandleFactory.createProgressComponent(localProgressHandle);
    JLabel localJLabel = ProgressHandleFactory.createDetailLabelComponent(localProgressHandle);
    try
    {
      localJLabel.setHorizontalAlignment(2);
      val$manager.setProgressComponent(localJLabel, localJComponent);
      localProgressHandle.setInitialDelay(0);
      if (val$estimatedTime == 0L)
      {
        localProgressHandle.start();
        localProgressHandle.progress(val$progressDisplayName);
        val$runnableCode.run();
      }
      else
      {
        assert (val$estimatedTime > 0L) : ("Estimated time " + val$estimatedTime);
        final long l = val$estimatedTime + 2L;
        localProgressHandle.start((int)l * 10, l);
        localProgressHandle.progress(val$progressDisplayName, 0);
        final RequestProcessor.Task localTask = RequestProcessor.getDefault().post(val$runnableCode);
        RequestProcessor.getDefault().post(new Runnable()
        {
          public void run()
          {
            int i = 0;
            while (!localTask.isFinished()) {
              try
              {
                if (l * 10L > i++)
                {
                  val$handle.progress(val$progressDisplayName, i);
                }
                else
                {
                  val$handle.switchToIndeterminate();
                  val$handle.progress(val$progressDisplayName);
                  return;
                }
                Thread.sleep(100L);
              }
              catch (InterruptedException localInterruptedException) {}
            }
          }
        });
        localTask.addTaskListener(new TaskListener()
        {
          public void taskFinished(Task paramAnonymousTask)
          {
            paramAnonymousTask.removeTaskListener(this);
            localProgressHandle.finish();
          }
        });
        localTask.waitFinished();
      }
    }
    finally
    {
      if (localProgressHandle != null) {
        localProgressHandle.finish();
      }
      val$manager.unsetProgressComponent(localJLabel, localJComponent);
    }
  }
}

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

import java.text.Collator;
import java.util.Comparator;

final class Utilities$2
  implements Comparator<String>
{
  public int compare(String paramString1, String paramString2)
  {
    if (Utilities.LIBRARIES_CATEGORY.equals(paramString1))
    {
      if (Utilities.LIBRARIES_CATEGORY.equals(paramString2)) {
        return 0;
      }
      return 1;
    }
    if (Utilities.LIBRARIES_CATEGORY.equals(paramString2)) {
      return -1;
    }
    if (Utilities.BRIDGES_CATEGORY.equals(paramString1))
    {
      if (Utilities.BRIDGES_CATEGORY.equals(paramString2)) {
        return 0;
      }
      return 1;
    }
    if (Utilities.BRIDGES_CATEGORY.equals(paramString2)) {
      return -1;
    }
    if (Utilities.UNSORTED_CATEGORY.equals(paramString1))
    {
      if (Utilities.UNSORTED_CATEGORY.equals(paramString2)) {
        return 0;
      }
      return 1;
    }
    if (Utilities.UNSORTED_CATEGORY.equals(paramString2)) {
      return -1;
    }
    return Collator.getInstance().compare(paramString1, paramString2);
  }
}

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

class Utilities$3 {}

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

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
import java.text.Collator;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Enumeration;
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 java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.prefs.Preferences;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import org.netbeans.api.autoupdate.OperationContainer;
import org.netbeans.api.autoupdate.OperationContainer.OperationInfo;
import org.netbeans.api.autoupdate.UpdateElement;
import org.netbeans.api.autoupdate.UpdateManager;
import org.netbeans.api.autoupdate.UpdateManager.TYPE;
import org.netbeans.api.autoupdate.UpdateUnit;
import org.netbeans.api.autoupdate.UpdateUnitProvider;
import org.netbeans.api.autoupdate.UpdateUnitProvider.CATEGORY;
import org.netbeans.api.autoupdate.UpdateUnitProviderFactory;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
import org.netbeans.modules.autoupdate.ui.actions.ShowNotifications;
import org.openide.awt.HtmlBrowser.URLDisplayer;
import org.openide.awt.Mnemonics;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.openide.util.NbPreferences;
import org.openide.util.RequestProcessor;
import org.openide.util.RequestProcessor.Task;
import org.openide.util.Task;
import org.openide.util.TaskListener;

public class Utilities
{
  private static Logger logger = Logger.getLogger(Utilities.class.getName());
  private static Boolean isModulesOnly;
  private static String PLUGIN_MANAGER_MODULES_ONLY = "plugin_manager_modules_only";
  private static String PLUGIN_MANAGER_SHARED_INSTALLATION = "plugin_manager_shared_installation";
  public static String PLUGIN_MANAGER_CHECK_INTERVAL = "plugin.manager.check.interval";
  public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd");
  public static final String TIME_OF_MODEL_INITIALIZATION = "time_of_model_initialization";
  public static final String TIME_OF_REFRESH_UPDATE_CENTERS = "time_of_refresh_update_centers";
  static final String UNSORTED_CATEGORY = NbBundle.getMessage(Utilities.class, "Utilities_Unsorted_Category");
  static final String LIBRARIES_CATEGORY = NbBundle.getMessage(Utilities.class, "Utilities_Libraries_Category");
  static final String BRIDGES_CATEGORY = NbBundle.getMessage(Utilities.class, "Utilities_Bridges_Category");
  private static final String FIRST_CLASS_MODULES = "org.netbeans.modules.autoupdate.services, org.netbeans.modules.autoupdate.ui";
  private static final String PLUGIN_MANAGER_FIRST_CLASS_MODULES = "plugin.manager.first.class.modules";
  private static final String ALLOW_SHOWING_BALLOON = "plugin.manager.allow.showing.balloon";
  private static final String SHOWING_BALLOON_TIMEOUT = "plugin.manager.showing.balloon.timeout";
  private static final RequestProcessor WORKER_THREADS_PROCESSOR = new RequestProcessor("autoupdate-ui-worker", 10, false);
  private static Collection<String> first_class_modules = null;
  
  public static List<UnitCategory> makeInstalledCategories(List<UpdateUnit> paramList)
  {
    ArrayList localArrayList1 = new ArrayList();
    ArrayList localArrayList2 = new ArrayList();
    for (UpdateUnit localUpdateUnit : paramList)
    {
      UpdateElement localUpdateElement = localUpdateUnit.getInstalled();
      if ((localUpdateElement != null) || (localUpdateUnit.isPending()))
      {
        String str = (localUpdateElement == null) && (localUpdateUnit.isPending()) ? ((UpdateElement)localUpdateUnit.getAvailableUpdates().get(0)).getCategory() : localUpdateElement.getCategory();
        Unit.Installed localInstalled = new Unit.Installed(localUpdateUnit, str);
        UnitCategory localUnitCategory;
        if (localArrayList2.contains(str))
        {
          localUnitCategory = (UnitCategory)localArrayList1.get(localArrayList2.indexOf(str));
          localUnitCategory.addUnit(localInstalled);
        }
        else
        {
          localUnitCategory = new UnitCategory(str);
          localUnitCategory.addUnit(localInstalled);
          localArrayList1.add(localUnitCategory);
          localArrayList2.add(str);
        }
      }
    }
    logger.log(Level.FINER, "makeInstalledCategories (" + paramList.size() + ") returns " + localArrayList1.size());
    return localArrayList1;
  }
  
  public static List<UnitCategory> makeUpdateCategories(List<UpdateUnit> paramList, boolean paramBoolean)
  {
    long l = System.currentTimeMillis();
    if ((!paramBoolean) && (!paramList.isEmpty()))
    {
      localObject1 = makeFirstClassUpdateCategories();
      if (!((List)localObject1).isEmpty()) {
        return (List<UnitCategory>)localObject1;
      }
      if (hasPendingFirstClassModules()) {
        return new ArrayList();
      }
    }
    Object localObject1 = new ArrayList();
    if (paramList.isEmpty()) {
      return (List<UnitCategory>)localObject1;
    }
    ArrayList localArrayList = new ArrayList();
    HashSet localHashSet = new HashSet();
    HashMap localHashMap = new HashMap();
    for (Object localObject2 = paramList.iterator(); ((Iterator)localObject2).hasNext();)
    {
      localObject3 = (UpdateUnit)((Iterator)localObject2).next();
      localObject4 = ((UpdateUnit)localObject3).getInstalled();
      if ((!((UpdateUnit)localObject3).isPending()) && (localObject4 != null))
      {
        localObject5 = ((UpdateUnit)localObject3).getAvailableUpdates();
        if (!((List)localObject5).isEmpty())
        {
          localHashSet.add(localObject3);
          
          localObject6 = new ArrayList();
          localObject7 = OperationContainer.createForUpdate();
          localObject8 = ((OperationContainer)localObject7).add((UpdateElement)((List)localObject5).get(0));
          Set localSet = ((OperationContainer.OperationInfo)localObject8).getRequiredElements();
          for (localObject10 = localSet.iterator(); ((Iterator)localObject10).hasNext();)
          {
            localObject11 = (UpdateElement)((Iterator)localObject10).next();
            if (!((UpdateElement)localObject11).getUpdateUnit().isPending())
            {
              localHashSet.add(((UpdateElement)localObject11).getUpdateUnit());
              ((List)localObject6).add(localObject11);
            }
          }
          for (localObject10 = ((OperationContainer)localObject7).listAll().iterator(); ((Iterator)localObject10).hasNext();)
          {
            localObject11 = (OperationContainer.OperationInfo)((Iterator)localObject10).next();
            if (!((OperationContainer.OperationInfo)localObject11).getUpdateUnit().isPending())
            {
              localHashSet.add(((OperationContainer.OperationInfo)localObject11).getUpdateUnit());
              if (!((UpdateUnit)localObject3).equals(((OperationContainer.OperationInfo)localObject11).getUpdateUnit())) {
                ((List)localObject6).add(((OperationContainer.OperationInfo)localObject11).getUpdateElement());
              }
            }
          }
          localObject10 = ((UpdateElement)localObject4).getCategory();
          if (localArrayList.contains(localObject10))
          {
            localObject11 = (UnitCategory)((List)localObject1).get(localArrayList.indexOf(localObject10));
            ((Unit
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