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

.newChild(100)).toSet();
          Object existingFeatures = new ArrayList(result.size());
          for (Iterator localIterator2 = result.iterator(); localIterator2.hasNext();)
          {
            IInstallableUnit iu = (IInstallableUnit)localIterator2.next();
            ((List)existingFeatures).add(new IUDetail(iu, feature.getReferencedRepositories()));
          }
          newProposedFeature.put(feature, (IUDetail[])((List)existingFeatures).toArray(new IUDetail[((List)existingFeatures).size()]));
        }
        else
        {
          if (sub.isCanceled()) {
            throw new InterruptedException();
          }
          sub.worked(100);
        }
      }
    }
  }
  
  protected PatternFilter getPatternFilter()
  {
    return new P2ImportIUPatternFilter(getColumnConfig());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.ImportPage
 * 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.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.InstallOperation;
import org.eclipse.equinox.p2.operations.ProvisioningSession;

class ImportWizard$1$1$1
  extends InstallOperation
{
  final ImportWizard.1.1 this$2;
  
  ImportWizard$1$1$1(ImportWizard.1.1 param1, ProvisioningSession $anonymous0, Collection $anonymous1, SubMonitor paramSubMonitor)
  {
    super($anonymous0, $anonymous1);
  }
  
  protected void computeProfileChangeRequest(MultiStatus status, IProgressMonitor monitor)
  {
    monitor.done();
  }
  
  public IStatus getResolutionResult()
  {
    if (val$sub.isCanceled()) {
      return Status.CANCEL_STATUS;
    }
    return new Status(4, "org.eclipse.equinox.p2.ui.importexport", Messages.ImportWizard_CannotQuerySelection);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.ImportWizard.1.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.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
import org.eclipse.equinox.p2.engine.ProvisioningContext;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.InstallOperation;
import org.eclipse.equinox.p2.operations.ProfileChangeOperation;
import org.eclipse.equinox.p2.operations.ProvisioningSession;

class ImportWizard$1$1
  implements Runnable
{
  final ImportWizard.1 this$1;
  
  ImportWizard$1$1(ImportWizard.1 param1, SubMonitor paramSubMonitor) {}
  
  public void run()
  {
    ProvisioningContext context = ImportWizard.1.access$0(this$1).getProvisioningContext();
    ImportWizard.access$2(ImportWizard.1.access$0(this$1), ImportWizard.access$1(ImportWizard.1.access$0(this$1)));
    if (ImportWizard.access$3(ImportWizard.1.access$0(this$1)).length == 0)
    {
      ImportWizard.access$4(ImportWizard.1.access$0(this$1), new InstallOperation(new ProvisioningSession(AbstractPage.agent), new ArrayList())
      {
        protected void computeProfileChangeRequest(MultiStatus status, IProgressMonitor monitor)
        {
          monitor.done();
        }
        
        public IStatus getResolutionResult()
        {
          if (val$sub.isCanceled()) {
            return Status.CANCEL_STATUS;
          }
          return new Status(4, "org.eclipse.equinox.p2.ui.importexport", Messages.ImportWizard_CannotQuerySelection);
        }
      });
    }
    else
    {
      ImportWizard.access$4(ImportWizard.1.access$0(this$1), ImportWizard.access$5(ImportWizard.1.access$0(this$1), ImportWizard.access$3(ImportWizard.1.access$0(this$1))));
      ImportWizard.access$6(ImportWizard.1.access$0(this$1)).setProvisioningContext(context);
    }
  }
}

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

class ImportWizard$1$2
  implements Runnable
{
  final ImportWizard.1 this$1;
  
  ImportWizard$1$2(ImportWizard.1 param1) {}
  
  public void run()
  {
    ImportWizard.access$7(ImportWizard.1.access$0(this$1));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.ImportWizard.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.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
import org.eclipse.equinox.p2.engine.ProvisioningContext;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.InstallOperation;
import org.eclipse.equinox.p2.operations.ProfileChangeOperation;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Display;

class ImportWizard$1
  implements IRunnableWithProgress
{
  final ImportWizard this$0;
  
  ImportWizard$1(ImportWizard paramImportWizard) {}
  
  public void run(IProgressMonitor monitor)
    throws InterruptedException
  {
    final SubMonitor sub = SubMonitor.convert(monitor, 1000);
    ((ImportPage)ImportWizard.access$0(this$0)).recompute(sub.newChild(800));
    if (sub.isCanceled()) {
      throw new InterruptedException();
    }
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        ProvisioningContext context = this$0.getProvisioningContext();
        ImportWizard.access$2(this$0, ImportWizard.access$1(this$0));
        if (ImportWizard.access$3(this$0).length == 0)
        {
          ImportWizard.access$4(this$0, new InstallOperation(new ProvisioningSession(AbstractPage.agent), new ArrayList())
          {
            protected void computeProfileChangeRequest(MultiStatus status, IProgressMonitor monitor)
            {
              monitor.done();
            }
            
            public IStatus getResolutionResult()
            {
              if (val$sub.isCanceled()) {
                return Status.CANCEL_STATUS;
              }
              return new Status(4, "org.eclipse.equinox.p2.ui.importexport", Messages.ImportWizard_CannotQuerySelection);
            }
          });
        }
        else
        {
          ImportWizard.access$4(this$0, ImportWizard.access$5(this$0, ImportWizard.access$3(this$0)));
          ImportWizard.access$6(this$0).setProvisioningContext(context);
        }
      }
    });
    if (sub.isCanceled()) {
      throw new InterruptedException();
    }
    if (ImportWizard.access$6(this$0).resolveModal(sub.newChild(200)).getSeverity() == 8) {
      throw new InterruptedException();
    }
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        ImportWizard.access$7(this$0);
      }
    });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.ImportWizard.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.Collection;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.InstallOperation;
import org.eclipse.equinox.p2.operations.ProvisioningSession;

class ImportWizard$2
  extends InstallOperation
{
  final ImportWizard this$0;
  
  ImportWizard$2(ImportWizard paramImportWizard, ProvisioningSession $anonymous0, Collection $anonymous1)
  {
    super($anonymous0, $anonymous1);
  }
  
  public IStatus getResolutionResult()
  {
    return Status.CANCEL_STATUS;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.ImportWizard.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.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
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.internal.ImportExportActivator;
import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
import org.eclipse.equinox.internal.p2.ui.dialogs.ISelectableIUsPage;
import org.eclipse.equinox.internal.p2.ui.dialogs.InstallWizard;
import org.eclipse.equinox.internal.p2.ui.model.IUElementListRoot;
import org.eclipse.equinox.p2.engine.ProvisioningContext;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.operations.InstallOperation;
import org.eclipse.equinox.p2.operations.ProfileChangeOperation;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.statushandlers.StatusManager;
import org.osgi.framework.Bundle;

public class ImportWizard
  extends InstallWizard
  implements IImportWizard
{
  public ImportWizard()
  {
    this(ProvisioningUI.getDefaultUI(), null, null, null);
  }
  
  public ImportWizard(ProvisioningUI ui, InstallOperation operation, Collection<IInstallableUnit> initialSelections, LoadMetadataRepositoryJob preloadJob)
  {
    super(ui, operation, initialSelections, preloadJob);
    IDialogSettings workbenchSettings = ImportExportActivator.getDefault().getDialogSettings();
    String sectionName = "ImportWizard";
    IDialogSettings section = workbenchSettings.getSection(sectionName);
    if (section == null) {
      section = workbenchSettings.addNewSection(sectionName);
    }
    setDialogSettings(section);
  }
  
  public void init(IWorkbench workbench, IStructuredSelection selection)
  {
    setWindowTitle(Messages.ImportWizard_WINDOWTITLE);
    setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport").getEntry("icons/install_wiz.gif")));
    setNeedsProgressMonitor(true);
  }
  
  protected ISelectableIUsPage createMainPage(IUElementListRoot input, Object[] selections)
  {
    return new ImportPage(ui, this);
  }
  
  protected ProvisioningContext getProvisioningContext()
  {
    return ((ImportPage)mainPage).getProvisioningContext();
  }
  
  public void recomputePlan(IRunnableContext runnableContext)
  {
    if (((ImportPage)mainPage).hasUnloadedRepo()) {
      try
      {
        runnableContext.run(true, true, new IRunnableWithProgress()
        {
          public void run(IProgressMonitor monitor)
            throws InterruptedException
          {
            final SubMonitor sub = SubMonitor.convert(monitor, 1000);
            ((ImportPage)mainPage).recompute(sub.newChild(800));
            if (sub.isCanceled()) {
              throw new InterruptedException();
            }
            Display.getDefault().syncExec(new Runnable()
            {
              public void run()
              {
                ProvisioningContext context = getProvisioningContext();
                initializeResolutionModelElements(ImportWizard.access$1(ImportWizard.this));
                if (planSelections.length == 0)
                {
                  operation = new InstallOperation(new ProvisioningSession(AbstractPage.agent), new ArrayList())
                  {
                    protected void computeProfileChangeRequest(MultiStatus status, IProgressMonitor monitor)
                    {
                      monitor.done();
                    }
                    
                    public IStatus getResolutionResult()
                    {
                      if (val$sub.isCanceled()) {
                        return Status.CANCEL_STATUS;
                      }
                      return new Status(4, "org.eclipse.equinox.p2.ui.importexport", Messages.ImportWizard_CannotQuerySelection);
                    }
                  };
                }
                else
                {
                  operation = getProfileChangeOperation(planSelections);
                  operation.setProvisioningContext(context);
                }
              }
            });
            if (sub.isCanceled()) {
              throw new InterruptedException();
            }
            if (operation.resolveModal(sub.newChild(200)).getSeverity() == 8) {
              throw new InterruptedException();
            }
            Display.getDefault().asyncExec(new Runnable()
            {
              public void run()
              {
                planChanged();
              }
            });
          }
        });
      }
      catch (InterruptedException localInterruptedException)
      {
        operation = new InstallOperation(new ProvisioningSession(AbstractPage.agent), new ArrayList())
        {
          public IStatus getResolutionResult()
          {
            return Status.CANCEL_STATUS;
          }
        };
      }
      catch (InvocationTargetException e)
      {
        ProvUI.handleException(e.getCause(), null, 3);
        unableToResolve(null);
      }
    } else {
      super.recomputePlan(runnableContext);
    }
  }
  
  void unableToResolve(String message)
  {
    IStatus couldNotResolveStatus;
    IStatus couldNotResolveStatus;
    if (message != null) {
      couldNotResolveStatus = new Status(4, "org.eclipse.equinox.p2.ui.importexport", message, null);
    } else {
      couldNotResolveStatus = new Status(4, "org.eclipse.equinox.p2.ui.importexport", ProvUIMessages.ProvisioningOperationWizard_UnexpectedFailureToResolve, null);
    }
    StatusManager.getManager().handle(couldNotResolveStatus, 1);
  }
}

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

import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
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.ILog;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;

class StyledErrorDialog$1
  extends HyperlinkAdapter
{
  final StyledErrorDialog this$0;
  
  StyledErrorDialog$1(StyledErrorDialog paramStyledErrorDialog) {}
  
  public void linkActivated(HyperlinkEvent event)
  {
    try
    {
      URI uri = URI.create((String)data);
      if ("pref".equals(uri.getScheme()))
      {
        Map<String, String> para = new HashMap();
        para.put("preferencePageId", uri.getAuthority()); Class 
          tmp55_52 = StyledErrorDialog.class$0;
        if (tmp55_52 == null)
        {
          tmp55_52;
          try
          {
            tmpTernaryOp = (StyledErrorDialog.class$0 = Class.forName("org.eclipse.ui.commands.ICommandService"));
          }
          catch (ClassNotFoundException localClassNotFoundException)
          {
            throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
          }
        }
        Command prefCommand = ((ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(tmp55_52)).getCommand("org.eclipse.ui.window.preferences");
        prefCommand.executeWithChecks(new ExecutionEvent(prefCommand, para, null, null));
      }
    }
    catch (ExecutionException e)
    {
      Platform.getLog(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport")).log(new Status(4, "org.eclipse.equinox.p2.ui.importexport", e.getMessage(), e));
    }
    catch (NotDefinedException e)
    {
      Platform.getLog(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport")).log(new Status(4, "org.eclipse.equinox.p2.ui.importexport", e.getMessage(), e));
    }
    catch (NotEnabledException e)
    {
      Platform.getLog(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport")).log(new Status(4, "org.eclipse.equinox.p2.ui.importexport", e.getMessage(), e));
    }
    catch (NotHandledException e)
    {
      Platform.getLog(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport")).log(new Status(4, "org.eclipse.equinox.p2.ui.importexport", e.getMessage(), e));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.StyledErrorDialog.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.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.graphics.Image;

class StyledErrorDialog$2
  extends AccessibleAdapter
{
  final StyledErrorDialog this$0;
  
  StyledErrorDialog$2(StyledErrorDialog paramStyledErrorDialog, Image paramImage) {}
  
  public void getName(AccessibleEvent event)
  {
    String accessibleMessage = StyledErrorDialog.access$0(this$0, val$image);
    if (accessibleMessage == null) {
      return;
    }
    result = accessibleMessage;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.importexport.internal.wizard.StyledErrorDialog.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.net.URI;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
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.ILog;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.accessibility.Accessible;
import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;

public class StyledErrorDialog
  extends MessageDialog
{
  static Class class$0;
  
  public static boolean openQuestion(Shell parent, String title, String message)
  {
    return open(3, parent, title, message, 0);
  }
  
  public static void openInformation(Shell parent, String title, String message)
  {
    open(2, parent, title, message, 0);
  }
  
  public static void openWarning(Shell parent, String title, String message)
  {
    open(4, parent, title, message, 0);
  }
  
  public static boolean open(int kind, Shell parent, String title, String message, int style)
  {
    StyledErrorDialog dialog = new StyledErrorDialog(parent, title, null, message, kind, getButtonLabels(kind), 0);
    int style2 = style & 0x10000000;
    dialog.setShellStyle(dialog.getShellStyle() | style2);
    return dialog.open() == 0;
  }
  
  static String[] getButtonLabels(int kind)
  {
    String[] dialogButtonLabels;
    String[] dialogButtonLabels;
    String[] dialogButtonLabels;
    String[] dialogButtonLabels;
    switch (kind)
    {
    case 1: 
    case 2: 
    case 4: 
      dialogButtonLabels = new String[] { IDialogConstants.OK_LABEL };
      break;
    case 5: 
      dialogButtonLabels = new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL };
      break;
    case 3: 
      dialogButtonLabels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL };
      break;
    case 6: 
      dialogButtonLabels = new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL };
      break;
    default: 
      throw new IllegalArgumentException("Illegal value for kind in MessageDialog.open()");
    }
    String[] dialogButtonLabels;
    return dialogButtonLabels;
  }
  
  public StyledErrorDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, int imageType, String[] buttonLabels, int defaultIndex)
  {
    super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, imageType, buttonLabels, defaultIndex);
  }
  
  protected Control createMessageArea(Composite composite)
  {
    Image image = getImage();
    if (image != null)
    {
      imageLabel = new Label(composite, 0);
      image.setBackground(imageLabel.getBackground());
      imageLabel.setImage(image);
      addAccessibleListeners(imageLabel, image);
      GridDataFactory.fillDefaults().align(16777216, 1).applyTo(imageLabel);
    }
    if (message != null)
    {
      FormToolkit toolkit = new FormToolkit(Display.getDefault());
      Composite toolkitComp = toolkit.createComposite(composite);
      toolkitComp.setLayout(new FillLayout(768));
      FormText text = toolkit.createFormText(toolkitComp, false);
      text.setText(message, true, true);
      text.setBackground(composite.getBackground());
      GridDataFactory.fillDefaults().align(4, 1).grab(true, false).hint(convertHorizontalDLUsToPixels(300), -1).applyTo(toolkitComp);
      text.addHyperlinkListener(new HyperlinkAdapter()
      {
        public void linkActivated(HyperlinkEvent event)
        {
          try
          {
            URI uri = URI.create((String)data);
            if ("pref".equals(uri.getScheme()))
            {
              Map<String, String> para = new HashMap();
              para.put("preferencePageId", uri.getAuthority()); Class 
                tmp55_52 = StyledErrorDialog.class$0;
              if (tmp55_52 == null)
              {
                tmp55_52;
                try
                {
                  tmpTernaryOp = (StyledErrorDialog.class$0 = Class.forName("org.eclipse.ui.commands.ICommandService"));
                }
                catch (ClassNotFoundException localClassNotFoundException)
                {
                  throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
                }
              }
              Command prefCommand = ((ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(tmp55_52)).getCommand("org.eclipse.ui.window.preferences");
              prefCommand.executeWithChecks(new ExecutionEvent(prefCommand, para, null, null));
            }
          }
          catch (ExecutionException e)
          {
            Platform.getLog(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport")).log(new Status(4, "org.eclipse.equinox.p2.ui.importexport", e.getMessage(), e));
          }
          catch (NotDefinedException e)
          {
            Platform.getLog(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport")).log(new Status(4, "org.eclipse.equinox.p2.ui.importexport", e.getMessage(), e));
          }
          catch (NotEnabledException e)
          {
            Platform.getLog(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport")).log(new Status(4, "org.eclipse.equinox.p2.ui.importexport", e.getMessage(), e));
          }
          catch (NotHandledException e)
          {
            Platform.getLog(Platform.getBundle("org.eclipse.equinox.p2.ui.importexport")).log(new Status(4, "org.eclipse.equinox.p2.ui.importexport", e.getMessage(), e));
          }
        }
      });
    }
    return composite;
  }
  
  private void addAccessibleListeners(Label label, final Image image)
  {
    label.getAccessible().addAccessibleListener(new AccessibleAdapter()
    {
      public void getName(AccessibleEvent event)
      {
        String accessibleMessage = StyledErrorDialog.this.getAccessibleMessageFor(image);
        if (accessibleMessage == null) {
          return;
        }
        result = accessibleMessage;
      }
    });
  }
  
  private String getAccessibleMessageFor(Image image)
  {
    if (image.equals(getErrorImage())) {
      return JFaceResources.getString("error");
    }
    if (image.equals(getWarningImage())) {
      return JFaceResources.getString("warning");
    }
    if (image.equals(getInfoImage())) {
      return JFaceResources.getString("info");
    }
    if (image.equals(getQuestionImage())) {
      return JFaceResources.getString("question");
    }
    return null;
  }
}

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

import org.eclipse.equinox.p2.metadata.Version;

public abstract interface P2FConstants
{
  public static final Version CURRENT_VERSION = Version.createOSGi(1, 0, 0);
  public static final String P2F_ELEMENT = "p2f";
  public static final String IUS_ELEMENT = "ius";
  public static final String IU_ELEMENT = "iu";
  public static final String REPOSITORIES_ELEMENT = "repositories";
  public static final String REPOSITORY_ELEMENT = "repository";
  public static final String P2FURI_ATTRIBUTE = "uri";
}

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

import java.util.List;
import org.eclipse.equinox.internal.p2.importexport.IUDetail;
import org.eclipse.equinox.internal.p2.persistence.XMLParser;
import org.eclipse.equinox.internal.p2.persistence.XMLParser.AbstractHandler;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.metadata.Version;
import org.xml.sax.Attributes;

public class P2FParser$IUHandler
  extends XMLParser.AbstractHandler
{
  private final String[] required = { "id", "name", "version" };
  private final String[] optional = new String[0];
  IInstallableUnit iu = null;
  private P2FParser.RepositoriesHandler repositoriesHandler;
  private List<IUDetail> ius;
  final P2FParser this$0;
  
  public P2FParser$IUHandler(XMLParser.AbstractHandler arg1, Attributes parentHandler, List<IUDetail> attributes)
  {
    super(???, parentHandler, "iu");
    String[] values = parseAttributes(attributes, required, optional);
    if (values[0] == null) {
      return;
    }
    MetadataFactory.InstallableUnitDescription desc = new MetadataFactory.InstallableUnitDescription();
    desc.setId(values[0]);
    desc.setProperty("org.eclipse.equinox.p2.name", values[1]);
    desc.setVersion(Version.create(values[2]));
    iu = MetadataFactory.createInstallableUnit(desc);
    this.ius = ius;
  }
  
  public void startElement(String name, Attributes attributes)
  {
    if (name.equals("repositories")) {
      repositoriesHandler = new P2FParser.RepositoriesHandler(this$0, this, attributes);
    }
  }
  
  protected void finished()
  {
    if (this$0.isValidXML()) {
      ius.add(new IUDetail(iu, repositoriesHandler.getRepositories()));
    }
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.equinox.internal.p2.importexport.IUDetail;
import org.eclipse.equinox.internal.p2.persistence.XMLParser;
import org.eclipse.equinox.internal.p2.persistence.XMLParser.AbstractHandler;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;

public class P2FParser$IUsHandler
  extends XMLParser.AbstractHandler
{
  private final List<IUDetail> ius;
  final P2FParser this$0;
  
  public P2FParser$IUsHandler(P2FParser arg1, ContentHandler parentHandler, Attributes attributes)
  {
    super(???, parentHandler, "ius");
    String size = parseOptionalAttribute(attributes, "size");
    ius = (size != null ? new ArrayList(new Integer(size).intValue()) : new ArrayList());
  }
  
  public void startElement(String name, Attributes attributes)
  {
    if (name.equals("iu")) {
      new P2FParser.IUHandler(this$0, this, attributes, ius);
    } else {
      invalidElement(name, attributes);
    }
  }
  
  public List<IUDetail> getIUs()
  {
    return ius;
  }
}

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

import org.eclipse.equinox.internal.p2.importexport.VersionIncompatibleException;
import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
import org.eclipse.equinox.internal.p2.persistence.XMLParser.DocHandler;
import org.eclipse.equinox.internal.p2.persistence.XMLParser.RootHandler;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.osgi.util.NLS;

final class P2FParser$P2FDocHandler
  extends XMLParser.DocHandler
{
  final P2FParser this$0;
  
  public P2FParser$P2FDocHandler(P2FParser paramP2FParser, String rootName, XMLParser.RootHandler rootHandler)
  {
    super(paramP2FParser, rootName, rootHandler);
  }
  
  public void processingInstruction(String target, String data)
  {
    if ("p2f".equals(target))
    {
      Version repositoryVersion = this$0.extractPIVersion(target, data);
      if (!P2FParser.XML_TOLERANCE.isIncluded(repositoryVersion)) {
        throw new VersionIncompatibleException(NLS.bind(Messages.io_IncompatibleVersion, repositoryVersion, P2FParser.XML_TOLERANCE));
      }
    }
  }
}

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

import org.eclipse.equinox.internal.p2.persistence.XMLParser.RootHandler;
import org.xml.sax.Attributes;

final class P2FParser$P2FHandler
  extends XMLParser.RootHandler
{
  P2FParser$P2FHandler(P2FParser paramP2FParser)
  {
    super(paramP2FParser);
  }
  
  private final String[] required = new String[0];
  private final String[] optional = new String[0];
  private P2FParser.IUsHandler iusHandler;
  final P2FParser this$0;
  
  protected void handleRootAttributes(Attributes attributes)
  {
    parseAttributes(attributes, required, optional);
  }
  
  public void startElement(String name, Attributes attributes)
  {
    if ("ius".equals(name))
    {
      if (iusHandler == null) {
        iusHandler = new P2FParser.IUsHandler(this$0, this, attributes);
      } else {
        this$0.duplicateElement(this, name, attributes);
      }
    }
    else {
      invalidElement(name, attributes);
    }
  }
  
  protected void finished()
  {
    if ((this$0.isValidXML()) && 
      (iusHandler != null)) {
      this$0.iusListed = iusHandler.getIUs();
    }
  }
}

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

import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.equinox.internal.p2.persistence.XMLParser;
import org.eclipse.equinox.internal.p2.persistence.XMLParser.AbstractHandler;
import org.xml.sax.Attributes;

public class P2FParser$RepositoriesHandler
  extends XMLParser.AbstractHandler
{
  List<URI> uris;
  final P2FParser this$0;
  
  public P2FParser$RepositoriesHandler(P2FParser arg1, XMLParser.AbstractHandler parentHandler, Attributes attributes)
  {
    super(???, parentHandler, "repositories");
    String size = parseOptionalAttribute(attributes, "size");
    uris = (size == null ? new ArrayList() : new ArrayList(new Integer(size).intValue()));
  }
  
  public void startElement(String name, Attributes attributes)
  {
    if (name.equals("repository")) {
      new P2FParser.RepositoryHandler(this$0, this, attributes, uris);
    }
  }
  
  public List<URI> getRepositories()
  {
    return uris;
  }
}

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

import java.net.URI;
import java.util.List;
import org.eclipse.equinox.internal.p2.persistence.XMLParser;
import org.eclipse.equinox.internal.p2.persistence.XMLParser.AbstractHandler;
import org.xml.sax.Attributes;

public class P2FParser$RepositoryHandler
  extends XMLParser.AbstractHandler
{
  private final String[] required = { "location" };
  private final String[] optional = new String[0];
  private URI referredRepo;
  private List<URI> uri;
  final P2FParser this$0;
  
  public P2FParser$RepositoryHandler(XMLParser.AbstractHandler arg1, Attributes parentHandler, List<URI> attributes)
  {
    super(???, parentHandler, "repository");
    String[] values = parseAttributes(attributes, required, optional);
    if (values[0] == null) {
      return;
    }
    this.uri = uri;
    referredRepo = ???.checkURI("repository", "location", values[0]);
  }
  
  public void startElement(String name, Attributes attributes)
  {
    this$0.checkCancel();
  }
  
  protected void finished()
  {
    if (referredRepo != null) {
      uri.add(referredRepo);
    }
  }
}

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

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.equinox.internal.p2.importexport.IUDetail;
import org.eclipse.equinox.internal.p2.importexport.VersionIncompatibleException;
import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
import org.eclipse.equinox.internal.p2.persistence.XMLParser;
import org.eclipse.equinox.internal.p2.persistence.XMLParser.AbstractHandler;
import org.eclipse.equinox.internal.p2.persistence.XMLParser.DocHandler;
import org.eclipse.equinox.internal.p2.persistence.XMLParser.RootHandler;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.MetadataFactory;
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.metadata.VersionRange;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.BundleContext;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;

public class P2FParser
  extends XMLParser
  implements P2FConstants
{
  static final VersionRange XML_TOLERANCE = new VersionRange(Version.createOSGi(1, 0, 0), true, Version.createOSGi(2, 0, 0), false);
  List<IUDetail> iusListed;
  
  protected class RepositoryHandler
    extends XMLParser.AbstractHandler
  {
    private final String[] required = { "location" };
    private final String[] optional = new String[0];
    private URI referredRepo;
    private List<URI> uri;
    
    public RepositoryHandler(Attributes parentHandler, List<URI> attributes)
    {
      super(parentHandler, "repository");
      String[] values = parseAttributes(attributes, required, optional);
      if (values[0] == null) {
        return;
      }
      this.uri = uri;
      referredRepo = checkURI("repository", "location", values[0]);
    }
    
    public void startElement(String name, Attributes attributes)
    {
      checkCancel();
    }
    
    protected void finished()
    {
      if (referredRepo != null) {
        uri.add(referredRepo);
      }
    }
  }
  
  protected class RepositoriesHandler
    extends XMLParser.AbstractHandler
  {
    List<URI> uris;
    
    public RepositoriesHandler(XMLParser.AbstractHandler parentHandler, Attributes attributes)
    {
      super(parentHandler, "repositories");
      String size = parseOptionalAttribute(attributes, "size");
      uris = (size == null ? new ArrayList() : new ArrayList(new Integer(size).intValue()));
    }
    
    public void startElement(String name, Attributes attributes)
    {
      if (name.equals("repository")) {
        new P2FParser.RepositoryHandler(P2FParser.this, this, attributes, uris);
      }
    }
    
    public List<URI> getRepositories()
    {
      return uris;
    }
  }
  
  protected class IUHandler
    extends XMLParser.AbstractHandler
  {
    private final String[] required = { "id", "name", "version" };
    private final String[] optional = new String[0];
    IInstallableUnit iu = null;
    private P2FParser.RepositoriesHandler repositoriesHandler;
    private List<IUDetail> ius;
    
    public IUHandler(Attributes parentHandler, List<IUDetail> attributes)
    {
      super(parentHandler, "iu");
      String[] values = parseAttributes(attributes, required, optional);
      if (values[0] == null) {
        return;
      }
      MetadataFactory.Install
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-2019. Infinite Loop Ltd