org.eclipse.pde.api.tools.ui_1.0.301.v20110803_r371

lapseAllAction collapseallAction;
  private IPropertySheetPage page;
  
  class ViewContentProvider
    implements IStructuredContentProvider, ITreeContentProvider
  {
    ITreeModel model;
    
    ViewContentProvider() {}
    
    public void inputChanged(Viewer v, Object oldInput, Object newInput)
    {
      model = null;
    }
    
    public void dispose() {}
    
    public Object[] getElements(Object parent)
    {
      if ((parent instanceof ISession))
      {
        ISession session = (ISession)parent;
        if (model == null) {
          model = session.getModel();
        }
        return getChildren(model.getRoot());
      }
      return getChildren(parent);
    }
    
    public Object getParent(Object child)
    {
      return null;
    }
    
    public Object[] getChildren(Object parent)
    {
      if ((parent instanceof ITreeNode)) {
        return ((ITreeNode)parent).getChildren();
      }
      return new Object[0];
    }
    
    public boolean hasChildren(Object parent)
    {
      if ((parent instanceof ITreeNode)) {
        return ((ITreeNode)parent).hasChildren();
      }
      return false;
    }
  }
  
  class ViewLabelProvider
    extends LabelProvider
  {
    ViewLabelProvider() {}
    
    public String getText(Object obj)
    {
      return obj.toString();
    }
    
    public Image getImage(Object obj)
    {
      if ((obj instanceof ITreeNode))
      {
        ITreeNode treeNode = (ITreeNode)obj;
        switch (treeNode.getId())
        {
        case 1: 
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.class_obj.gif");
        case 2: 
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.int_obj.gif");
        case 3: 
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.annotation_obj.gif");
        case 4: 
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.enum_obj.gif");
        case 5: 
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.package_obj.gif");
        }
        Object data = treeNode.getData();
        if ((data instanceof IDelta))
        {
          IDelta delta = (IDelta)data;
          Image image = getDeltaElementImage(delta);
          if (image != null)
          {
            int flags = DeltaProcessor.isCompatible(delta) ? 2 : 1;
            ImageDescriptor descriptor = ImageDescriptor.createFromImage(image);
            ApiImageDescriptor desc = new ApiImageDescriptor(descriptor, flags);
            return ApiUIPlugin.getImage(desc);
          }
        }
      }
      return null;
    }
    
    private Image getDeltaElementImage(IDelta delta)
    {
      switch (delta.getFlags())
      {
      case 16: 
      case 61: 
        int modifiers = delta.getNewModifiers();
        switch (delta.getKind())
        {
        case 3: 
          modifiers = delta.getOldModifiers();
        }
        if (Flags.isPublic(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.field_public_obj.gif");
        }
        if (Flags.isProtected(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.field_protected_obj.gif");
        }
        if (Flags.isPrivate(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.field_private_obj.gif");
        }
        return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.field_default_obj.gif");
      case 7: 
      case 8: 
      case 25: 
      case 26: 
      case 27: 
      case 28: 
      case 67: 
        int modifiers = delta.getNewModifiers();
        switch (delta.getKind())
        {
        case 3: 
          modifiers = delta.getOldModifiers();
        }
        if (Flags.isPublic(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.methpub_obj.gif");
        }
        if (Flags.isProtected(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.methpro_obj.gif");
        }
        if (Flags.isPrivate(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.methpri_obj.gif");
        }
        return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.class_default_obj.gif");
      }
      switch (delta.getElementType())
      {
      case 1: 
        return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.annotation_obj.gif");
      case 6: 
        return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.enum_obj.gif");
      case 4: 
        return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.class_obj.gif");
      case 8: 
        return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.int_obj.gif");
      case 7: 
        int modifiers = delta.getNewModifiers();
        switch (delta.getKind())
        {
        case 3: 
          modifiers = delta.getOldModifiers();
        }
        if (Flags.isPublic(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.field_public_obj.gif");
        }
        if (Flags.isProtected(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.field_protected_obj.gif");
        }
        if (Flags.isPrivate(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.field_private_obj.gif");
        }
        return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.field_default_obj.gif");
      case 5: 
      case 9: 
        int modifiers = delta.getNewModifiers();
        switch (delta.getKind())
        {
        case 3: 
          modifiers = delta.getOldModifiers();
        }
        if (Flags.isPublic(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.methpub_obj.gif");
        }
        if (Flags.isProtected(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.methpro_obj.gif");
        }
        if (Flags.isPrivate(modifiers)) {
          return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.methpri_obj.gif");
        }
        return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.class_default_obj.gif");
      case 10: 
        return JavaUI.getSharedImages().getImage("org.eclipse.jdt.ui.methpub_obj.gif");
      case 2: 
      case 3: 
        String componentVersionId = delta.getComponentVersionId();
        IApiComponent component = null;
        if (componentVersionId != null)
        {
          int indexOfOpen = componentVersionId.lastIndexOf('(');
          String componentID = componentVersionId.substring(0, indexOfOpen);
          IApiBaseline baseline = ApiBaselineManager.getManager().getWorkspaceBaseline();
          if (baseline != null)
          {
            IApiComponent apiComponent = baseline.getApiComponent(componentID);
            if (apiComponent != null) {
              component = apiComponent;
            }
          }
        }
        if (component != null)
        {
          if (component.isSystemComponent()) {
            return ApiUIPlugin.getSharedImage("IMG_OBJ_API_SYSTEM_LIBRARY");
          }
          try
          {
            if (component.isFragment()) {
              return ApiUIPlugin.getSharedImage("IMG_OBJ_FRAGMENT");
            }
          }
          catch (CoreException e)
          {
            ApiPlugin.log(e);
          }
        }
        return ApiUIPlugin.getSharedImage("IMG_OBJ_BUNDLE");
      }
      return null;
    }
  }
  
  public void createPartControl(Composite parent)
  {
    ViewForm form = new ViewForm(parent, 8388608);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(form, IApiToolsHelpContextIds.API_TOOLING_VIEW);
    sessionDescription = SWTFactory.createLabel(form, null, 1);
    form.setTopCenterSeparate(true);
    form.setTopCenter(sessionDescription);
    
    viewer = new TreeViewer(form, 770);
    viewer.setContentProvider(new ViewContentProvider());
    viewer.setComparator(
      new ViewerComparator()
      {
        public int category(Object element)
        {
          ITreeNode node = (ITreeNode)element;
          switch (node.getId())
          {
          case 5: 
            return 1;
          }
          return 0;
        }
      });
    viewer.setLabelProvider(new ViewLabelProvider());
    
    createActions();
    updateActions();
    configureToolbar();
    hookDoubleClickAction();
    
    form.setContent(viewer.getTree());
    getSite().setSelectionProvider(viewer);
    
    ISessionManager sessionManager = ApiPlugin.getDefault().getSessionManager();
    ISession[] sessions = sessionManager.getSessions();
    if (sessions.length > 0)
    {
      ISession activeSession = sessionManager.getActiveSession();
      if (sessions[0] != activeSession)
      {
        sessionManager.activateSession(sessions[0]);
      }
      else
      {
        viewer.setInput(activeSession);
        updateActions();
      }
    }
  }
  
  public void init(IViewSite site)
    throws PartInitException
  {
    super.init(site);
    ISessionManager sessionManager = ApiPlugin.getDefault().getSessionManager();
    sessionManager.addSessionListener(this);
  }
  
  private void hookDoubleClickAction()
  {
    viewer.addDoubleClickListener(new IDoubleClickListener()
    {
      public void doubleClick(DoubleClickEvent event)
      {
        doubleClickAction.run();
      }
    });
  }
  
  public void dispose()
  {
    ApiPlugin.getDefault().getSessionManager().removeSessionListener(this);
  }
  
  protected void configureToolbar()
  {
    IActionBars actionBars = getViewSite().getActionBars();
    IToolBarManager tbm = actionBars.getToolBarManager();
    tbm.add(new Separator());
    tbm.add(removeActiveSessionAction);
    tbm.add(removeAllSessionsAction);
    tbm.add(new Separator());
    tbm.add(selectSessionAction);
    tbm.add(new Separator());
    tbm.add(nextAction);
    tbm.add(previousAction);
    tbm.add(new Separator());
    tbm.add(expandallAction);
    tbm.add(collapseallAction);
    tbm.add(new Separator());
    tbm.add(exportSessionAction);
  }
  
  private void createActions()
  {
    IActionBars actionBars = getViewSite().getActionBars();
    
    removeActiveSessionAction = new RemoveActiveSessionAction();
    actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), removeActiveSessionAction);
    
    removeAllSessionsAction = new RemoveAllSessionsAction();
    selectSessionAction = new SelectSessionAction();
    doubleClickAction = new Action()
    {
      public void run()
      {
        ISelection selection = viewer.getSelection();
        if ((selection instanceof IStructuredSelection))
        {
          Object item = ((IStructuredSelection)selection).getFirstElement();
          if (viewer.getExpandedState(item)) {
            viewer.collapseToLevel(item, 1);
          } else {
            viewer.expandToLevel(item, 1);
          }
          if ((item instanceof ITreeNode))
          {
            ITreeNode node = (ITreeNode)item;
            if ((node.getData() != null) && (!node.hasChildren())) {
              ApiUIPlugin.getDefault().showPropertiesView();
            }
          }
        }
      }
    };
    exportSessionAction = new ExportSessionAction(this);
    nextAction = new NavigateAction(this, true);
    previousAction = new NavigateAction(this, false);
    expandallAction = new ExpandAllAction(viewer);
    collapseallAction = new CollapseAllAction(viewer);
  }
  
  private void updateActions()
  {
    viewer.getControl().getDisplay().asyncExec(new Runnable()
    {
      public void run()
      {
        ISessionManager sessionManager = ApiPlugin.getDefault().getSessionManager();
        ISession active = sessionManager.getActiveSession();
        sessionDescription.setText(active == null ? "No Description" : active.getDescription());
        ISession[] sessions = sessionManager.getSessions();
        boolean atLeastOne = sessions.length >= 1;
        removeActiveSessionAction.setEnabled(atLeastOne);
        removeAllSessionsAction.setEnabled(atLeastOne);
        selectSessionAction.setEnabled(atLeastOne);
        exportSessionAction.setEnabled(active != null);
        expandallAction.setEnabled(atLeastOne);
        collapseallAction.setEnabled(atLeastOne);
        nextAction.setEnabled(atLeastOne);
        previousAction.setEnabled(atLeastOne);
      }
    });
  }
  
  public void setFocus()
  {
    viewer.getControl().setFocus();
  }
  
  public void sessionAdded(ISession session)
  {
    viewer.getControl().getDisplay().asyncExec(new Runnable()
    {
      private final ISession val$session;
      
      public void run()
      {
        viewer.setInput(val$session);
      }
    });
    updateActions();
  }
  
  public void sessionRemoved(ISession session)
  {
    viewer.setInput(null);
    updateActions();
  }
  
  public void sessionActivated(ISession session)
  {
    viewer.getControl().getDisplay().asyncExec(new Runnable()
    {
      private final ISession val$session;
      
      public void run()
      {
        viewer.setInput(val$session);
      }
    });
    updateActions();
  }
  
  protected IPropertySheetPage getPropertySheet()
  {
    if (page == null) {
      page = new PropertySheetPage();
    }
    return page;
  }
  
  public Object getAdapter(Class adapter)
  {
    if (adapter.equals(IPropertySheetPage.class)) {
      return getPropertySheet();
    }
    return super.getAdapter(adapter);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.views.APIToolingView
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiBaseline;
import org.eclipse.pde.api.tools.ui.internal.ApiUIPlugin;

public class ApiBaselineWizard
  extends Wizard
{
  private IApiBaseline profile = null;
  private boolean content = false;
  
  public ApiBaselineWizard(IApiBaseline profile)
  {
    this.profile = profile;
    if (profile == null) {
      setWindowTitle(WizardMessages.ApiProfileWizard_0);
    } else {
      setWindowTitle(WizardMessages.ApiProfileWizard_1);
    }
    setNeedsProgressMonitor(true);
  }
  
  public IApiBaseline getProfile()
  {
    return profile;
  }
  
  public boolean contentChanged()
  {
    return content;
  }
  
  public void addPages()
  {
    addPage(new ApiBaselineWizardPage(profile));
  }
  
  public boolean performFinish()
  {
    try
    {
      ApiBaselineWizardPage page = (ApiBaselineWizardPage)getContainer().getCurrentPage();
      profile = page.finish();
      content = page.contentChanged();
      return profile != null;
    }
    catch (IOException e)
    {
      ApiUIPlugin.log(e);
    }
    catch (CoreException e)
    {
      ApiUIPlugin.log(e);
    }
    return false;
  }
  
  public boolean performCancel()
  {
    ApiBaselineWizardPage page = (ApiBaselineWizardPage)getContainer().getCurrentPage();
    page.cancel();
    return super.performCancel();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizard
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class ApiBaselineWizardPage$1
  implements ModifyListener
{
  final ApiBaselineWizardPage this$0;
  
  ApiBaselineWizardPage$1(ApiBaselineWizardPage paramApiBaselineWizardPage)
  {
    this$0 = paramApiBaselineWizardPage;
  }
  
  public void modifyText(ModifyEvent e)
  {
    this$0.setPageComplete(this$0.pageValid());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import java.util.Comparator;

class ApiBaselineWizardPage$2
  implements Comparator
{
  final ApiBaselineWizardPage this$0;
  
  ApiBaselineWizardPage$2(ApiBaselineWizardPage paramApiBaselineWizardPage)
  {
    this$0 = paramApiBaselineWizardPage;
  }
  
  public int compare(Object o1, Object o2)
  {
    return ((String)o1).compareTo((String)o2);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class ApiBaselineWizardPage$3
  implements ModifyListener
{
  final ApiBaselineWizardPage this$0;
  
  ApiBaselineWizardPage$3(ApiBaselineWizardPage paramApiBaselineWizardPage)
  {
    this$0 = paramApiBaselineWizardPage;
  }
  
  public void modifyText(ModifyEvent e)
  {
    this$0.setPageComplete(this$0.pageValid());
    this$0.updateButtons();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import org.eclipse.core.runtime.Path;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.DirectoryDialog;

class ApiBaselineWizardPage$4
  extends SelectionAdapter
{
  final ApiBaselineWizardPage this$0;
  
  ApiBaselineWizardPage$4(ApiBaselineWizardPage paramApiBaselineWizardPage)
  {
    this$0 = paramApiBaselineWizardPage;
  }
  
  public void widgetSelected(SelectionEvent e)
  {
    DirectoryDialog dialog = new DirectoryDialog(this$0.getShell());
    dialog.setMessage(WizardMessages.ApiProfileWizardPage_11);
    String loctext = this$0.locationcombo.getText().trim();
    if (loctext.length() > 0) {
      dialog.setFilterPath(loctext);
    }
    String newPath = dialog.open();
    if ((newPath != null) && ((!new Path(loctext).equals(new Path(newPath))) || 
      (this$0.getCurrentComponents().length == 0)))
    {
      this$0.locationcombo.setText(newPath);
      this$0.setErrorMessage(null);
      this$0.doReload();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.4
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

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

class ApiBaselineWizardPage$5
  extends SelectionAdapter
{
  final ApiBaselineWizardPage this$0;
  
  ApiBaselineWizardPage$5(ApiBaselineWizardPage paramApiBaselineWizardPage)
  {
    this$0 = paramApiBaselineWizardPage;
  }
  
  public void widgetSelected(SelectionEvent e)
  {
    this$0.doReload();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.5
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

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

class ApiBaselineWizardPage$6
  implements ISelectionChangedListener
{
  final ApiBaselineWizardPage this$0;
  
  ApiBaselineWizardPage$6(ApiBaselineWizardPage paramApiBaselineWizardPage)
  {
    this$0 = paramApiBaselineWizardPage;
  }
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    this$0.updateButtons();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.6
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.pde.api.tools.internal.model.SystemLibraryApiComponent;
import org.eclipse.pde.api.tools.internal.provisional.ApiPlugin;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;

class ApiBaselineWizardPage$7
  extends ViewerFilter
{
  final ApiBaselineWizardPage this$0;
  
  ApiBaselineWizardPage$7(ApiBaselineWizardPage paramApiBaselineWizardPage)
  {
    this$0 = paramApiBaselineWizardPage;
  }
  
  public boolean select(Viewer viewer, Object parentElement, Object element)
  {
    if ((element instanceof IApiComponent))
    {
      IApiComponent component = (IApiComponent)element;
      try
      {
        if ((component.isSourceComponent()) || (component.isSystemComponent())) {
          return false;
        }
      }
      catch (CoreException e)
      {
        ApiPlugin.log(e);
      }
      return true;
    }
    return !(element instanceof SystemLibraryApiComponent);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.7
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.pde.api.tools.internal.provisional.ApiPlugin;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;

class ApiBaselineWizardPage$ContentProvider
  implements ITreeContentProvider
{
  public Object[] getChildren(Object parentElement)
  {
    if ((parentElement instanceof IApiComponent)) {
      try
      {
        IApiComponent component = (IApiComponent)parentElement;
        String[] ees = component.getExecutionEnvironments();
        ArrayList entries = new ArrayList(ees.length);
        for (int i = 0; i < ees.length; i++) {
          entries.add(new ApiBaselineWizardPage.EEEntry(ees[i]));
        }
        return entries.toArray();
      }
      catch (CoreException e)
      {
        ApiPlugin.log(e);
      }
    }
    return null;
  }
  
  public boolean hasChildren(Object element)
  {
    if ((element instanceof IApiComponent)) {
      try
      {
        IApiComponent component = (IApiComponent)element;
        return component.getExecutionEnvironments().length > 0;
      }
      catch (CoreException e)
      {
        ApiPlugin.log(e);
      }
    }
    return false;
  }
  
  public Object[] getElements(Object inputElement)
  {
    if ((inputElement instanceof IApiComponent[])) {
      return (Object[])inputElement;
    }
    return new Object[0];
  }
  
  public void dispose() {}
  
  public Object getParent(Object element)
  {
    return null;
  }
  
  public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.ContentProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

public class ApiBaselineWizardPage$EEEntry
{
  String name = null;
  
  public ApiBaselineWizardPage$EEEntry(String name)
  {
    this.name = name;
  }
  
  public String toString()
  {
    return name;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.EEEntry
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import org.eclipse.jface.operation.IRunnableWithProgress;

class ApiBaselineWizardPage$ReloadOperation
  implements IRunnableWithProgress
{
  private String location;
  private String name;
  final ApiBaselineWizardPage this$0;
  
  public ApiBaselineWizardPage$ReloadOperation(ApiBaselineWizardPage paramApiBaselineWizardPage, String name, String location)
  {
    this$0 = paramApiBaselineWizardPage;
    this.location = location;
    this.name = name;
  }
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws java.lang.reflect.InvocationTargetException, java.lang.InterruptedException
  {
    // Byte code:
    //   0: aload_1
    //   1: getstatic 71	org/eclipse/pde/api/tools/ui/internal/wizards/WizardMessages:ApiProfileWizardPage_0	Ljava/lang/String;
    //   4: bipush 10
    //   6: invokeinterface 77 3 0
    //   11: aload_0
    //   12: getfield 70	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:this$0	Lorg/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage;
    //   15: aload_0
    //   16: getfield 69	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:name	Ljava/lang/String;
    //   19: aload_0
    //   20: getfield 68	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:location	Ljava/lang/String;
    //   23: invokestatic 73	org/eclipse/pde/api/tools/internal/model/ApiModelFactory:newApiBaseline	(Ljava/lang/String;Ljava/lang/String;)Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiBaseline;
    //   26: putfield 67	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage:fProfile	Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiBaseline;
    //   29: aload_0
    //   30: getfield 70	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:this$0	Lorg/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage;
    //   33: getfield 67	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage:fProfile	Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiBaseline;
    //   36: aload_0
    //   37: getfield 68	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:location	Ljava/lang/String;
    //   40: aload_1
    //   41: invokestatic 74	org/eclipse/pde/api/tools/internal/model/ApiModelFactory:addComponents	(Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiBaseline;Ljava/lang/String;Lorg/eclipse/core/runtime/IProgressMonitor;)[Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiComponent;
    //   44: pop
    //   45: aload_0
    //   46: getfield 70	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:this$0	Lorg/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage;
    //   49: iconst_1
    //   50: putfield 66	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage:contentchange	Z
    //   53: goto +26 -> 79
    //   56: astore_2
    //   57: aload_2
    //   58: invokestatic 75	org/eclipse/pde/api/tools/internal/provisional/ApiPlugin:log	(Ljava/lang/Throwable;)V
    //   61: aload_1
    //   62: invokeinterface 76 1 0
    //   67: goto +18 -> 85
    //   70: astore_3
    //   71: aload_1
    //   72: invokeinterface 76 1 0
    //   77: aload_3
    //   78: athrow
    //   79: aload_1
    //   80: invokeinterface 76 1 0
    //   85: return
    // Line number table:
    //   Java source line #169	-> byte code offset #0
    //   Java source line #171	-> byte code offset #11
    //   Java source line #172	-> byte code offset #29
    //   Java source line #173	-> byte code offset #45
    //   Java source line #174	-> byte code offset #56
    //   Java source line #175	-> byte code offset #57
    //   Java source line #178	-> byte code offset #61
    //   Java source line #177	-> byte code offset #70
    //   Java source line #178	-> byte code offset #71
    //   Java source line #179	-> byte code offset #77
    //   Java source line #178	-> byte code offset #79
    //   Java source line #180	-> byte code offset #85
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	86	0	this	ReloadOperation
    //   0	86	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   56	2	2	e	org.eclipse.core.runtime.CoreException
    //   70	8	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   11	53	56	org/eclipse/core/runtime/CoreException
    //   11	61	70	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.ReloadOperation
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.pde.api.tools.internal.model.ApiModelFactory;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiBaseline;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;
import org.eclipse.pde.api.tools.ui.internal.ApiUIPlugin;

class ApiBaselineWizardPage$WorkingCopyOperation
  implements IRunnableWithProgress
{
  IApiBaseline original = null;
  IApiBaseline workingcopy = null;
  
  public ApiBaselineWizardPage$WorkingCopyOperation(IApiBaseline original)
  {
    this.original = original;
  }
  
  public void run(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    try
    {
      IApiComponent[] components = original.getApiComponents();
      IProgressMonitor localmonitor = SubMonitor.convert(monitor, WizardMessages.ApiProfileWizardPage_create_working_copy, components.length + 1);
      localmonitor.subTask(WizardMessages.ApiProfileWizardPage_copy_profile_attribs);
      workingcopy = ApiModelFactory.newApiBaseline(original.getName(), original.getLocation());
      localmonitor.worked(1);
      localmonitor.subTask(WizardMessages.ApiProfileWizardPage_copy_api_components);
      ArrayList comps = new ArrayList();
      IApiComponent comp = null;
      for (int i = 0; i < components.length; i++)
      {
        comp = ApiModelFactory.newApiComponent(workingcopy, components[i].getLocation());
        if (comp != null) {
          comps.add(comp);
        }
        localmonitor.worked(1);
      }
      workingcopy.addApiComponents((IApiComponent[])comps.toArray(new IApiComponent[comps.size()]));
    }
    catch (CoreException ce)
    {
      ApiUIPlugin.log(ce);
    }
  }
  
  public IApiBaseline getWorkingCopy()
  {
    return workingcopy;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.ui.internal.wizards.ApiBaselineWizardPage.WorkingCopyOperation
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.ui.internal.wizards;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
import org.eclipse.jdt.launching.environments.IExecutionEnvironmentsManager;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.pde.api.tools.internal.ApiBaselineManager;
import org.eclipse.pde.api.tools.internal.model.ApiModelFactory;
import org.eclipse.pde.api.tools.internal.model.SystemLibraryApiComponent;
import org.eclipse.pde.api.tools.internal.provisional.ApiPlugin;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiBaseline;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;
import org.eclipse.pde.api.tools.ui.internal.ApiToolsLabelProvider;
import org.eclipse.pde.api.tools.ui.internal.ApiUIPlugin;
import org.eclipse.pde.api.tools.ui.internal.IApiToolsHelpContextIds;
import org.eclipse.pde.api.tools.ui.internal.SWTFactory;
import org.eclipse.pde.api.tools.ui.internal.preferences.ApiBaselinePreferencePage;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.help.IWorkbenchHelpSystem;

public class ApiBaselineWizardPage
  extends WizardPage
{
  public static class EEEntry
  {
    String name = null;
    
    public EEEntry(String name)
    {
      this.name = name;
    }
    
    public String toString()
    {
      return name;
    }
  }
  
  static class ContentProvider
    implements ITreeContentProvider
  {
    public Object[] getChildren(Object parentElement)
    {
      if ((parentElement instanceof IApiComponent)) {
        try
        {
          IApiComponent component = (IApiComponent)parentElement;
          String[] ees = component.getExecutionEnvironments();
          ArrayList entries = new ArrayList(ees.length);
          for (int i = 0; i < ees.length; i++) {
            entries.add(new ApiBaselineWizardPage.EEEntry(ees[i]));
          }
          return entries.toArray();
        }
        catch (CoreException e)
        {
          ApiPlugin.log(e);
        }
      }
      return null;
    }
    
    public boolean hasChildren(Object element)
    {
      if ((element instanceof IApiComponent)) {
        try
        {
          IApiComponent component = (IApiComponent)element;
          return component.getExecutionEnvironments().length > 0;
        }
        catch (CoreException e)
        {
          ApiPlugin.log(e);
        }
      }
      return false;
    }
    
    public Object[] getElements(Object inputElement)
    {
      if ((inputElement instanceof IApiComponent[])) {
        return (Object[])inputElement;
      }
      return new Object[0];
    }
    
    public void dispose() {}
    
    public Object getParent(Object element)
    {
      return null;
    }
    
    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
  }
  
  class ReloadOperation
    implements IRunnableWithProgress
  {
    private String location;
    private String name;
    
    public ReloadOperation(String name, String location)
    {
      this.location = location;
      this.name = name;
    }
    
    /* Error */
    public void run(IProgressMonitor monitor)
      throws InvocationTargetException, InterruptedException
    {
      // Byte code:
      //   0: aload_1
      //   1: getstatic 71	org/eclipse/pde/api/tools/ui/internal/wizards/WizardMessages:ApiProfileWizardPage_0	Ljava/lang/String;
      //   4: bipush 10
      //   6: invokeinterface 77 3 0
      //   11: aload_0
      //   12: getfield 70	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:this$0	Lorg/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage;
      //   15: aload_0
      //   16: getfield 69	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:name	Ljava/lang/String;
      //   19: aload_0
      //   20: getfield 68	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:location	Ljava/lang/String;
      //   23: invokestatic 73	org/eclipse/pde/api/tools/internal/model/ApiModelFactory:newApiBaseline	(Ljava/lang/String;Ljava/lang/String;)Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiBaseline;
      //   26: putfield 67	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage:fProfile	Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiBaseline;
      //   29: aload_0
      //   30: getfield 70	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:this$0	Lorg/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage;
      //   33: getfield 67	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage:fProfile	Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiBaseline;
      //   36: aload_0
      //   37: getfield 68	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:location	Ljava/lang/String;
      //   40: aload_1
      //   41: invokestatic 74	org/eclipse/pde/api/tools/internal/model/ApiModelFactory:addComponents	(Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiBaseline;Ljava/lang/String;Lorg/eclipse/core/runtime/IProgressMonitor;)[Lorg/eclipse/pde/api/tools/internal/provisional/model/IApiComponent;
      //   44: pop
      //   45: aload_0
      //   46: getfield 70	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage$ReloadOperation:this$0	Lorg/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage;
      //   49: iconst_1
      //   50: putfield 66	org/eclipse/pde/api/tools/ui/internal/wizards/ApiBaselineWizardPage:contentchange	Z
      //   53: goto +26 -> 79
      //   56: astore_2
      //   57: aload_2
      //   58: invokestatic 75	org/eclipse/pde/api/tools/internal/provisional/ApiPlugin:log	(Ljava/lang/Throwable;)V
      //   61: aload_1
      //   62: invokeinterface 76 1 0
      //   67: goto +18 -> 85
      //   70: astore_3
      //   71: aload_1
      //   72: invokeinterface 76 1 0
      //   77: aload_3
      //   78: athrow
      //   79: aload_1
      //   80: invokeinterface 76 1 0
      //   85: return
      // Line number table:
      //   Java source line #169	-> byte code offset #0
      //   Java source line #171	-> byte code offset #11
      //   Java source line #172	-> byte code offset #29
      //   Java source line #173	-> byte code offset #45
      //   Java source line #174	-> byte code offset #56
      //   Java source line #175	-> byte code offset #57
      //   Java source line #178	-> byte code offset #61
      //   Java source line #177	-> byte code offset #70
      //   Java source line #178	-> byte code offset #71
      //   Java source line #179	-> byte code offset #77
      //   Java source line #178	-> byte code offset #79
      //   Java source line #180	-> byte code offset #85
      // Local variable table:
      //   start	length	slot	name	signature
      //   0	86	0	this	ReloadOperation
      //   0	86	1	monitor	IProgressMonitor
      //   56	2	2	e	CoreException
      //   70	8	3	localObject	Object
      // Exception table:
      //   from	to	target	type
      //   11	53	56	org/eclipse/core/runtime/CoreException
      //   11	61	70	finally
    }
  }
  
  static class WorkingCopyOperation
    implements IRunnableWithProgress
  {
    IApiBaseline original = null;
    IApiBaseline workingcopy = null;
    
    public WorkingCopyOperation(IApiBaseline original)
    {
      this.original = original;
    }
    
    public void run(IProgressMonitor monitor)
      throws InvocationTargetException, InterruptedException
    {
      try
      {
        IApiComponent[] components = original.getApiComponents();
        IProgressMonitor localmonitor = SubMonitor.convert(monitor, WizardMessages.ApiProfileWizardPage_create_working_copy, components.length + 1);
        localmonitor.subTask(WizardMessages.ApiProfileWizardPage_copy_profile_attribs);
        workingcopy = ApiModelFactory.newApiBaseline(
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