org.eclipse.equinox.p2.ui.importexport_1.0.1.v20120913-155635

16:44:32.676 INFO  jd.cli.Main - Decompiling org.eclipse.equinox.p2.ui.importexport_1.0.1.v20120913-155635.jar
package org.eclipse.equinox.internal.p2.importexport;

import java.net.URI;
import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;

public class IUDetail
  implements IAdaptable
{
  private final IInstallableUnit iu;
  private final List<URI> referredRepo;
  
  public IUDetail(IInstallableUnit iu, List<URI> uris)
  {
    this.iu = iu;
    referredRepo = uris;
  }
  
  public IInstallableUnit getIU()
  {
    return iu;
  }
  
  public List<URI> getReferencedRepositories()
  {
    return referredRepo;
  }
  
  public Object getAdapter(Class adapter)
  {
    if (IInstallableUnit.class.equals(adapter)) {
      return iu;
    }
    return null;
  }
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (((obj instanceof IUDetail)) && 
      (iu.equals(((IUDetail)obj).getIU()))) {
      return true;
    }
    return false;
  }
  
  public int hashCode()
  {
    return iu.hashCode();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.IUDetail
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;

public abstract interface P2ImportExport
{
  public abstract List<IUDetail> importP2F(InputStream paramInputStream)
    throws IOException;
  
  public abstract IStatus exportP2F(OutputStream paramOutputStream, IInstallableUnit[] paramArrayOfIInstallableUnit, IProgressMonitor paramIProgressMonitor);
  
  public abstract IStatus exportP2F(OutputStream paramOutputStream, List<IUDetail> paramList, IProgressMonitor paramIProgressMonitor);
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.P2ImportExport
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport;

public class VersionIncompatibleException
  extends RuntimeException
{
  private static final long serialVersionUID = -7584242899366859010L;
  
  public VersionIncompatibleException(String message)
  {
    super(message);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.VersionIncompatibleException
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal;

public abstract interface Constants
{
  public static final String Bundle_ID = "org.eclipse.equinox.p2.ui.importexport";
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.Constants
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class ImportExportActivator
  extends AbstractUIPlugin
{
  private static ImportExportActivator instance = null;
  
  public static ImportExportActivator getDefault()
  {
    return instance;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    
    instance = this;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.ImportExportActivator
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal;

import java.net.URI;
import java.util.Comparator;

class ImportExportImpl$1
  implements Comparator<URI>
{
  final ImportExportImpl this$0;
  
  ImportExportImpl$1(ImportExportImpl paramImportExportImpl) {}
  
  public int compare(URI o1, URI o2)
  {
    String scheme1 = o1.getScheme();
    String scheme2 = o2.getScheme();
    if (scheme1.equals(scheme2)) {
      return 0;
    }
    if ("file".equals(scheme1)) {
      return 1;
    }
    if ("file".equals(scheme2)) {
      return -1;
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.ImportExportImpl.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.equinox.internal.p2.importexport.IUDetail;
import org.eclipse.equinox.internal.p2.importexport.P2ImportExport;
import org.eclipse.equinox.internal.p2.importexport.persistence.P2FConstants;
import org.eclipse.equinox.internal.p2.importexport.persistence.P2FParser;
import org.eclipse.equinox.internal.p2.importexport.persistence.P2FWriter;
import org.eclipse.equinox.internal.p2.persistence.XMLWriter.ProcessingInstruction;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.Bundle;

public class ImportExportImpl
  implements P2ImportExport
{
  private static final String SCHEME_FILE = "file";
  public static final int IGNORE_LOCAL_REPOSITORY = 1;
  public static final int CANNOT_FIND_REPOSITORY = 2;
  private IProvisioningAgent agent = null;
  
  public void bind(IProvisioningAgent agt)
  {
    agent = agt;
  }
  
  public void unbind(IProvisioningAgent agt)
  {
    if (agent == agt) {
      agent = null;
    }
  }
  
  public List<IUDetail> importP2F(InputStream input)
    throws IOException
  {
    P2FParser parser = new P2FParser(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport").getBundleContext(), "org.eclipse.equinox.p2.ui.importexport");
    parser.parse(input);
    return parser.getIUs();
  }
  
  public IStatus exportP2F(OutputStream output, IInstallableUnit[] ius, IProgressMonitor monitor)
  {
    if (monitor == null) {
      monitor = new NullProgressMonitor();
    }
    SubMonitor subMonitor = SubMonitor.convert(monitor, Messages.Replicator_ExportJobName, 1000);
    IMetadataRepositoryManager repoManager = (IMetadataRepositoryManager)agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
    URI[] uris = repoManager.getKnownRepositories(0);
    Arrays.sort(uris, new Comparator()
    {
      public int compare(URI o1, URI o2)
      {
        String scheme1 = o1.getScheme();
        String scheme2 = o2.getScheme();
        if (scheme1.equals(scheme2)) {
          return 0;
        }
        if ("file".equals(scheme1)) {
          return 1;
        }
        if ("file".equals(scheme2)) {
          return -1;
        }
        return 0;
      }
    });
    List<IMetadataRepository> repos = new ArrayList(uris.length);
    URI[] arrayOfURI1;
    int j = (arrayOfURI1 = uris).length;
    for (int i = 0; i < j; i++)
    {
      URI uri = arrayOfURI1[i];
      try
      {
        repo = repoManager.loadRepository(uri, subMonitor.newChild(500 / uris.length, 7));
        repos.add(repo);
      }
      catch (ProvisionException localProvisionException) {}
    }
    subMonitor.setWorkRemaining(500);
    List<IUDetail> features = new ArrayList(ius.length);
    SubMonitor sub2 = subMonitor.newChild(450, 7);
    sub2.setWorkRemaining(ius.length * 100);
    MultiStatus queryRepoResult = new MultiStatus("org.eclipse.equinox.p2.ui.importexport", 0, null, null);
    IInstallableUnit[] arrayOfIInstallableUnit;
    IMetadataRepository localIMetadataRepository1 = (arrayOfIInstallableUnit = ius).length;
    for (IMetadataRepository repo = 0; repo < localIMetadataRepository1; repo++)
    {
      IInstallableUnit iu = arrayOfIInstallableUnit[repo];
      List<URI> referredRepos = new ArrayList(1);
      if (sub2.isCanceled()) {
        throw new OperationCanceledException();
      }
      SubMonitor sub3 = sub2.newChild(100);
      sub3.setWorkRemaining(repos.size() * 100);
      for (Iterator localIterator = repos.iterator(); localIterator.hasNext();)
      {
        IMetadataRepository repo = (IMetadataRepository)localIterator.next();
        if (("file".equals(repo.getLocation().getScheme())) && (referredRepos.size() > 0)) {
          break;
        }
        IQueryResult<IInstallableUnit> result = repo.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, true)), sub3.newChild(100));
        if (!result.isEmpty()) {
          referredRepos.add(repo.getLocation());
        }
      }
      sub3.setWorkRemaining(1).worked(1);
      if (referredRepos.size() == 0)
      {
        queryRepoResult.add(new Status(2, "org.eclipse.equinox.p2.ui.importexport", 2, NLS.bind(Messages.Replicator_NotFoundInRepository, iu.getProperty("org.eclipse.equinox.p2.name", Locale.getDefault().toString())), null));
      }
      else if ("file".equals(((URI)referredRepos.get(0)).getScheme()))
      {
        queryRepoResult.add(new Status(1, "org.eclipse.equinox.p2.ui.importexport", 1, NLS.bind(Messages.Replicator_InstallFromLocal, iu.getProperty("org.eclipse.equinox.p2.name", Locale.getDefault().toString())), null));
      }
      else
      {
        IUDetail feature = new IUDetail(iu, referredRepos);
        features.add(feature);
      }
    }
    subMonitor.setWorkRemaining(50);
    IStatus status = exportP2F(output, features, subMonitor);
    if ((status.isOK()) && (queryRepoResult.isOK())) {
      return status;
    }
    MultiStatus rt = new MultiStatus("org.eclipse.equinox.p2.ui.importexport", 0, new IStatus[] { queryRepoResult, status }, null, null);
    return rt;
  }
  
  public IStatus exportP2F(OutputStream output, List<IUDetail> features, IProgressMonitor monitor)
  {
    if (monitor == null) {
      monitor = new NullProgressMonitor();
    }
    SubMonitor sub = SubMonitor.convert(monitor, Messages.Replicator_SaveJobName, 100);
    if (sub.isCanceled()) {
      throw new OperationCanceledException();
    }
    try
    {
      P2FWriter writer = new P2FWriter(output, new XMLWriter.ProcessingInstruction[] { XMLWriter.ProcessingInstruction.makeTargetVersionInstruction("p2f", P2FConstants.CURRENT_VERSION) });
      writer.write(features);
      return Status.OK_STATUS;
    }
    catch (UnsupportedEncodingException e)
    {
      Object localObject2;
      return new Status(4, "org.eclipse.equinox.p2.ui.importexport", e.getMessage(), e);
    }
    finally
    {
      sub.worked(100);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.ImportExportImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  public static String Column_Id;
  public static String Column_Name;
  public static String Column_Version;
  public static String ExportPage_Title;
  public static String ExportPage_TryAgainQuestion;
  public static String ExportPage_Description;
  public static String ExportPage_Label;
  public static String ExportPage_DEST_ERRORMESSAGE;
  public static String ExportPage_ERROR_CONFIG;
  public static String ExportPage_Fail;
  public static String ExportPage_FILEDIALOG_TITLE;
  public static String ExportPage_FixSuggestion;
  public static String EXTENSION_ALL;
  public static String EXTENSION_ALL_NAME;
  public static String EXTENSION_p2F_NAME;
  public static String EXTENSION_p2F;
  public static String ExportPage_LABEL_EXPORTFILE;
  public static String ExportPage_SuccessWithProblems;
  public static String ExportWizard_ConfirmDialogTitle;
  public static String ExportWizard_OverwriteConfirm;
  public static String ExportWizard_WizardTitle;
  public static String ImportPage_DESCRIPTION;
  public static String ImportPage_DEST_ERROR;
  public static String ImportPage_DESTINATION_LABEL;
  public static String ImportPage_FILEDIALOG_TITLE;
  public static String ImportPage_FILENOTFOUND;
  public static String AbstractImportPage_HigherVersionInstalled;
  public static String ImportPage_InstallLatestVersion;
  public static String ImportPage_QueryFeaturesJob;
  public static String AbstractImportPage_SameVersionInstalled;
  public static String AbstractPage_ButtonDeselectAll;
  public static String AbstractPage_ButtonSelectAll;
  public static String ImportPage_TITLE;
  public static String ImportWizard_CannotQuerySelection;
  public static String ImportWizard_WINDOWTITLE;
  public static String Page_BUTTON_BROWSER;
  public static String PAGE_NOINSTALLTION_ERROR;
  public static String ImportFromInstallationPage_DESTINATION_LABEL;
  public static String ImportFromInstallationPage_DIALOG_TITLE;
  public static String ImportFromInstallationPage_INVALID_DESTINATION;
  public static String ImportFromInstallationPage_DIALOG_DESCRIPTION;
  public static String ImportFromInstallationPage_SELECT_COMPONENT;
  public static String io_IncompatibleVersion;
  public static String io_parseError;
  public static String Replicator_ExportJobName;
  public static String Replicator_InstallFromLocal;
  public static String Replicator_NotFoundInRepository;
  public static String Replicator_SaveJobName;
  
  static
  {
    NLS.initializeMessages("org.eclipse.equinox.internal.p2.importexport.internal.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.Messages
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;

class AbstractImportPage$1
  implements Listener
{
  final AbstractImportPage this$0;
  
  AbstractImportPage$1(AbstractImportPage paramAbstractImportPage) {}
  
  public void handleEvent(Event event)
  {
    if (detail == 32)
    {
      Class tmp23_20 = AbstractImportPage.class$0;
      if (tmp23_20 == null)
      {
        tmp23_20;
        try
        {
          tmpTernaryOp = (AbstractImportPage.class$0 = Class.forName("org.eclipse.equinox.p2.metadata.IInstallableUnit"));
        }
        catch (ClassNotFoundException localClassNotFoundException)
        {
          throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
        }
      }
      if (this$0.hasInstalled((IInstallableUnit)ProvUI.getAdapter(item.getData(), tmp23_20)))
      {
        this$0.viewer.getTree().setRedraw(false);
        ((TreeItem)item).setChecked(false);
        this$0.viewer.getTree().setRedraw(true);
      }
    }
    this$0.updatePageCompletion();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractImportPage.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.jface.viewers.ICheckStateProvider;

class AbstractImportPage$2
  implements ICheckStateProvider
{
  final AbstractImportPage this$0;
  
  AbstractImportPage$2(AbstractImportPage paramAbstractImportPage) {}
  
  public boolean isGrayed(Object element)
  {
    return false;
  }
  
  public boolean isChecked(Object element)
  {
    if (this$0.profile != null)
    {
      Class tmp14_11 = AbstractImportPage.class$0;
      if (tmp14_11 == null)
      {
        tmp14_11;
        try
        {
          tmpTernaryOp = (AbstractImportPage.class$0 = Class.forName("org.eclipse.equinox.p2.metadata.IInstallableUnit"));
        }
        catch (ClassNotFoundException localClassNotFoundException)
        {
          throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
        }
      }
      IInstallableUnit iu = (IInstallableUnit)ProvUI.getAdapter(element, tmp14_11);
      IQueryResult<IInstallableUnit> collector = this$0.profile.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, false)), new NullProgressMonitor());
      if (collector.isEmpty()) {
        return true;
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractImportPage.2
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ICheckStateProvider;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;

public abstract class AbstractImportPage
  extends AbstractPage
{
  IProfile profile = null;
  private final ProvisioningOperationWizard wizard;
  private final ProvisioningUI ui;
  static Class class$0;
  
  public AbstractImportPage(String pageName, ProvisioningUI ui, ProvisioningOperationWizard wizard)
  {
    super(pageName);
    this.wizard = wizard;
    this.ui = ui;
    profile = getSelfProfile();
  }
  
  protected ProvisioningOperationWizard getProvisioningWizard()
  {
    return wizard;
  }
  
  protected ProvisioningUI getProvisioningUI()
  {
    return ui;
  }
  
  protected void createInstallationTable(Composite parent)
  {
    super.createInstallationTable(parent);
    viewer.getTree().addListener(13, new Listener()
    {
      public void handleEvent(Event event)
      {
        if (detail == 32)
        {
          Class tmp23_20 = AbstractImportPage.class$0;
          if (tmp23_20 == null)
          {
            tmp23_20;
            try
            {
              tmpTernaryOp = (AbstractImportPage.class$0 = Class.forName("org.eclipse.equinox.p2.metadata.IInstallableUnit"));
            }
            catch (ClassNotFoundException localClassNotFoundException)
            {
              throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
            }
          }
          if (hasInstalled((IInstallableUnit)ProvUI.getAdapter(item.getData(), tmp23_20)))
          {
            viewer.getTree().setRedraw(false);
            ((TreeItem)item).setChecked(false);
            viewer.getTree().setRedraw(true);
          }
        }
        updatePageCompletion();
      }
    });
  }
  
  public boolean hasInstalled(IInstallableUnit iu)
  {
    IQueryResult<IInstallableUnit> results = profile.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, false)), null);
    return !results.isEmpty();
  }
  
  public String getIUNameWithDetail(IInstallableUnit iu)
  {
    IQueryResult<IInstallableUnit> results = profile.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, false)), null);
    String text = iu.getProperty("org.eclipse.equinox.p2.name", null);
    if (!results.isEmpty())
    {
      boolean hasHigherVersion = false;
      boolean hasEqualVersion = false;
      for (Iterator localIterator = results.toSet().iterator(); localIterator.hasNext();)
      {
        IInstallableUnit installedIU = (IInstallableUnit)localIterator.next();
        int compareValue = installedIU.getVersion().compareTo(iu.getVersion());
        if (compareValue > 0)
        {
          hasHigherVersion = true;
          break;
        }
        if (compareValue == 0) {
          hasEqualVersion = true;
        }
      }
      if (hasHigherVersion) {
        return NLS.bind(Messages.AbstractImportPage_HigherVersionInstalled, text);
      }
      if (hasEqualVersion) {
        return NLS.bind(Messages.AbstractImportPage_SameVersionInstalled, text);
      }
    }
    return text;
  }
  
  protected ICheckStateProvider getViewerDefaultState()
  {
    new ICheckStateProvider()
    {
      public boolean isGrayed(Object element)
      {
        return false;
      }
      
      public boolean isChecked(Object element)
      {
        if (profile != null)
        {
          Class tmp14_11 = AbstractImportPage.class$0;
          if (tmp14_11 == null)
          {
            tmp14_11;
            try
            {
              tmpTernaryOp = (AbstractImportPage.class$0 = Class.forName("org.eclipse.equinox.p2.metadata.IInstallableUnit"));
            }
            catch (ClassNotFoundException localClassNotFoundException)
            {
              throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
            }
          }
          IInstallableUnit iu = (IInstallableUnit)ProvUI.getAdapter(element, tmp14_11);
          IQueryResult<IInstallableUnit> collector = profile.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, false)), new NullProgressMonitor());
          if (collector.isEmpty()) {
            return true;
          }
        }
        return false;
      }
    };
  }
  
  protected void doFinish()
    throws Exception
  {}
  
  public boolean canFlipToNextPage()
  {
    return isPageComplete();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractImportPage
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class AbstractPage$1
  extends SelectionAdapter
{
  final AbstractPage this$0;
  
  AbstractPage$1(AbstractPage paramAbstractPage, int paramInt) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.updateTableSorting(val$columnIndex);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class AbstractPage$2
  implements Listener
{
  final AbstractPage this$0;
  
  AbstractPage$2(AbstractPage paramAbstractPage) {}
  
  public void handleEvent(Event event)
  {
    this$0.destinationNameField.clearSelection();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.2
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IElementComparer;
import org.eclipse.jface.viewers.ITreeContentProvider;

class AbstractPage$3
  implements ICheckStateListener
{
  final AbstractPage this$0;
  
  AbstractPage$3(AbstractPage paramAbstractPage, AbstractPage.ImportExportFilteredTree paramImportExportFilteredTree, ITreeContentProvider paramITreeContentProvider) {}
  
  public void checkStateChanged(CheckStateChangedEvent event)
  {
    if ((!event.getChecked()) && (val$filteredTree.checkState != null))
    {
      ArrayList<Object> toRemove = new ArrayList(1);
      Object[] children;
      if (val$contentProvider.hasChildren(event.getElement()))
      {
        Set<Object> unchecked = new HashSet();
        children = val$contentProvider.getChildren(event.getElement());
        for (int i = 0; i < children.length; i++) {
          unchecked.add(children[i]);
        }
        Iterator<Object> iter = val$filteredTree.checkState.iterator();
        while (iter.hasNext())
        {
          Object current = iter.next();
          if ((current != null) && (unchecked.contains(current))) {
            toRemove.add(current);
          }
        }
      }
      else
      {
        for (children = val$filteredTree.checkState.iterator(); children.hasNext();)
        {
          Object element = children.next();
          if (this$0.viewer.getComparer().equals(element, event.getElement())) {
            toRemove.add(element);
          }
        }
      }
      val$filteredTree.checkState.removeAll(toRemove);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.3
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;

class AbstractPage$4
  extends ControlAdapter
{
  private final int[] columnRate = { 6, 2, 2 };
  final AbstractPage this$0;
  
  AbstractPage$4(AbstractPage paramAbstractPage, Composite paramComposite, Tree paramTree) {}
  
  public void controlResized(ControlEvent e)
  {
    Rectangle area = val$parent.getClientArea();
    Point size = val$tree.computeSize(-1, -1);
    ScrollBar vBar = val$tree.getVerticalBar();
    int width = width - val$tree.computeTrim(0, 0, 0, 0).width - getSizex;
    if (y > height + val$tree.getHeaderHeight())
    {
      Point vBarSize = vBar.getSize();
      width -= x;
    }
    Point oldSize = val$tree.getSize();
    TreeColumn[] columns = val$tree.getColumns();
    int hasUsed = 0;int i = 0;
    if (x > width)
    {
      for (; i < columns.length - 1; i++)
      {
        columns[i].setWidth(width * columnRate[i] / 10);
        hasUsed += columns[i].getWidth();
      }
      columns[(columns.length - 1)].setWidth(width - hasUsed);
      val$tree.setSize(width, height);
    }
    else
    {
      val$tree.setSize(width, height);
      for (; i < columns.length - 1; i++)
      {
        columns[i].setWidth(width * columnRate[i] / 10);
        hasUsed += columns[i].getWidth();
      }
      columns[(columns.length - 1)].setWidth(width - hasUsed);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.4
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;

class AbstractPage$5
  implements ISelectionChangedListener
{
  final AbstractPage this$0;
  
  AbstractPage$5(AbstractPage paramAbstractPage) {}
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    this$0.updatePageCompletion();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.5
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

class AbstractPage$6
  extends SelectionAdapter
{
  final AbstractPage this$0;
  
  AbstractPage$6(AbstractPage paramAbstractPage) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    TreeItem[] arrayOfTreeItem;
    int j = (arrayOfTreeItem = this$0.viewer.getTree().getItems()).length;
    for (int i = 0; i < j; i++)
    {
      TreeItem item = arrayOfTreeItem[i];
      if (!item.getChecked())
      {
        item.setChecked(true);
        Event event = new Event();
        widget = item.getParent();
        detail = 32;
        item = item;
        type = 13;
        this$0.viewer.getTree().notifyListeners(13, event);
      }
    }
    this$0.updatePageCompletion();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.6
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

class AbstractPage$7
  extends SelectionAdapter
{
  final AbstractPage this$0;
  
  AbstractPage$7(AbstractPage paramAbstractPage) {}
  
  public void widgetSelected(SelectionEvent e)
  {
    TreeItem[] arrayOfTreeItem;
    int j = (arrayOfTreeItem = this$0.viewer.getTree().getItems()).length;
    for (int i = 0; i < j; i++)
    {
      TreeItem item = arrayOfTreeItem[i];
      this$0.viewer.setSubtreeChecked(item.getData(), false);
    }
    this$0.updatePageCompletion();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.7
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import org.eclipse.equinox.internal.p2.ui.model.InstalledIUElement;
import org.eclipse.equinox.internal.p2.ui.viewers.ProvElementContentProvider;

class AbstractPage$8
  extends ProvElementContentProvider
{
  final AbstractPage this$0;
  
  AbstractPage$8(AbstractPage paramAbstractPage) {}
  
  public boolean hasChildren(Object element)
  {
    if ((element instanceof InstalledIUElement)) {
      return false;
    }
    return super.hasChildren(element);
  }
  
  public Object[] getChildren(Object parent)
  {
    if ((parent instanceof InstalledIUElement)) {
      return new Object[0];
    }
    return super.getChildren(parent);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.8
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import java.util.ArrayList;
import org.eclipse.jface.viewers.CheckboxTreeViewer;

class AbstractPage$ImportExportFilteredTree$1$1
  implements Runnable
{
  final AbstractPage.ImportExportFilteredTree.1 this$2;
  
  AbstractPage$ImportExportFilteredTree$1$1(AbstractPage.ImportExportFilteredTree.1 param1) {}
  
  public void run()
  {
    Object[] checked = access$0access$0this$2)).viewer.getCheckedElements();
    if (access$0this$2).checkState == null) {
      access$0this$2).checkState = new ArrayList(checked.length);
    }
    for (int i = 0; i < checked.length; i++) {
      if ((!access$0access$0this$2)).viewer.getGrayed(checked[i])) && 
        (!access$0this$2).checkState.contains(checked[i]))) {
        access$0this$2).checkState.add(checked[i]);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.ImportExportFilteredTree.1.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.swt.widgets.Tree;

class AbstractPage$ImportExportFilteredTree$1$2
  implements Runnable
{
  final AbstractPage.ImportExportFilteredTree.1 this$2;
  
  AbstractPage$ImportExportFilteredTree$1$2(AbstractPage.ImportExportFilteredTree.1 param1) {}
  
  public void run()
  {
    if ((access$0access$0this$2)).viewer == null) || (access$0access$0this$2)).viewer.getTree().isDisposed())) {
      return;
    }
    if (access$0this$2).checkState == null) {
      return;
    }
    access$0access$0this$2)).viewer.setCheckedElements(new Object[0]);
    access$0access$0this$2)).viewer.setGrayedElements(new Object[0]);
    
    Iterator<Object> iter = access$0this$2).checkState.iterator();
    while (iter.hasNext()) {
      access$0access$0this$2)).viewer.setChecked(iter.next(), true);
    }
    AbstractPage.ImportExportFilteredTree.access$0(AbstractPage.ImportExportFilteredTree.1.access$0(this$2)).updatePageCompletion();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.ImportExportFilteredTree.1.2
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Tree;

class AbstractPage$ImportExportFilteredTree$1
  extends JobChangeAdapter
{
  final AbstractPage.ImportExportFilteredTree this$1;
  
  AbstractPage$ImportExportFilteredTree$1(AbstractPage.ImportExportFilteredTree paramImportExportFilteredTree) {}
  
  public void aboutToRun(IJobChangeEvent event)
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        Object[] checked = access$0this$1).viewer.getCheckedElements();
        if (this$1.checkState == null) {
          this$1.checkState = new ArrayList(checked.length);
        }
        for (int i = 0; i < checked.length; i++) {
          if ((!access$0this$1).viewer.getGrayed(checked[i])) && 
            (!this$1.checkState.contains(checked[i]))) {
            this$1.checkState.add(checked[i]);
          }
        }
      }
    });
  }
  
  public void done(IJobChangeEvent event)
  {
    if (event.getResult().isOK()) {
      Display.getDefault().asyncExec(new Runnable()
      {
        public void run()
        {
          if ((access$0this$1).viewer == null) || (access$0this$1).viewer.getTree().isDisposed())) {
            return;
          }
          if (this$1.checkState == null) {
            return;
          }
          access$0this$1).viewer.setCheckedElements(new Object[0]);
          access$0this$1).viewer.setGrayedElements(new Object[0]);
          
          Iterator<Object> iter = this$1.checkState.iterator();
          while (iter.hasNext()) {
            access$0this$1).viewer.setChecked(iter.next(), true);
          }
          AbstractPage.ImportExportFilteredTree.access$0(this$1).updatePageCompletion();
        }
      });
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.ImportExportFilteredTree.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.importexport.internal.wizard;

import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.dialogs.PatternFilter;
import org.eclipse.ui.progress.WorkbenchJob;

final class AbstractPage$ImportExportFilteredTree
  extends FilteredTree
{
  ArrayList<Object> checkState = new ArrayList();
  final AbstractPage this$0;
  
  AbstractPage$ImportExportFilteredTree(AbstractPage paramAbstractPage, Composite parent, int treeStyle, PatternFilter filter, boolean useNewLook)
  {
    super(parent, treeStyle, filter, useNewLook);
  }
  
  protected TreeViewer doCreateTreeViewer(Composite composite, int style)
  {
    return new CheckboxTreeViewer(composite, style);
  }
  
  protected WorkbenchJob doCreateRefreshJob()
  {
    WorkbenchJob job = super.doCreateRefreshJob();
    job.addJobChangeListener(new JobChangeAdapter()
    {
      public void aboutToRun(IJobChangeEvent event)
      {
        Display.getDefault().syncExec(new Runnable()
        {
          public void run()
          {
            Object[] checked = this$0.viewer.getCheckedElements();
            if (checkState == null) {
              checkState = new ArrayList(checked.length);
            }
            for (int i = 0; i < checked.length; i++) {
              if ((!this$0.viewer.getGrayed(checked[i])) && 
                (!checkState.contains(checked[i]))) {
                checkState.add(checked[i]);
              }
            }
          }
        });
      }
      
      public void done(IJobChangeEvent event)
      {
        if (event.getResult().isOK()) {
          Display.getDefault().asyncExec(new Runnable()
          {
            public void run()
            {
              if ((this$0.viewer == null) || (this$0.viewer.getTree().isDisposed())) {
                return;
              }
              if (checkState == null) {
                return;
              }
              this$0.viewer.setCheckedElements(new Object[0]);
              this$0.viewer.setGrayedElements(new Object[0]);
              
              Iterator<Object> iter = checkState.iterator();
              while (iter.hasNext()) {
                this$0.viewer.setChecked(iter.next(), true);
              }
              this$0.updatePageCompletion();
            }
          });
        }
      }
    });
    return job;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.AbstractPage.ImportExportFilteredTree
 * Java Class Version: 1.4 (48.0)
 * JD-Core Versi
1 2 3 4 5 6

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