org-netbeans-modules-autoupdate-ui

c WizardDescriptor.Panel<WizardDescriptor> current()
  {
    assert (panels != null);
    return (WizardDescriptor.Panel)panels.get(index);
  }
  
  public String name()
  {
    return NbBundle.getMessage(InstallUnitWizardIterator.class, "InstallUnitWizard_Title");
  }
  
  public boolean hasNext()
  {
    compactPanels();
    return index < panels.size() - 1;
  }
  
  public boolean hasPrevious()
  {
    compactPanels();
    return (index > 0) && (!(current() instanceof InstallStep)) && (!(current() instanceof CustomHandleStep));
  }
  
  public void nextPanel()
  {
    compactPanels();
    if (!hasNext()) {
      throw new NoSuchElementException();
    }
    index += 1;
  }
  
  public void previousPanel()
  {
    compactPanels();
    if (!hasPrevious()) {
      throw new NoSuchElementException();
    }
    index -= 1;
  }
  
  public void addChangeListener(ChangeListener paramChangeListener) {}
  
  public void removeChangeListener(ChangeListener paramChangeListener) {}
  
  private void compactPanels()
  {
    if (isCompact) {
      return;
    }
    boolean bool = getModel().allLicensesTouched();
    if ((bool) && (getModel().allLicensesApproved())) {
      panels.remove(licenseApprovalStep);
    }
    if (!getModel().hasCustomComponents()) {
      panels.remove(customHandleStep);
    }
    if (!getModel().hasStandardComponents()) {
      panels.remove(installStep);
    }
    isCompact = bool;
  }
}

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

class InstallUnitWizardModel$1 {}

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

import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.netbeans.api.autoupdate.InstallSupport;
import org.netbeans.api.autoupdate.InstallSupport.Installer;
import org.netbeans.api.autoupdate.OperationContainer;
import org.netbeans.api.autoupdate.OperationContainer.OperationInfo;
import org.netbeans.api.autoupdate.OperationException;
import org.netbeans.api.autoupdate.OperationSupport;
import org.netbeans.api.autoupdate.UpdateElement;
import org.netbeans.modules.autoupdate.ui.Containers;
import org.netbeans.modules.autoupdate.ui.PluginManagerUI;
import org.openide.util.Exceptions;

public class InstallUnitWizardModel
  extends OperationWizardModel
{
  private InstallSupport.Installer installer = null;
  private OperationWizardModel.OperationType doOperation;
  private static Set<String> approvedLicences = new HashSet();
  private InstallSupport support;
  private OperationContainer<InstallSupport> updateContainer = null;
  private OperationContainer<OperationSupport> customContainer = Containers.forCustomInstall();
  private PluginManagerUI manager;
  private boolean allLicensesTouched = false;
  
  public InstallUnitWizardModel(OperationWizardModel.OperationType paramOperationType, OperationContainer<InstallSupport> paramOperationContainer)
  {
    doOperation = paramOperationType;
    updateContainer = paramOperationContainer;
  }
  
  public InstallUnitWizardModel(OperationWizardModel.OperationType paramOperationType)
  {
    doOperation = paramOperationType;
    assert (getBaseContainer() != null) : ("The base container for operation " + paramOperationType + " must exist!");
  }
  
  public OperationWizardModel.OperationType getOperation()
  {
    return doOperation;
  }
  
  public OperationContainer getBaseContainer()
  {
    if (updateContainer != null)
    {
      support = ((InstallSupport)updateContainer.getSupport());
      return updateContainer;
    }
    Object localObject = null;
    switch (getOperation())
    {
    case INSTALL: 
      localObject = Containers.forAvailable();
      support = ((InstallSupport)((OperationContainer)localObject).getSupport());
      break;
    case UPDATE: 
      localObject = Containers.forUpdate();
      support = ((InstallSupport)((OperationContainer)localObject).getSupport());
      break;
    case LOCAL_DOWNLOAD: 
      OperationContainer localOperationContainer1 = Containers.forUpdateNbms();
      OperationContainer localOperationContainer2 = Containers.forAvailableNbms();
      if (localOperationContainer1.listAll().isEmpty())
      {
        localObject = localOperationContainer2;
      }
      else
      {
        localObject = localOperationContainer1;
        for (OperationContainer.OperationInfo localOperationInfo : localOperationContainer2.listAll()) {
          ((OperationContainer)localObject).add(localOperationInfo.getUpdateElement());
        }
        assert (localOperationContainer2.listInvalid().isEmpty()) : ("Containers.forAvailableNbms().listInvalid() should be empty but " + localOperationContainer2.listInvalid());
        localOperationContainer2.removeAll();
      }
      support = ((InstallSupport)((OperationContainer)localObject).getSupport());
      updateContainer = ((OperationContainer)localObject);
    }
    return (OperationContainer)localObject;
  }
  
  public OperationContainer<OperationSupport> getCustomHandledContainer()
  {
    return customContainer;
  }
  
  public boolean allLicensesApproved()
  {
    boolean bool = true;
    for (UpdateElement localUpdateElement : getAllUpdateElements()) {
      if ((localUpdateElement.getLicence() != null) && (!approvedLicences.contains(localUpdateElement.getLicence())))
      {
        bool = false;
        break;
      }
    }
    allLicensesTouched = true;
    return bool;
  }
  
  public boolean allLicensesTouched()
  {
    return allLicensesTouched;
  }
  
  public void addApprovedLicenses(Collection<String> paramCollection)
  {
    approvedLicences.addAll(paramCollection);
    allLicensesTouched = false;
  }
  
  public InstallSupport getInstallSupport()
  {
    return support;
  }
  
  public void setInstaller(InstallSupport.Installer paramInstaller)
  {
    installer = paramInstaller;
  }
  
  public InstallSupport.Installer getInstaller()
  {
    return installer;
  }
  
  public void doCleanup(boolean paramBoolean)
    throws OperationException
  {
    try
    {
      if (paramBoolean)
      {
        if ((getBaseContainer().getSupport() instanceof InstallSupport))
        {
          if (OperationWizardModel.OperationType.LOCAL_DOWNLOAD == getOperation())
          {
            localObject1 = (InstallSupport)Containers.forAvailableNbms().getSupport();
            if (localObject1 != null) {
              ((InstallSupport)localObject1).doCancel();
            }
            InstallSupport localInstallSupport = (InstallSupport)Containers.forUpdateNbms().getSupport();
            if (localInstallSupport != null) {
              localInstallSupport.doCancel();
            }
            Containers.forAvailableNbms().removeAll();
            Containers.forUpdateNbms().removeAll();
          }
          else
          {
            localObject1 = (InstallSupport)getBaseContainer().getSupport();
            if (localObject1 != null) {
              ((InstallSupport)localObject1).doCancel();
            }
          }
        }
        else
        {
          localObject1 = (OperationSupport)getBaseContainer().getSupport();
          if (localObject1 != null) {
            ((OperationSupport)localObject1).doCancel();
          }
        }
        Object localObject1 = (OperationSupport)getCustomHandledContainer().getSupport();
        if (localObject1 != null) {
          ((OperationSupport)localObject1).doCancel();
        }
      }
    }
    catch (Exception localException)
    {
      Exceptions.printStackTrace(localException);
    }
    finally
    {
      super.doCleanup(false);
    }
  }
  
  public PluginManagerUI getPluginManager()
  {
    return manager;
  }
  
  public void setPluginManager(PluginManagerUI paramPluginManagerUI)
  {
    manager = paramPluginManagerUI;
  }
}

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

import java.util.Collection;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import org.netbeans.api.autoupdate.UpdateElement;
import org.netbeans.api.autoupdate.UpdateUnit;
import org.netbeans.modules.autoupdate.ui.actions.AutoupdateCheckScheduler;
import org.openide.util.NbPreferences;

public class LazyInstallUnitWizardIterator$LazyUnit
{
  private String codeName;
  private String displayName;
  private String oldVersion;
  private String newVersion;
  private String notification;
  private static final String DELIMETER = "|";
  
  private LazyInstallUnitWizardIterator$LazyUnit(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
  {
    codeName = paramString1;
    displayName = paramString2;
    oldVersion = paramString3;
    newVersion = paramString4;
    notification = paramString5;
  }
  
  public static void storeUpdateElements(OperationWizardModel.OperationType paramOperationType, Collection<UpdateElement> paramCollection)
  {
    Preferences localPreferences = getPreferences(paramOperationType);
    try
    {
      if (localPreferences.keys().length > 0) {
        localPreferences.clear();
      }
    }
    catch (BackingStoreException localBackingStoreException)
    {
      Logger.getLogger(LazyInstallUnitWizardIterator.class.getName()).log(Level.WARNING, localBackingStoreException.getLocalizedMessage(), localBackingStoreException);
    }
    if (paramCollection == null) {
      return;
    }
    for (UpdateElement localUpdateElement : paramCollection) {
      localPreferences.put(localUpdateElement.getCodeName(), toString(localUpdateElement));
    }
  }
  
  public static void storeLazyUnits(OperationWizardModel.OperationType paramOperationType, Collection<LazyUnit> paramCollection)
  {
    Preferences localPreferences = getPreferences(paramOperationType);
    try
    {
      if (localPreferences.keys().length > 0) {
        localPreferences.clear();
      }
    }
    catch (BackingStoreException localBackingStoreException)
    {
      Logger.getLogger(LazyInstallUnitWizardIterator.class.getName()).log(Level.WARNING, localBackingStoreException.getLocalizedMessage(), localBackingStoreException);
    }
    if (paramCollection == null) {
      return;
    }
    for (LazyUnit localLazyUnit : paramCollection) {
      localPreferences.put(localLazyUnit.getCodeName(), localLazyUnit.toString());
    }
  }
  
  public static Collection<LazyUnit> loadLazyUnits(OperationWizardModel.OperationType paramOperationType)
  {
    Preferences localPreferences = getPreferences(paramOperationType);
    HashSet localHashSet = new HashSet();
    try
    {
      for (String str : localPreferences.keys()) {
        localHashSet.add(parseLazyUnit(localPreferences.get(str, null)));
      }
    }
    catch (BackingStoreException localBackingStoreException)
    {
      Logger.getLogger(LazyInstallUnitWizardIterator.class.getName()).log(Level.WARNING, localBackingStoreException.getLocalizedMessage(), localBackingStoreException);
      return null;
    }
    return localHashSet;
  }
  
  public String getCodeName()
  {
    return codeName;
  }
  
  public String getDisplayName()
  {
    return displayName == null ? codeName : displayName;
  }
  
  public String getOldVersion()
  {
    return oldVersion == null ? "" : oldVersion.trim();
  }
  
  public String getNewVersion()
  {
    return newVersion == null ? "" : newVersion.trim();
  }
  
  public String getNotification()
  {
    return notification == null ? "" : notification.trim();
  }
  
  public String toString()
  {
    return codeName + "|" + (displayName == null ? codeName : displayName) + "|" + (oldVersion == null ? " " : oldVersion) + "|" + (newVersion == null ? " " : newVersion) + "|" + (notification == null ? " " : notification);
  }
  
  public static String toString(UpdateElement paramUpdateElement)
  {
    return paramUpdateElement.getCodeName() + "|" + (paramUpdateElement.getDisplayName() == null ? paramUpdateElement.getCodeName() : paramUpdateElement.getDisplayName()) + "|" + (paramUpdateElement.getUpdateUnit().getInstalled() == null ? " " : paramUpdateElement.getUpdateUnit().getInstalled().getSpecificationVersion()) + "|" + (paramUpdateElement.getSpecificationVersion() == null ? " " : paramUpdateElement.getSpecificationVersion()) + "|" + (paramUpdateElement.getNotification() == null ? " " : paramUpdateElement.getNotification());
  }
  
  private static LazyUnit parseLazyUnit(String paramString)
  {
    StringTokenizer localStringTokenizer = new StringTokenizer(paramString, "|");
    assert (5 == localStringTokenizer.countTokens()) : ("5 tokens for " + paramString);
    String str1 = localStringTokenizer.nextToken();
    String str2 = localStringTokenizer.nextToken();
    String str3 = localStringTokenizer.nextToken();
    String str4 = localStringTokenizer.nextToken();
    String str5 = localStringTokenizer.nextToken();
    return new LazyUnit(str1, str2, str3, str4, str5);
  }
  
  private static Preferences getPreferences(OperationWizardModel.OperationType paramOperationType)
  {
    return NbPreferences.forModule(AutoupdateCheckScheduler.class).node(paramOperationType.toString());
  }
}

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import javax.swing.event.ChangeListener;
import org.netbeans.api.autoupdate.UpdateElement;
import org.netbeans.api.autoupdate.UpdateUnit;
import org.netbeans.modules.autoupdate.ui.actions.AutoupdateCheckScheduler;
import org.openide.WizardDescriptor;
import org.openide.WizardDescriptor.Iterator;
import org.openide.WizardDescriptor.Panel;
import org.openide.util.NbBundle;
import org.openide.util.NbPreferences;

public final class LazyInstallUnitWizardIterator
  implements WizardDescriptor.Iterator<WizardDescriptor>
{
  private int index;
  private List<WizardDescriptor.Panel<WizardDescriptor>> panels = new ArrayList();
  private Collection<LazyUnit> installModel;
  private OperationWizardModel.OperationType doOperation;
  private boolean forceReload;
  
  public LazyInstallUnitWizardIterator(Collection<LazyUnit> paramCollection, OperationWizardModel.OperationType paramOperationType, boolean paramBoolean)
  {
    installModel = paramCollection;
    doOperation = paramOperationType;
    forceReload = paramBoolean;
    createPanels();
    index = 0;
  }
  
  private void createPanels()
  {
    assert ((panels != null) && (panels.isEmpty())) : "Panels are still empty";
    panels.add(new LazyOperationDescriptionStep(installModel, doOperation, forceReload));
  }
  
  public WizardDescriptor.Panel<WizardDescriptor> current()
  {
    assert (panels != null);
    return (WizardDescriptor.Panel)panels.get(index);
  }
  
  public String name()
  {
    return NbBundle.getMessage(LazyInstallUnitWizardIterator.class, "InstallUnitWizard_Title");
  }
  
  public boolean hasNext()
  {
    return false;
  }
  
  public boolean hasPrevious()
  {
    return false;
  }
  
  public void nextPanel() {}
  
  public void previousPanel() {}
  
  public synchronized void addChangeListener(ChangeListener paramChangeListener) {}
  
  public synchronized void removeChangeListener(ChangeListener paramChangeListener) {}
  
  public static class LazyUnit
  {
    private String codeName;
    private String displayName;
    private String oldVersion;
    private String newVersion;
    private String notification;
    private static final String DELIMETER = "|";
    
    private LazyUnit(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5)
    {
      codeName = paramString1;
      displayName = paramString2;
      oldVersion = paramString3;
      newVersion = paramString4;
      notification = paramString5;
    }
    
    public static void storeUpdateElements(OperationWizardModel.OperationType paramOperationType, Collection<UpdateElement> paramCollection)
    {
      Preferences localPreferences = getPreferences(paramOperationType);
      try
      {
        if (localPreferences.keys().length > 0) {
          localPreferences.clear();
        }
      }
      catch (BackingStoreException localBackingStoreException)
      {
        Logger.getLogger(LazyInstallUnitWizardIterator.class.getName()).log(Level.WARNING, localBackingStoreException.getLocalizedMessage(), localBackingStoreException);
      }
      if (paramCollection == null) {
        return;
      }
      for (UpdateElement localUpdateElement : paramCollection) {
        localPreferences.put(localUpdateElement.getCodeName(), toString(localUpdateElement));
      }
    }
    
    public static void storeLazyUnits(OperationWizardModel.OperationType paramOperationType, Collection<LazyUnit> paramCollection)
    {
      Preferences localPreferences = getPreferences(paramOperationType);
      try
      {
        if (localPreferences.keys().length > 0) {
          localPreferences.clear();
        }
      }
      catch (BackingStoreException localBackingStoreException)
      {
        Logger.getLogger(LazyInstallUnitWizardIterator.class.getName()).log(Level.WARNING, localBackingStoreException.getLocalizedMessage(), localBackingStoreException);
      }
      if (paramCollection == null) {
        return;
      }
      for (LazyUnit localLazyUnit : paramCollection) {
        localPreferences.put(localLazyUnit.getCodeName(), localLazyUnit.toString());
      }
    }
    
    public static Collection<LazyUnit> loadLazyUnits(OperationWizardModel.OperationType paramOperationType)
    {
      Preferences localPreferences = getPreferences(paramOperationType);
      HashSet localHashSet = new HashSet();
      try
      {
        for (String str : localPreferences.keys()) {
          localHashSet.add(parseLazyUnit(localPreferences.get(str, null)));
        }
      }
      catch (BackingStoreException localBackingStoreException)
      {
        Logger.getLogger(LazyInstallUnitWizardIterator.class.getName()).log(Level.WARNING, localBackingStoreException.getLocalizedMessage(), localBackingStoreException);
        return null;
      }
      return localHashSet;
    }
    
    public String getCodeName()
    {
      return codeName;
    }
    
    public String getDisplayName()
    {
      return displayName == null ? codeName : displayName;
    }
    
    public String getOldVersion()
    {
      return oldVersion == null ? "" : oldVersion.trim();
    }
    
    public String getNewVersion()
    {
      return newVersion == null ? "" : newVersion.trim();
    }
    
    public String getNotification()
    {
      return notification == null ? "" : notification.trim();
    }
    
    public String toString()
    {
      return codeName + "|" + (displayName == null ? codeName : displayName) + "|" + (oldVersion == null ? " " : oldVersion) + "|" + (newVersion == null ? " " : newVersion) + "|" + (notification == null ? " " : notification);
    }
    
    public static String toString(UpdateElement paramUpdateElement)
    {
      return paramUpdateElement.getCodeName() + "|" + (paramUpdateElement.getDisplayName() == null ? paramUpdateElement.getCodeName() : paramUpdateElement.getDisplayName()) + "|" + (paramUpdateElement.getUpdateUnit().getInstalled() == null ? " " : paramUpdateElement.getUpdateUnit().getInstalled().getSpecificationVersion()) + "|" + (paramUpdateElement.getSpecificationVersion() == null ? " " : paramUpdateElement.getSpecificationVersion()) + "|" + (paramUpdateElement.getNotification() == null ? " " : paramUpdateElement.getNotification());
    }
    
    private static LazyUnit parseLazyUnit(String paramString)
    {
      StringTokenizer localStringTokenizer = new StringTokenizer(paramString, "|");
      assert (5 == localStringTokenizer.countTokens()) : ("5 tokens for " + paramString);
      String str1 = localStringTokenizer.nextToken();
      String str2 = localStringTokenizer.nextToken();
      String str3 = localStringTokenizer.nextToken();
      String str4 = localStringTokenizer.nextToken();
      String str5 = localStringTokenizer.nextToken();
      return new LazyUnit(str1, str2, str3, str4, str5);
    }
    
    private static Preferences getPreferences(OperationWizardModel.OperationType paramOperationType)
    {
      return NbPreferences.forModule(AutoupdateCheckScheduler.class).node(paramOperationType.toString());
    }
  }
}

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

import java.util.Collection;
import org.netbeans.modules.autoupdate.ui.actions.AutoupdateCheckScheduler;
import org.openide.WizardDescriptor;
import org.openide.WizardDescriptor.Iterator;

class LazyOperationDescriptionStep$1$1
  implements Runnable
{
  LazyOperationDescriptionStep$1$1(LazyOperationDescriptionStep.1 param1, WizardDescriptor.Iterator paramIterator, Collection paramCollection) {}
  
  public void run()
  {
    LazyOperationDescriptionStep.access$300(this$1.this$0).setPanelsAndSettings(val$panels, LazyOperationDescriptionStep.access$300(this$1.this$0));
    LazyOperationDescriptionStep.access$400(this$1.this$0);
    LazyInstallUnitWizardIterator.LazyUnit.storeUpdateElements(LazyOperationDescriptionStep.access$000(this$1.this$0), val$updates);
    AutoupdateCheckScheduler.notifyAvailable(LazyInstallUnitWizardIterator.LazyUnit.loadLazyUnits(LazyOperationDescriptionStep.access$000(this$1.this$0)), LazyOperationDescriptionStep.access$000(this$1.this$0));
  }
}

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

import java.util.Collection;
import java.util.Iterator;
import javax.swing.SwingUtilities;
import org.netbeans.api.autoupdate.OperationContainer;
import org.netbeans.api.autoupdate.UpdateElement;
import org.netbeans.api.autoupdate.UpdateManager.TYPE;
import org.netbeans.api.autoupdate.UpdateUnit;
import org.netbeans.modules.autoupdate.ui.actions.AutoupdateCheckScheduler;
import org.openide.WizardDescriptor;
import org.openide.WizardDescriptor.Iterator;

class LazyOperationDescriptionStep$1
  implements Runnable
{
  LazyOperationDescriptionStep$1(LazyOperationDescriptionStep paramLazyOperationDescriptionStep, Collection paramCollection) {}
  
  public void run()
  {
    final Collection localCollection = AutoupdateCheckScheduler.checkUpdateElements(LazyOperationDescriptionStep.access$000(this$0), val$problems, LazyOperationDescriptionStep.access$100(this$0));
    LazyOperationDescriptionStep.access$202(this$0, (localCollection != null) && (!localCollection.isEmpty()));
    if (LazyOperationDescriptionStep.access$200(this$0))
    {
      assert (LazyOperationDescriptionStep.access$300(this$0) != null) : "WizardDescriptor must found!";
      OperationContainer localOperationContainer = OperationWizardModel.OperationType.UPDATE == LazyOperationDescriptionStep.access$000(this$0) ? OperationContainer.createForUpdate() : OperationContainer.createForInstall();
      
      boolean bool = true;
      InstallUnitWizardModel localInstallUnitWizardModel = new InstallUnitWizardModel(LazyOperationDescriptionStep.access$000(this$0), localOperationContainer);
      for (final Object localObject = localCollection.iterator(); ((Iterator)localObject).hasNext();)
      {
        localUpdateElement = (UpdateElement)((Iterator)localObject).next();
        localUpdateUnit = localUpdateElement.getUpdateUnit();
        if (UpdateManager.TYPE.CUSTOM_HANDLED_COMPONENT == localUpdateUnit.getType()) {
          bool &= localInstallUnitWizardModel.getCustomHandledContainer().canBeAdded(localUpdateUnit, localUpdateElement);
        } else {
          bool &= localOperationContainer.canBeAdded(localUpdateUnit, localUpdateElement);
        }
      }
      UpdateElement localUpdateElement;
      UpdateUnit localUpdateUnit;
      LazyOperationDescriptionStep.access$202(this$0, (LazyOperationDescriptionStep.access$200(this$0)) && (bool));
      if (bool)
      {
        for (localObject = localCollection.iterator(); ((Iterator)localObject).hasNext();)
        {
          localUpdateElement = (UpdateElement)((Iterator)localObject).next();
          localUpdateUnit = localUpdateElement.getUpdateUnit();
          if (UpdateManager.TYPE.CUSTOM_HANDLED_COMPONENT == localUpdateUnit.getType()) {
            localInstallUnitWizardModel.getCustomHandledContainer().add(localUpdateElement);
          } else {
            localOperationContainer.add(localUpdateElement);
          }
        }
        localObject = new InstallUnitWizardIterator(localInstallUnitWizardModel, true);
        SwingUtilities.invokeLater(new Runnable()
        {
          public void run()
          {
            LazyOperationDescriptionStep.access$300(this$0).setPanelsAndSettings(localObject, LazyOperationDescriptionStep.access$300(this$0));
            LazyOperationDescriptionStep.access$400(this$0);
            LazyInstallUnitWizardIterator.LazyUnit.storeUpdateElements(LazyOperationDescriptionStep.access$000(this$0), localCollection);
            AutoupdateCheckScheduler.notifyAvailable(LazyInstallUnitWizardIterator.LazyUnit.loadLazyUnits(LazyOperationDescriptionStep.access$000(this$0)), LazyOperationDescriptionStep.access$000(this$0));
          }
        });
      }
    }
  }
}

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

import javax.swing.JPanel;
import org.netbeans.modules.autoupdate.ui.actions.AutoupdateCheckScheduler;

class LazyOperationDescriptionStep$2$1
  implements Runnable
{
  LazyOperationDescriptionStep$2$1(LazyOperationDescriptionStep.2 param2, JPanel paramJPanel) {}
  
  public void run()
  {
    LazyOperationDescriptionStep.access$800(this$1.this$0).setBody(val$body);
    LazyOperationDescriptionStep.access$800(this$1.this$0).setWaitingState(false);
    AutoupdateCheckScheduler.notifyAvailable(LazyOperationDescriptionStep.access$600(this$1.this$0), LazyOperationDescriptionStep.access$000(this$1.this$0));
    LazyOperationDescriptionStep.access$400(this$1.this$0);
  }
}

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

import java.util.Collection;
import java.util.Collections;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import org.netbeans.modules.autoupdate.ui.actions.AutoupdateCheckScheduler;
import org.openide.util.Task;
import org.openide.util.TaskListener;

class LazyOperationDescriptionStep$2
  implements TaskListener
{
  LazyOperationDescriptionStep$2(LazyOperationDescriptionStep paramLazyOperationDescriptionStep, Collection paramCollection) {}
  
  public void taskFinished(Task paramTask)
  {
    paramTask.removeTaskListener(this);
    if (!LazyOperationDescriptionStep.access$200(this$0))
    {
      OperationDescriptionPanel localOperationDescriptionPanel1 = null;
      if ((val$problems == null) || (val$problems.isEmpty())) {
        localOperationDescriptionPanel1 = new OperationDescriptionPanel(LazyOperationDescriptionStep.access$500(this$0, "LazyOperationDescriptionStep_NoUpdates_Title", new Object[0]), LazyOperationDescriptionStep.access$500(this$0, "LazyOperationDescriptionStep_NoUpdates", new Object[0]), "", "", false);
      } else {
        localOperationDescriptionPanel1 = new OperationDescriptionPanel(LazyOperationDescriptionStep.access$500(this$0, "LazyOperationDescriptionStep_NoUpdatesWithProblems_Title", new Object[0]), LazyOperationDescriptionStep.access$500(this$0, "LazyOperationDescriptionStep_NoUpdatesWithProblems", new Object[0]), "", "", false);
      }
      final OperationDescriptionPanel localOperationDescriptionPanel2 = localOperationDescriptionPanel1;
      LazyOperationDescriptionStep.access$602(this$0, Collections.EMPTY_SET);
      new InstallUnitWizardModel(null, null).modifyOptionsForDoClose(LazyOperationDescriptionStep.access$300(this$0));
      LazyOperationDescriptionStep.access$702(this$0, true);
      LazyInstallUnitWizardIterator.LazyUnit.storeLazyUnits(LazyOperationDescriptionStep.access$000(this$0), LazyOperationDescriptionStep.access$600(this$0));
      SwingUtilities.invokeLater(new Runnable()
      {
        public void run()
        {
          LazyOperationDescriptionStep.access$800(this$0).setBody(localOperationDescriptionPanel2);
          LazyOperationDescriptionStep.access$800(this$0).setWaitingState(false);
          AutoupdateCheckScheduler.notifyAvailable(LazyOperationDescriptionStep.access$600(this$0), LazyOperationDescriptionStep.access$000(this$0));
          LazyOperationDescriptionStep.access$400(this$0);
        }
      });
    }
  }
}

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

class LazyOperationDescriptionStep$3 {}

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

import java.awt.Component;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.netbeans.api.autoupdate.OperationContainer;
import org.netbeans.api.autoupdate.UpdateElement;
import org.netbeans.api.autoupdate.UpdateManager.TYPE;
import org.netbeans.api.autoupdate.UpdateUnit;
import org.netbeans.modules.autoupdate.ui.Utilities;
import org.netbeans.modules.autoupdate.ui.actions.AutoupdateCheckScheduler;
import org.openide.WizardDescriptor;
import org.openide.WizardDescriptor.Iterator;
import org.openide.WizardDescriptor.Panel;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.util.RequestProcessor;
import org.openide.util.RequestProcessor.Task;
import org.openide.util.Task;
import org.openide.util.TaskListener;

public class LazyOperationDescriptionStep
  implements WizardDescriptor.Panel<WizardDescriptor>
{
  private static final String HEAD = "OperationDescriptionStep_Header_Head";
  private static final String CONTENT = "OperationDescriptionStep_Header_Content";
  private static final String TABLE_TITLE_INSTALL = "OperationDescriptionStep_TableInstall_Title";
  private static final String TABLE_TITLE_UPDATE = "OperationDescriptionStep_TableUpdate_Title";
  private PanelBodyContainer component;
  private Collection<LazyInstallUnitWizardIterator.LazyUnit> installModel = null;
  private boolean hasUpdates = false;
  private OperationWizardModel.OperationType operationType = null;
  private final List<ChangeListener> listeners = new ArrayList();
  private RequestProcessor.Task checkRealUpdatesTask = null;
  private WizardDescriptor wd = null;
  private boolean forceReload;
  private boolean canClose = false;
  
  public LazyOperationDescriptionStep(Collection<LazyInstallUnitWizardIterator.LazyUnit> paramCollection, OperationWizardModel.OperationType paramOperationType, boolean paramBoolean)
  {
    installModel = paramCollection;
    operationType = paramOperationType;
    hasUpdates = ((installModel != null) && (!installModel.isEmpty()));
    forceReload = paramBoolean;
  }
  
  public Component getComponent()
  {
    if (component == null)
    {
      String str1 = null;
      String str2 = null;
      String str3 = null;
      switch (operationType)
      {
      case INSTALL: 
        str1 = getBundle("OperationDescriptionStep_TableInstall_Title", new Object[0]);
        str2 = getBundle("OperationDescriptionStep_Header_Head", new Object[0]);
        str3 = getBundle("OperationDescriptionStep_Header_Content", new Object[0]);
        break;
      case UPDATE: 
        str1 = getBundle("OperationDescriptionStep_TableUpdate_Title", new Object[0]);
        str2 = getBundle("OperationDescriptionStep_Header_Head", new Object[0]);
        str3 = getBundle("OperationDescriptionStep_Header_Content", new Object[0]);
        break;
      default: 
        if (!$assertionsDisabled) {
          throw new AssertionError("Unexcepted operationType " + operationType);
        }
        return null;
      }
      if (!hasUpdates) {
        str1 = getBundle("LazyOperationDescriptionStep_FindUpdates_Title", new Object[0]);
      }
      OperationDescriptionPanel localOperationDescriptionPanel = new OperationDescriptionPanel(str1, preparePluginsForShow(installModel, operationType), "", "", false);
      
      component = new PanelBodyContainer(str2, str3, localOperationDescriptionPanel);
      component.setPreferredSize(OperationWizardModel.PREFFERED_DIMENSION);
      long l1 = Utilities.getTimeOfInitialization();
      if (forceReload)
      {
        long l2 = Utilities.getTimeOfRefreshUpdateCenters();
        l1 = (l1 > 0L) || (l2 > 0L) ? l1 + l2 : 0L;
      }
      component.setWaitingState(true, l1);
      checkRealUpdates();
    }
    return component;
  }
  
  private void checkRealUpdates()
  {
    final ArrayList localArrayList = new ArrayList();
    checkRealUpdatesTask = RequestProcessor.getDefault().post(new Runnable()
    {
      public void run()
      {
        final Collection localCollection = AutoupdateCheckScheduler.checkUpdateElements(operationType, localArrayList, forceReload);
        hasUpdates = ((localCollection != null) && (!localCollection.isEmpty()));
        if (hasUpdates)
        {
          assert (wd != null) : "WizardDescriptor must found!";
          OperationContainer localOperationContainer = OperationWizardModel.OperationType.UPDATE == operationType ? OperationContainer.createForUpdate() : OperationContainer.createForInstall();
          
          boolean bool = true;
          InstallUnitWizardModel localInstallUnitWizardModel = new InstallUnitWizardModel(operationType, localOperationContainer);
          for (final Object localObject = localCollection.iterator(); ((Iterator)localObject).hasNext();)
          {
            localUpdateElement = (UpdateElement)((Iterator)localObject).next();
            localUpdateUnit = localUpdateElement.getUpdateUnit();
            if (UpdateManager.TYPE.CUSTOM_HANDLED_COMPONENT == localUpdateUnit.getType()) {
              bool &= localInstallUnitWizardModel.getCustomHandledContainer().canBeAdded(localUpdateUnit, localUpdateElement);
            } else {
              bool &= localOperationContainer.canBeAdded(localUpdateUnit, localUpdateElement);
            }
          }
          UpdateElement localUpdateElement;
          UpdateUnit localUpdateUnit;
          hasUpdates = ((hasUpdates) && (bool));
          if (bool)
          {
            for (localObject = localCollection.iterator(); ((Iterator)localObject).hasNext();)
            {
              localUpdateElement = (UpdateElement)((Iterator)localObject).next();
              localUpdateUnit = localUpdateElement.getUpdateUnit();
              if (UpdateManager.TYPE.CUSTOM_HANDLED_COMPONENT == localUpdateUnit.getType()) {
                localInstallUnitWizardModel.getCustomHandledContainer().add(localUpdateElement);
              } else {
                localOperationContainer.add(localUpdateElement);
              }
            }
            localObject = new InstallUnitWizardIterator(localInstallUnitWizardModel, true);
            SwingUtilities.invokeLater(new Runnable()
            {
              public void run()
              {
                wd.setPanelsAndSettings(localObject, wd);
                LazyOperationDescriptionStep.this.fireChange();
                LazyInstallUnitWizardIterator.LazyUnit.storeUpdateElements(operationType, localCollection);
                AutoupdateCheckScheduler.notifyAvailable(LazyInstallUnitWizardIterator.LazyUnit.loadLazyUnits(operationType), operationType);
              }
            });
          }
        }
      }
    });
    checkRealUpdatesTask.addTaskListener(new TaskListener()
    {
      public void taskFinished(Task paramAnonymousTask)
      {
        paramAnonymousTask.removeTaskListener(this);
        if (!hasUpdates)
        {
          OperationDescriptionPanel localOperationDescriptionPanel1 = null;
          if ((localArrayList == null) || (localArrayList.isEmpty())) {
            localOperationDescriptionPanel1 = new OperationDescriptionPanel(LazyOperationDescriptionStep.this.getBundle("LazyOperationDescriptionStep_NoUpdates_Title", new Object[0]), LazyOperationDescriptionStep.this.getBundle("LazyOperationDescriptionStep_NoUpdates", new Object[0]), "", "", false);
          } else {
            localOperationDescriptionPanel1 = new OperationDescriptionPanel(LazyOperationDescriptionStep.this.getBundle("LazyOperationDescriptionStep_NoUpdatesWithProblems_Title", new Object[0]), LazyOperationDescriptionStep.this.getBundle("LazyOperationDescriptionStep_NoUpdatesWithProblems", new Object[0]), "", "", false);
          }
          final OperationDescriptionPanel localOperationDescriptionPanel2 = localOperationDescriptionPanel1;
          installModel = Collections.EMPTY_SET;
          new InstallUnitWizardModel(null, null).modifyOptionsForDoClose(wd);
          canClose = true;
          LazyInstallUnitWizardIterator.LazyUnit.storeLazyUnits(operationType, installModel);
          SwingUtilities.invokeLater(new Runnable()
          {
            public void run()
            {
              component.setBody(localOperationDescriptionPanel2);
              component.setWaitingState(false);
              AutoupdateCheckScheduler.notifyAvailable(installModel, operationType);
              LazyOperationDescriptionStep.this.fireChange();
            }
          });
        }
      }
    });
  }
  
  private String preparePluginsForShow(Collection<LazyInstallUnitWizardIterator.LazyUnit> paramCollection, OperationWizardModel.OperationType paramOperationType)
  {
    String str1 = new String();
    ArrayList localArrayList = new ArrayList();
    Iterator localIterator;
    Object localObject;
    if ((paramCollection != null) && (!paramCollection.isEmpty()))
    {
      for (localIterator = paramCollection.iterator(); localIterator.hasNext();)
      {
        localObject = (LazyInstallUnitWizardIterator.LazyUnit)localIterator.next();
        
        String str2 = "<b>" + ((LazyInstallUnitWizardIterator.LazyUnit)localObject).getDisplayName() + "</b> ";
        if (OperationWizardModel.OperationType.UPDATE == paramOperationType) {
          str2 = str2 + getBundle("OperationDescriptionStep_UpdatePluginVersionFormat", new Object[] { ((LazyInstallUnitWizardIterator.LazyUn
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