org.eclipse.equinox.p2.ui_2.1.1.v20120113-1346

16:44:36.184 INFO  jd.cli.Main - Decompiling org.eclipse.equinox.p2.ui_2.1.1.v20120113-1346.jar
package org.eclipse.equinox.internal.p2.ui;

import java.net.URI;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.internal.p2.ui.dialogs.RepositoryNameAndLocationDialog;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.swt.widgets.Shell;

class ColocatedRepositoryTracker$1$1
  extends RepositoryNameAndLocationDialog
{
  final ColocatedRepositoryTracker.1 this$1;
  
  ColocatedRepositoryTracker$1$1(ColocatedRepositoryTracker.1 param1, Shell $anonymous0, ProvisioningUI $anonymous1, URI paramURI)
  {
    super($anonymous0, $anonymous1);
  }
  
  protected String getInitialLocationText()
  {
    return URIUtil.toUnencodedString(val$location);
  }
  
  protected String getInitialNameText()
  {
    String nickname = ColocatedRepositoryTracker.1.access$0(this$1).getMetadataRepositoryManager().getRepositoryProperty(val$location, "p2.nickname");
    return nickname == null ? "" : nickname;
  }
}

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

import java.net.URI;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.internal.p2.ui.dialogs.RepositoryNameAndLocationDialog;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.swt.widgets.Shell;

class ColocatedRepositoryTracker$1
  implements Runnable
{
  final ColocatedRepositoryTracker this$0;
  
  ColocatedRepositoryTracker$1(ColocatedRepositoryTracker paramColocatedRepositoryTracker, URI paramURI) {}
  
  /* Error */
  public void run()
  {
    // Byte code:
    //   0: invokestatic 126	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
    //   3: astore_1
    //   4: aload_1
    //   5: invokeinterface 127 1 0
    //   10: ifeq +4 -> 14
    //   13: return
    //   14: invokestatic 117	org/eclipse/equinox/internal/p2/ui/ProvUI:getDefaultParentShell	()Lorg/eclipse/swt/widgets/Shell;
    //   17: astore_2
    //   18: aload_2
    //   19: getstatic 111	org/eclipse/equinox/internal/p2/ui/ProvUIMessages:ColocatedRepositoryTracker_SiteNotFoundTitle	Ljava/lang/String;
    //   22: getstatic 110	org/eclipse/equinox/internal/p2/ui/ProvUIMessages:ColocatedRepositoryTracker_PromptForSiteLocationEdit	Ljava/lang/String;
    //   25: aload_0
    //   26: getfield 108	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:val$location	Ljava/net/URI;
    //   29: invokestatic 113	org/eclipse/core/runtime/URIUtil:toUnencodedString	(Ljava/net/URI;)Ljava/lang/String;
    //   32: invokestatic 125	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   35: invokestatic 124	org/eclipse/jface/dialogs/MessageDialog:openQuestion	(Lorg/eclipse/swt/widgets/Shell;Ljava/lang/String;Ljava/lang/String;)Z
    //   38: ifeq +139 -> 177
    //   41: new 55	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1$1
    //   44: dup
    //   45: aload_0
    //   46: aload_2
    //   47: aload_0
    //   48: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
    //   51: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   54: aload_0
    //   55: getfield 108	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:val$location	Ljava/net/URI;
    //   58: invokespecial 116	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1$1:<init>	(Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1;Lorg/eclipse/swt/widgets/Shell;Lorg/eclipse/equinox/p2/ui/ProvisioningUI;Ljava/net/URI;)V
    //   61: astore_3
    //   62: aload_3
    //   63: invokevirtual 118	org/eclipse/equinox/internal/p2/ui/dialogs/RepositoryNameAndLocationDialog:open	()I
    //   66: istore 4
    //   68: iload 4
    //   70: ifne +107 -> 177
    //   73: aload_3
    //   74: invokevirtual 120	org/eclipse/equinox/internal/p2/ui/dialogs/RepositoryNameAndLocationDialog:getLocation	()Ljava/net/URI;
    //   77: astore 5
    //   79: aload 5
    //   81: ifnull +96 -> 177
    //   84: aload_0
    //   85: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
    //   88: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   91: invokevirtual 121	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationStart	()V
    //   94: aload_0
    //   95: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
    //   98: iconst_1
    //   99: anewarray 51	java/net/URI
    //   102: dup
    //   103: iconst_0
    //   104: aload_0
    //   105: getfield 108	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:val$location	Ljava/net/URI;
    //   108: aastore
    //   109: aload_0
    //   110: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
    //   113: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   116: invokevirtual 123	org/eclipse/equinox/p2/ui/ProvisioningUI:getSession	()Lorg/eclipse/equinox/p2/operations/ProvisioningSession;
    //   119: invokevirtual 114	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:removeRepositories	([Ljava/net/URI;Lorg/eclipse/equinox/p2/operations/ProvisioningSession;)V
    //   122: aload_0
    //   123: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
    //   126: aload 5
    //   128: aload_3
    //   129: invokevirtual 119	org/eclipse/equinox/internal/p2/ui/dialogs/RepositoryNameAndLocationDialog:getName	()Ljava/lang/String;
    //   132: aload_0
    //   133: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
    //   136: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   139: invokevirtual 123	org/eclipse/equinox/p2/ui/ProvisioningUI:getSession	()Lorg/eclipse/equinox/p2/operations/ProvisioningSession;
    //   142: invokevirtual 115	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:addRepository	(Ljava/net/URI;Ljava/lang/String;Lorg/eclipse/equinox/p2/operations/ProvisioningSession;)V
    //   145: goto +20 -> 165
    //   148: astore 6
    //   150: aload_0
    //   151: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
    //   154: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   157: aconst_null
    //   158: iconst_1
    //   159: invokevirtual 122	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationComplete	(Lorg/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent;Z)V
    //   162: aload 6
    //   164: athrow
    //   165: aload_0
    //   166: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
    //   169: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   172: aconst_null
    //   173: iconst_1
    //   174: invokevirtual 122	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationComplete	(Lorg/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent;Z)V
    //   177: return
    // Line number table:
    //   Java source line #126	-> byte code offset #0
    //   Java source line #127	-> byte code offset #4
    //   Java source line #128	-> byte code offset #13
    //   Java source line #129	-> byte code offset #14
    //   Java source line #130	-> byte code offset #18
    //   Java source line #131	-> byte code offset #41
    //   Java source line #141	-> byte code offset #62
    //   Java source line #142	-> byte code offset #68
    //   Java source line #143	-> byte code offset #73
    //   Java source line #144	-> byte code offset #79
    //   Java source line #145	-> byte code offset #84
    //   Java source line #147	-> byte code offset #94
    //   Java source line #148	-> byte code offset #122
    //   Java source line #149	-> byte code offset #148
    //   Java source line #150	-> byte code offset #150
    //   Java source line #151	-> byte code offset #162
    //   Java source line #150	-> byte code offset #165
    //   Java source line #155	-> byte code offset #177
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	178	0	this	1
    //   3	2	1	workbench	org.eclipse.ui.IWorkbench
    //   17	30	2	shell	Shell
    //   61	68	3	dialog	RepositoryNameAndLocationDialog
    //   66	3	4	ret	int
    //   77	50	5	correctedLocation	URI
    //   148	15	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   94	148	148	finally
  }
}

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

import java.net.URI;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.internal.p2.ui.dialogs.RepositoryNameAndLocationDialog;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.operations.RepositoryTracker;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.ui.Policy;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

public class ColocatedRepositoryTracker
  extends RepositoryTracker
{
  ProvisioningUI ui;
  String parsedNickname;
  URI parsedLocation;
  
  public ColocatedRepositoryTracker(ProvisioningUI ui)
  {
    this.ui = ui;
    setArtifactRepositoryFlags(2);
    setMetadataRepositoryFlags(2);
  }
  
  public URI[] getKnownRepositories(ProvisioningSession session)
  {
    return getMetadataRepositoryManager().getKnownRepositories(getMetadataRepositoryFlags());
  }
  
  /* Error */
  public void addRepository(URI repoLocation, String nickname, ProvisioningSession session)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 194	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   4: invokevirtual 221	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationStart	()V
    //   7: aload_0
    //   8: invokevirtual 210	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:getMetadataRepositoryManager	()Lorg/eclipse/equinox/p2/repository/metadata/IMetadataRepositoryManager;
    //   11: aload_1
    //   12: invokeinterface 233 2 0
    //   17: aload_0
    //   18: invokevirtual 209	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:getArtifactRepositoryManager	()Lorg/eclipse/equinox/p2/repository/artifact/IArtifactRepositoryManager;
    //   21: aload_1
    //   22: invokeinterface 228 2 0
    //   27: aload_2
    //   28: ifnull +56 -> 84
    //   31: aload_0
    //   32: invokevirtual 210	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:getMetadataRepositoryManager	()Lorg/eclipse/equinox/p2/repository/metadata/IMetadataRepositoryManager;
    //   35: aload_1
    //   36: ldc 1
    //   38: aload_2
    //   39: invokeinterface 236 4 0
    //   44: aload_0
    //   45: invokevirtual 209	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:getArtifactRepositoryManager	()Lorg/eclipse/equinox/p2/repository/artifact/IArtifactRepositoryManager;
    //   48: aload_1
    //   49: ldc 1
    //   51: aload_2
    //   52: invokeinterface 230 4 0
    //   57: goto +27 -> 84
    //   60: astore 4
    //   62: aload_0
    //   63: getfield 194	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   66: new 94	org/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent
    //   69: dup
    //   70: aload_1
    //   71: iconst_0
    //   72: iconst_0
    //   73: iconst_1
    //   74: invokespecial 215	org/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent:<init>	(Ljava/net/URI;IIZ)V
    //   77: iconst_1
    //   78: invokevirtual 222	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationComplete	(Lorg/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent;Z)V
    //   81: aload 4
    //   83: athrow
    //   84: aload_0
    //   85: getfield 194	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   88: new 94	org/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent
    //   91: dup
    //   92: aload_1
    //   93: iconst_0
    //   94: iconst_0
    //   95: iconst_1
    //   96: invokespecial 215	org/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent:<init>	(Ljava/net/URI;IIZ)V
    //   99: iconst_1
    //   100: invokevirtual 222	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationComplete	(Lorg/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent;Z)V
    //   103: return
    // Line number table:
    //   Java source line #61	-> byte code offset #0
    //   Java source line #63	-> byte code offset #7
    //   Java source line #64	-> byte code offset #17
    //   Java source line #65	-> byte code offset #27
    //   Java source line #66	-> byte code offset #31
    //   Java source line #67	-> byte code offset #44
    //   Java source line #70	-> byte code offset #60
    //   Java source line #72	-> byte code offset #62
    //   Java source line #73	-> byte code offset #81
    //   Java source line #72	-> byte code offset #84
    //   Java source line #74	-> byte code offset #103
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	104	0	this	ColocatedRepositoryTracker
    //   0	104	1	repoLocation	URI
    //   0	104	2	nickname	String
    //   0	104	3	session	ProvisioningSession
    //   60	22	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   7	60	60	finally
  }
  
  /* Error */
  public void removeRepositories(URI[] repoLocations, ProvisioningSession session)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 194	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   4: invokevirtual 221	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationStart	()V
    //   7: iconst_0
    //   8: istore_3
    //   9: goto +32 -> 41
    //   12: aload_0
    //   13: invokevirtual 210	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:getMetadataRepositoryManager	()Lorg/eclipse/equinox/p2/repository/metadata/IMetadataRepositoryManager;
    //   16: aload_1
    //   17: iload_3
    //   18: aaload
    //   19: invokeinterface 235 2 0
    //   24: pop
    //   25: aload_0
    //   26: invokevirtual 209	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:getArtifactRepositoryManager	()Lorg/eclipse/equinox/p2/repository/artifact/IArtifactRepositoryManager;
    //   29: aload_1
    //   30: iload_3
    //   31: aaload
    //   32: invokeinterface 229 2 0
    //   37: pop
    //   38: iinc 3 1
    //   41: iload_3
    //   42: aload_1
    //   43: arraylength
    //   44: if_icmplt -32 -> 12
    //   47: goto +17 -> 64
    //   50: astore 4
    //   52: aload_0
    //   53: getfield 194	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   56: aconst_null
    //   57: iconst_1
    //   58: invokevirtual 222	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationComplete	(Lorg/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent;Z)V
    //   61: aload 4
    //   63: athrow
    //   64: aload_0
    //   65: getfield 194	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
    //   68: aconst_null
    //   69: iconst_1
    //   70: invokevirtual 222	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationComplete	(Lorg/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent;Z)V
    //   73: return
    // Line number table:
    //   Java source line #80	-> byte code offset #0
    //   Java source line #82	-> byte code offset #7
    //   Java source line #83	-> byte code offset #12
    //   Java source line #84	-> byte code offset #25
    //   Java source line #82	-> byte code offset #38
    //   Java source line #86	-> byte code offset #50
    //   Java source line #87	-> byte code offset #52
    //   Java source line #88	-> byte code offset #61
    //   Java source line #87	-> byte code offset #64
    //   Java source line #89	-> byte code offset #73
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	74	0	this	ColocatedRepositoryTracker
    //   0	74	1	repoLocations	URI[]
    //   0	74	2	session	ProvisioningSession
    //   8	34	3	i	int
    //   50	12	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   7	50	50	finally
  }
  
  public void refreshRepositories(URI[] locations, ProvisioningSession session, IProgressMonitor monitor)
  {
    ui.signalRepositoryOperationStart();
    SubMonitor mon = SubMonitor.convert(monitor, locations.length * 100);
    for (int i = 0; i < locations.length; i++) {
      try
      {
        getArtifactRepositoryManager().refreshRepository(locations[i], mon.newChild(50));
        getMetadataRepositoryManager().refreshRepository(locations[i], mon.newChild(50));
      }
      catch (ProvisionException localProvisionException) {}
    }
    ui.signalRepositoryOperationComplete(null, true);
  }
  
  public void reportLoadFailure(final URI location, ProvisionException e)
  {
    int code = e.getStatus().getCode();
    if (!ui.getPolicy().getRepositoriesVisible())
    {
      super.reportLoadFailure(location, e);
      return;
    }
    if ((code == 1000) || (code == 1006))
    {
      if (!hasNotFoundStatusBeenReported(location))
      {
        addNotFound(location);
        PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
        {
          /* Error */
          public void run()
          {
            // Byte code:
            //   0: invokestatic 126	org/eclipse/ui/PlatformUI:getWorkbench	()Lorg/eclipse/ui/IWorkbench;
            //   3: astore_1
            //   4: aload_1
            //   5: invokeinterface 127 1 0
            //   10: ifeq +4 -> 14
            //   13: return
            //   14: invokestatic 117	org/eclipse/equinox/internal/p2/ui/ProvUI:getDefaultParentShell	()Lorg/eclipse/swt/widgets/Shell;
            //   17: astore_2
            //   18: aload_2
            //   19: getstatic 111	org/eclipse/equinox/internal/p2/ui/ProvUIMessages:ColocatedRepositoryTracker_SiteNotFoundTitle	Ljava/lang/String;
            //   22: getstatic 110	org/eclipse/equinox/internal/p2/ui/ProvUIMessages:ColocatedRepositoryTracker_PromptForSiteLocationEdit	Ljava/lang/String;
            //   25: aload_0
            //   26: getfield 108	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:val$location	Ljava/net/URI;
            //   29: invokestatic 113	org/eclipse/core/runtime/URIUtil:toUnencodedString	(Ljava/net/URI;)Ljava/lang/String;
            //   32: invokestatic 125	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
            //   35: invokestatic 124	org/eclipse/jface/dialogs/MessageDialog:openQuestion	(Lorg/eclipse/swt/widgets/Shell;Ljava/lang/String;Ljava/lang/String;)Z
            //   38: ifeq +139 -> 177
            //   41: new 55	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1$1
            //   44: dup
            //   45: aload_0
            //   46: aload_2
            //   47: aload_0
            //   48: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
            //   51: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
            //   54: aload_0
            //   55: getfield 108	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:val$location	Ljava/net/URI;
            //   58: invokespecial 116	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1$1:<init>	(Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1;Lorg/eclipse/swt/widgets/Shell;Lorg/eclipse/equinox/p2/ui/ProvisioningUI;Ljava/net/URI;)V
            //   61: astore_3
            //   62: aload_3
            //   63: invokevirtual 118	org/eclipse/equinox/internal/p2/ui/dialogs/RepositoryNameAndLocationDialog:open	()I
            //   66: istore 4
            //   68: iload 4
            //   70: ifne +107 -> 177
            //   73: aload_3
            //   74: invokevirtual 120	org/eclipse/equinox/internal/p2/ui/dialogs/RepositoryNameAndLocationDialog:getLocation	()Ljava/net/URI;
            //   77: astore 5
            //   79: aload 5
            //   81: ifnull +96 -> 177
            //   84: aload_0
            //   85: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
            //   88: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
            //   91: invokevirtual 121	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationStart	()V
            //   94: aload_0
            //   95: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
            //   98: iconst_1
            //   99: anewarray 51	java/net/URI
            //   102: dup
            //   103: iconst_0
            //   104: aload_0
            //   105: getfield 108	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:val$location	Ljava/net/URI;
            //   108: aastore
            //   109: aload_0
            //   110: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
            //   113: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
            //   116: invokevirtual 123	org/eclipse/equinox/p2/ui/ProvisioningUI:getSession	()Lorg/eclipse/equinox/p2/operations/ProvisioningSession;
            //   119: invokevirtual 114	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:removeRepositories	([Ljava/net/URI;Lorg/eclipse/equinox/p2/operations/ProvisioningSession;)V
            //   122: aload_0
            //   123: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
            //   126: aload 5
            //   128: aload_3
            //   129: invokevirtual 119	org/eclipse/equinox/internal/p2/ui/dialogs/RepositoryNameAndLocationDialog:getName	()Ljava/lang/String;
            //   132: aload_0
            //   133: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
            //   136: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
            //   139: invokevirtual 123	org/eclipse/equinox/p2/ui/ProvisioningUI:getSession	()Lorg/eclipse/equinox/p2/operations/ProvisioningSession;
            //   142: invokevirtual 115	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:addRepository	(Ljava/net/URI;Ljava/lang/String;Lorg/eclipse/equinox/p2/operations/ProvisioningSession;)V
            //   145: goto +20 -> 165
            //   148: astore 6
            //   150: aload_0
            //   151: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
            //   154: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
            //   157: aconst_null
            //   158: iconst_1
            //   159: invokevirtual 122	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationComplete	(Lorg/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent;Z)V
            //   162: aload 6
            //   164: athrow
            //   165: aload_0
            //   166: getfield 109	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker$1:this$0	Lorg/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker;
            //   169: getfield 107	org/eclipse/equinox/internal/p2/ui/ColocatedRepositoryTracker:ui	Lorg/eclipse/equinox/p2/ui/ProvisioningUI;
            //   172: aconst_null
            //   173: iconst_1
            //   174: invokevirtual 122	org/eclipse/equinox/p2/ui/ProvisioningUI:signalRepositoryOperationComplete	(Lorg/eclipse/equinox/internal/provisional/p2/repository/RepositoryEvent;Z)V
            //   177: return
            // Line number table:
            //   Java source line #126	-> byte code offset #0
            //   Java source line #127	-> byte code offset #4
            //   Java source line #128	-> byte code offset #13
            //   Java source line #129	-> byte code offset #14
            //   Java source line #130	-> byte code offset #18
            //   Java source line #131	-> byte code offset #41
            //   Java source line #141	-> byte code offset #62
            //   Java source line #142	-> byte code offset #68
            //   Java source line #143	-> byte code offset #73
            //   Java source line #144	-> byte code offset #79
            //   Java source line #145	-> byte code offset #84
            //   Java source line #147	-> byte code offset #94
            //   Java source line #148	-> byte code offset #122
            //   Java source line #149	-> byte code offset #148
            //   Java source line #150	-> byte code offset #150
            //   Java source line #151	-> byte code offset #162
            //   Java source line #150	-> byte code offset #165
            //   Java source line #155	-> byte code offset #177
            // Local variable table:
            //   start	length	slot	name	signature
            //   0	178	0	this	1
            //   3	2	1	workbench	IWorkbench
            //   17	30	2	shell	Shell
            //   61	68	3	dialog	RepositoryNameAndLocationDialog
            //   66	3	4	ret	int
            //   77	50	5	correctedLocation	URI
            //   148	15	6	localObject	Object
            // Exception table:
            //   from	to	target	type
            //   94	148	148	finally
          }
        });
      }
    }
    else {
      ProvUI.handleException(e, null, 3);
    }
  }
  
  IMetadataRepositoryManager getMetadataRepositoryManager()
  {
    return ProvUI.getMetadataRepositoryManager(ui.getSession());
  }
  
  IArtifactRepositoryManager getArtifactRepositoryManager()
  {
    return ProvUI.getArtifactRepositoryManager(ui.getSession());
  }
  
  public URI locationFromString(String locationString)
  {
    URI uri = super.locationFromString(locationString);
    if (uri != null) {
      return uri;
    }
    int start = 0;
    int index = 0;
    
    String pattern = ProvUIMessages.RepositorySelectionGroup_NameAndLocationSeparator;
    while (index >= 0)
    {
      index = locationString.indexOf(pattern, start);
      if (index >= 0)
      {
        start = index + pattern.length();
        String locationSubset = locationString.substring(start);
        uri = super.locationFromString(locationSubset);
        if (uri != null)
        {
          parsedLocation = uri;
          parsedNickname = locationString.substring(0, index);
          return uri;
        }
      }
    }
    return null;
  }
  
  public String getParsedNickname(URI location)
  {
    if ((parsedNickname == null) || (parsedLocation == null)) {
      return null;
    }
    if (location.toString().equals(parsedLocation.toString())) {
      return parsedNickname;
    }
    return null;
  }
  
  protected boolean contains(URI location, ProvisioningSession session)
  {
    return ProvUI.getMetadataRepositoryManager(session).contains(location);
  }
}

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

import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.equinox.p2.query.Collector;
import org.eclipse.equinox.p2.query.IQuery;
import org.eclipse.equinox.p2.query.IQueryable;

public class ElementQueryDescriptor
{
  private IQuery<Object> query;
  private Collector<Object> collector;
  private IQueryable<Object> queryable;
  private ElementWrapper wrapper;
  
  public ElementQueryDescriptor(IQueryable<?> queryable, IQuery<?> query, Collector<?> collector)
  {
    this(queryable, query, collector, null);
  }
  
  public ElementQueryDescriptor(IQueryable<?> queryable, IQuery<?> query, Collector<?> collector, ElementWrapper wrapper)
  {
    this.query = query;
    this.collector = collector;
    this.queryable = queryable;
    this.wrapper = wrapper;
  }
  
  public Collection<?> performQuery(IProgressMonitor monitor)
  {
    Collector<Object> results = collector;
    if ((query != null) && (collector != null) && (queryable != null)) {
      results.addAll(queryable.query(query, monitor));
    } else if (results == null) {
      results = new Collector();
    }
    if (wrapper != null) {
      return wrapper.getElements(results);
    }
    return results.toUnmodifiableSet();
  }
  
  public boolean hasCollector()
  {
    return collector != null;
  }
  
  public boolean hasQueryable()
  {
    return queryable != null;
  }
  
  public boolean hasQuery()
  {
    return query != null;
  }
}

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.p2.query.Collector;

public abstract class ElementWrapper
{
  private Collection<Object> collection = null;
  
  public Collection<?> getElements(Collector<?> collector)
  {
    collection = new ArrayList(collector.size());
    Iterator<?> iter = collector.iterator();
    while (iter.hasNext())
    {
      Object o = iter.next();
      if (shouldWrap(o)) {
        collection.add(wrap(o));
      }
    }
    return getCollection();
  }
  
  protected Collection<?> getCollection()
  {
    return collection == null ? CollectionUtils.emptyList() : collection;
  }
  
  protected boolean shouldWrap(Object o)
  {
    return true;
  }
  
  protected abstract Object wrap(Object paramObject);
}

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

public abstract interface IProvHelpContextIds
{
  public static final String PREFIX = "org.eclipse.equinox.p2.ui.";
  public static final String REVERT_CONFIGURATION_WIZARD = "org.eclipse.equinox.p2.ui.revert_configuration_wizard_context";
  public static final String UNINSTALL_WIZARD = "org.eclipse.equinox.p2.ui.uinstall_wizard_context";
  public static final String UPDATE_WIZARD = "org.eclipse.equinox.p2.ui.update_wizard_context";
  public static final String ADD_REPOSITORY_DIALOG = "org.eclipse.equinox.p2.ui.add_repository_dialog_context";
  public static final String INSTALL_WIZARD = "org.eclipse.equinox.p2.ui.install_wizard_context";
  public static final String REPOSITORY_MANIPULATION_DIALOG = "org.eclipse.equinox.p2.ui.repository_manipulation_dialog_context";
  public static final String INSTALLED_SOFTWARE = "org.eclipse.equinox.p2.ui.installed_software_context";
  public static final String AVAILABLE_SOFTWARE = "org.eclipse.equinox.p2.ui.available_software_context";
}

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

import java.util.Set;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.NotEnabledException;
import org.eclipse.core.commands.NotHandledException;
import org.eclipse.core.commands.common.NotDefinedException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.equinox.internal.p2.ui.query.IUViewQueryContext;
import org.eclipse.equinox.internal.p2.ui.viewers.IUColumnConfig;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.engine.ISizingPhaseSet;
import org.eclipse.equinox.p2.engine.PhaseSetFactory;
import org.eclipse.equinox.p2.engine.ProvisioningContext;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.IQueryable;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.ui.Policy;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.statushandlers.StatusManager;

public class ProvUI
{
  public static final String INSTALL_COMMAND_LABEL = ProvUIMessages.InstallIUCommandLabel;
  public static final String INSTALL_COMMAND_TOOLTIP = ProvUIMessages.InstallIUCommandTooltip;
  public static final String UNINSTALL_COMMAND_LABEL = ProvUIMessages.UninstallIUCommandLabel;
  public static final String UNINSTALL_COMMAND_TOOLTIP = ProvUIMessages.UninstallIUCommandTooltip;
  public static final String UPDATE_COMMAND_LABEL = ProvUIMessages.UpdateIUCommandLabel;
  public static final String UPDATE_COMMAND_TOOLTIP = ProvUIMessages.UpdateIUCommandTooltip;
  public static final String REVERT_COMMAND_LABEL = ProvUIMessages.RevertIUCommandLabel;
  public static final String REVERT_COMMAND_TOOLTIP = ProvUIMessages.RevertIUCommandTooltip;
  public static final long SIZE_NOTAPPLICABLE = -3L;
  public static final long SIZE_UNAVAILABLE = -2L;
  public static final long SIZE_UNKNOWN = -1L;
  private static IUColumnConfig[] columnConfig;
  private static final String UPDATE_MANAGER_FIND_AND_INSTALL = "org.eclipse.ui.update.findAndInstallUpdates";
  private static final String UPDATE_MANAGER_MANAGE_CONFIGURATION = "org.eclipse.ui.update.manageConfiguration";
  private static final String INSTALLATION_DIALOG = "org.eclipse.ui.help.installationDialog";
  
  public static IStatus handleException(Throwable t, String message, int style)
  {
    if ((message == null) && (t != null)) {
      message = t.getMessage();
    }
    IStatus status = new Status(4, "org.eclipse.equinox.p2.ui", 0, message, t);
    StatusManager.getManager().handle(status, style);
    return status;
  }
  
  public static void reportStatus(IStatus status, int style)
  {
    if (((style & 0x4) == 4) || ((style & 0x2) == 2)) {
      if (status.getSeverity() == 1)
      {
        MessageDialog.openInformation(getDefaultParentShell(), ProvUIMessages.ProvUI_InformationTitle, status.getMessage());
        
        style &= 0xFFFFFFFB;
        style &= 0xFFFFFFFD;
        if (status.getCode() == 10000) {
          style = 0;
        }
      }
      else if (status.getSeverity() == 2)
      {
        MessageDialog.openWarning(getDefaultParentShell(), ProvUIMessages.ProvUI_WarningTitle, status.getMessage());
        
        style &= 0xFFFFFFFB;
        style &= 0xFFFFFFFD;
      }
    }
    if (style != 0) {
      StatusManager.getManager().handle(status, style);
    }
  }
  
  public static IUColumnConfig[] getIUColumnConfig()
  {
    if (columnConfig == null) {
      columnConfig = new IUColumnConfig[] { new IUColumnConfig(ProvUIMessages.ProvUI_NameColumnTitle, 1, 60), new IUColumnConfig(ProvUIMessages.ProvUI_VersionColumnTitle, 2, 40) };
    }
    return columnConfig;
  }
  
  public static IUViewQueryContext getQueryContext(Policy policy)
  {
    IUViewQueryContext queryContext = new IUViewQueryContext(policy.getGroupByCategory() ? 1 : 3);
    queryContext.setShowLatestVersionsOnly(policy.getShowLatestVersionsOnly());
    queryContext.setShowInstallChildren(policy.getShowDrilldownRequirements());
    queryContext.setShowProvisioningPlanChildren(policy.getShowDrilldownRequirements());
    queryContext.setUseCategories(policy.getGroupByCategory());
    queryContext.setFilterOnEnv(policy.getFilterOnEnv());
    return queryContext;
  }
  
  public static <T> T getAdapter(Object object, Class<T> adapterType)
  {
    if (object == null) {
      return null;
    }
    if (adapterType.isInstance(object)) {
      return (T)object;
    }
    if ((object instanceof IAdaptable)) {
      return (T)((IAdaptable)object).getAdapter(adapterType);
    }
    return null;
  }
  
  public static Shell getDefaultParentShell()
  {
    return PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
  }
  
  public static void openUpdateManagerInstaller(Event event)
  {
    runCommand("org.eclipse.ui.update.findAndInstallUpdates", ProvUIMessages.UpdateManagerCompatibility_UnableToOpenFindAndInstall, event);
  }
  
  public static void openUpdateManagerConfigurationManager(Event event)
  {
    runCommand("org.eclipse.ui.update.manageConfiguration", ProvUIMessages.UpdateManagerCompatibility_UnableToOpenManageConfiguration, event);
  }
  
  public static void openInstallationDialog(Event event)
  {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

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