org.eclipse.wst.common.modulecore.ui_1.0.102.v201201262000

16:48:51.951 INFO  jd.cli.Main - Decompiling org.eclipse.wst.common.modulecore.ui_1.0.102.v201201262000.jar
package org.eclipse.wst.common.componentcore.internal.impl;

import java.util.HashMap;
import java.util.Map;

public class TaskModel
{
  private Map<String, Object> map = new HashMap();
  
  public Object getObject(String id)
  {
    try
    {
      return map.get(id);
    }
    catch (Exception localException) {}
    return null;
  }
  
  public void putObject(String id, Object obj)
  {
    map.put(id, obj);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.internal.impl.TaskModel
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui;

public abstract interface IModuleCoreUIContextIds
{
  public static final String DEPLOYMENT_ASSEMBLY_PREFERENCE_PAGE_ADD_NEW_REFERENCE_P1 = "org.eclipse.wst.common.modulecore.ui.DEPLOYMENT_ASSEMBLY_PREFERENCE_PAGE_ADD_NEW_REFERENCE_P1";
  public static final String DEPLOYMENT_ASSEMBLY_PREFERENCE_PAGE_ADD_NEW_PROJECT_REFERENCE_P1 = "org.eclipse.wst.common.modulecore.ui.DEPLOYMENT_ASSEMBLY_PREFERENCE_PAGE_ADD_NEW_PROJECT_REFERENCE_P1";
  public static final String DEPLOYMENT_ASSEMBLY_PREFERENCE_PAGE_ADD_NEW_FOLDER_MAPPING_P1 = "org.eclipse.wst.common.modulecore.ui.DEPLOYMENT_ASSEMBLY_PREFERENCE_PAGE_ADD_NEW_FOLDER_MAPPING_P1";
  public static final String DEPLOYMENT_ASSEMBLY_PREFERENCE_PAGE_DEPLOYMENT_ASSEMBLY_TAB = "org.eclipse.wst.common.modulecore.ui.DEPLOYMENT_ASSEMBLY_PREFERENCE_PAGE_DEPLOYMENT_ASSEMBLY_TAB";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.IModuleCoreUIContextIds
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.wst.common.componentcore.ui.messages";
  public static String ModuleAssemblyRootPageDescription;
  public static String ErrorCheckingFacets;
  public static String ErrorNotVirtualComponent;
  public static String DeploymentAssemblyVerifierHelper_0;
  public static String DeployPathColumn;
  public static String SourceColumn;
  public static String InternalLibJarWarning;
  public static String AddFolder;
  public static String AddFolderElipses;
  public static String AddFolderMappings;
  public static String AddEllipsis;
  public static String EditEllipsis;
  public static String RemoveSelected;
  public static String JarTitle;
  public static String JarDescription;
  public static String ExternalJarTitle;
  public static String ExternalJarDescription;
  public static String Browse;
  public static String NewReferenceTitle;
  public static String NewReferenceDescription;
  public static String NewReferenceWizard;
  public static String ProjectReferenceTitle;
  public static String ProjectReferenceDescription;
  public static String VariableReferenceTitle;
  public static String VariableReferenceDescription;
  public static String WizardError;
  public static String ProjectConversionError;
  public static String ExistingFolderError;
  public static String Revert;
  public static String ErrorEntryNotFound;
  
  static
  {
    NLS.initializeMessages("org.eclipse.wst.common.componentcore.ui.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui;

import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;

public class ModuleCoreUIPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.wst.common.modulecore.ui";
  public static final String[] ICON_DIRS = { "icons/full/obj16", 
    "icons/full/cview16", 
    "icons/full/ctool16", 
    "icons/full/clcl16", 
    "icons/full/ovr16", 
    "icons/full/extra", 
    "icons/full/wizban", 
    "icons", 
    "" };
  private static ModuleCoreUIPlugin plugin;
  
  public static ModuleCoreUIPlugin getInstance()
  {
    return plugin;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public Image getImage(String key)
  {
    ImageRegistry imageRegistry = getImageRegistry();
    Image image = imageRegistry.get(key);
    if ((image == null) || (image.isDisposed()))
    {
      ImageDescriptor descriptor = getImageDescriptor(key);
      if (descriptor != null)
      {
        image = descriptor.createImage();
        imageRegistry.put(key, image);
      }
    }
    return image;
  }
  
  public ImageDescriptor getImageDescriptor(String key)
  {
    ImageDescriptor imageDescriptor = null;
    URL gifImageURL = getImageURL(key, getBundle());
    if (gifImageURL != null) {
      imageDescriptor = ImageDescriptor.createFromURL(gifImageURL);
    }
    return imageDescriptor;
  }
  
  public URL getImageURL(String key, Bundle bundle)
  {
    String gif = "/" + key + ".gif";
    IPath path = null;
    for (int i = 0; i < ICON_DIRS.length; i++)
    {
      path = new Path(ICON_DIRS[i]).append(gif);
      if (Platform.find(bundle, path) != null) {
        try
        {
          return new URL(bundle.getEntry("/"), path.toString());
        }
        catch (MalformedURLException exception)
        {
          logError(exception);
        }
      }
    }
    return null;
  }
  
  public static ModuleCoreUIPlugin getDefault()
  {
    return plugin;
  }
  
  public static void log(Exception e)
  {
    log(e.getMessage(), e);
  }
  
  public static void log(String message, Exception e)
  {
    IStatus status = new Status(4, "org.eclipse.wst.common.modulecore.ui", message, e);
    getDefault().getLog().log(status);
  }
  
  public static IStatus createStatus(int severity, int aCode, String aMessage, Throwable exception)
  {
    return new Status(severity, "org.eclipse.wst.common.modulecore.ui", aCode, 
      aMessage != null ? aMessage : "No message.", exception);
  }
  
  public static IStatus createErrorStatus(int aCode, String aMessage, Throwable exception)
  {
    return createStatus(4, aCode, aMessage, exception);
  }
  
  public static IStatus createStatus(int severity, String message, Throwable exception)
  {
    return new Status(severity, "org.eclipse.wst.common.modulecore.ui", message, exception);
  }
  
  public static IStatus createStatus(int severity, String message)
  {
    return createStatus(severity, message, null);
  }
  
  public static void logError(Throwable exception)
  {
    Platform.getLog(Platform.getBundle("org.eclipse.wst.common.modulecore.ui")).log(createStatus(4, exception.getMessage(), exception));
  }
  
  public static void logError(CoreException exception)
  {
    Platform.getLog(Platform.getBundle("org.eclipse.wst.common.modulecore.ui")).log(exception.getStatus());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.ModuleCoreUIPlugin
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui;

import java.io.PrintStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Status;

public class Trace
{
  public static final byte CONFIG = 0;
  public static final byte INFO = 1;
  public static final byte WARNING = 2;
  public static final byte SEVERE = 3;
  public static final byte FINEST = 4;
  public static final byte FINER = 5;
  public static final byte PERFORMANCE = 6;
  public static final byte EXTENSION_POINT = 7;
  private static final String[] levelNames = {
    "CONFIG ", "INFO   ", "WARNING", "SEVERE ", "FINER  ", "FINEST ", "PERF   ", "EXTENSION" };
  private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy HH:mm.ss.SSS");
  private static Set<String> logged = new HashSet();
  
  public static void trace(byte level, String s)
  {
    trace(level, s, null);
  }
  
  public static void trace(byte level, String s, Throwable t)
  {
    if (s == null) {
      return;
    }
    if ((level == 3) && 
      (!logged.contains(s)))
    {
      ModuleCoreUIPlugin.getInstance().getLog().log(
        new Status(4, 
        "org.eclipse.wst.common.modulecore.ui", s, t));
      logged.add(s);
    }
    if (!ModuleCoreUIPlugin.getInstance().isDebugging()) {
      return;
    }
    StringBuffer sb = new StringBuffer("org.eclipse.wst.common.modulecore.ui");
    sb.append(" ");
    sb.append(levelNames[level]);
    sb.append(" ");
    sb.append(sdf.format(new Date()));
    sb.append(" ");
    sb.append(s);
    System.out.println(sb.toString());
    if (t != null) {
      t.printStackTrace();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.Trace
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import org.eclipse.core.resources.IContainer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;

class AddFolderDialog$1
  implements ISelectionChangedListener
{
  AddFolderDialog$1(AddFolderDialog paramAddFolderDialog) {}
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    IStructuredSelection sel = (IStructuredSelection)AddFolderDialog.access$0(this$0).getSelection();
    Object first = sel.getFirstElement();
    if ((first instanceof IContainer)) {
      AddFolderDialog.access$1(this$0, (IContainer)first);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.internal.propertypage.AddFolderDialog.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import org.eclipse.core.resources.IContainer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

class AddFolderDialog$2
  extends ViewerFilter
{
  AddFolderDialog$2(AddFolderDialog paramAddFolderDialog) {}
  
  public boolean select(Viewer viewer, Object parentElement, Object element)
  {
    return element instanceof IContainer;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.internal.propertypage.AddFolderDialog.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;

class AddFolderDialog$3
  implements ITreeContentProvider
{
  AddFolderDialog$3(AddFolderDialog paramAddFolderDialog) {}
  
  public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
  
  public void dispose() {}
  
  public Object[] getElements(Object inputElement)
  {
    try
    {
      return AddFolderDialog.access$2(this$0).members();
    }
    catch (CoreException localCoreException) {}
    return new Object[0];
  }
  
  public boolean hasChildren(Object element)
  {
    if ((element instanceof IContainer)) {
      try
      {
        return ((IContainer)element).members().length > 0;
      }
      catch (CoreException localCoreException) {}
    }
    return false;
  }
  
  public Object getParent(Object element)
  {
    if ((element instanceof IResource)) {
      return ((IResource)element).getParent();
    }
    return null;
  }
  
  public Object[] getChildren(Object parentElement)
  {
    if ((parentElement instanceof IContainer)) {
      try
      {
        return ((IContainer)parentElement).members();
      }
      catch (CoreException localCoreException) {}
    }
    return new Object[0];
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.internal.propertypage.AddFolderDialog.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;

class AddFolderDialog$4
  extends LabelProvider
{
  AddFolderDialog$4(AddFolderDialog paramAddFolderDialog) {}
  
  public Image getImage(Object element)
  {
    return PlatformUI.getWorkbench().getSharedImages().getImage("IMG_OBJ_FOLDER");
  }
  
  public String getText(Object element)
  {
    if ((element instanceof IResource)) {
      return ((IResource)element).getName();
    }
    return element.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.internal.propertypage.AddFolderDialog.4
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.common.componentcore.ui.Messages;

@Deprecated
public class AddFolderDialog
  extends TitleAreaDialog
{
  private IProject project;
  private TreeViewer viewer;
  private IContainer selected = null;
  
  public AddFolderDialog(Shell parentShell, IProject project)
  {
    super(parentShell);
    setShellStyle(getShellStyle() | 0x10);
    this.project = project;
  }
  
  protected void configureShell(Shell shell)
  {
    super.configureShell(shell);
    
    shell.setBounds(getLocationx, getLocationy, 400, 300);
  }
  
  protected Control createDialogArea(Composite parent)
  {
    Composite c = (Composite)super.createDialogArea(parent);
    parent.getShell().setText(Messages.AddFolder);
    setTitle(Messages.AddFolder);
    setMessage(Messages.AddFolderMappings);
    
    viewer = new TreeViewer(c, 2820);
    viewer.setContentProvider(getContentProvider());
    viewer.setLabelProvider(getLabelProvider());
    viewer.addFilter(getFilter());
    viewer.setInput(project);
    viewer.getTree().setLayoutData(new GridData(1808));
    viewer.addSelectionChangedListener(getListener());
    return c;
  }
  
  protected ISelectionChangedListener getListener()
  {
    new ISelectionChangedListener()
    {
      public void selectionChanged(SelectionChangedEvent event)
      {
        IStructuredSelection sel = (IStructuredSelection)viewer.getSelection();
        Object first = sel.getFirstElement();
        if ((first instanceof IContainer)) {
          selected = ((IContainer)first);
        }
      }
    };
  }
  
  public IContainer getSelected()
  {
    return selected;
  }
  
  protected ViewerFilter getFilter()
  {
    new ViewerFilter()
    {
      public boolean select(Viewer viewer, Object parentElement, Object element)
      {
        return element instanceof IContainer;
      }
    };
  }
  
  protected ITreeContentProvider getContentProvider()
  {
    new ITreeContentProvider()
    {
      public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
      
      public void dispose() {}
      
      public Object[] getElements(Object inputElement)
      {
        try
        {
          return project.members();
        }
        catch (CoreException localCoreException) {}
        return new Object[0];
      }
      
      public boolean hasChildren(Object element)
      {
        if ((element instanceof IContainer)) {
          try
          {
            return ((IContainer)element).members().length > 0;
          }
          catch (CoreException localCoreException) {}
        }
        return false;
      }
      
      public Object getParent(Object element)
      {
        if ((element instanceof IResource)) {
          return ((IResource)element).getParent();
        }
        return null;
      }
      
      public Object[] getChildren(Object parentElement)
      {
        if ((parentElement instanceof IContainer)) {
          try
          {
            return ((IContainer)parentElement).members();
          }
          catch (CoreException localCoreException) {}
        }
        return new Object[0];
      }
    };
  }
  
  protected LabelProvider getLabelProvider()
  {
    new LabelProvider()
    {
      public Image getImage(Object element)
      {
        return PlatformUI.getWorkbench().getSharedImages().getImage("IMG_OBJ_FOLDER");
      }
      
      public String getText(Object element)
      {
        if ((element instanceof IResource)) {
          return ((IResource)element).getName();
        }
        return element.toString();
      }
    };
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.internal.propertypage.AddFolderDialog
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import java.util.ArrayList;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IDecoratorManager;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
import org.eclipse.wst.common.componentcore.ui.ModuleCoreUIPlugin;
import org.eclipse.wst.common.componentcore.ui.propertypage.AddModuleDependenciesPropertiesPage;
import org.eclipse.wst.common.componentcore.ui.propertypage.AddModuleDependenciesPropertiesPage.ComponentResourceProxy;

public class ComponentDependencyContentProvider
  extends LabelProvider
  implements IStructuredContentProvider, ITableLabelProvider, ITreeContentProvider
{
  static final String PATH_SEPARATOR = String.valueOf('/');
  private IVirtualComponent component;
  private ArrayList<IVirtualReference> runtimePaths;
  private ArrayList<AddModuleDependenciesPropertiesPage.ComponentResourceProxy> resourceMappings;
  private DecoratingLabelProvider decProvider = new DecoratingLabelProvider(
    new WorkbenchLabelProvider(), PlatformUI.getWorkbench()
    .getDecoratorManager().getLabelDecorator());
  private IVirtualComponentLabelProvider[] delegates;
  
  public ComponentDependencyContentProvider(AddModuleDependenciesPropertiesPage addModuleDependenciesPropertiesPage)
  {
    decProvider.addListener(addModuleDependenciesPropertiesPage);
    delegates = DependencyPageExtensionManager.loadDelegates();
  }
  
  public void setRuntimePaths(ArrayList<IVirtualReference> runtimePaths)
  {
    this.runtimePaths = runtimePaths;
  }
  
  public void setResourceMappings(ArrayList<AddModuleDependenciesPropertiesPage.ComponentResourceProxy> mappings)
  {
    resourceMappings = mappings;
  }
  
  public Object[] getElements(Object inputElement)
  {
    Object[] empty = new Object[0];
    if (!(inputElement instanceof IWorkspaceRoot)) {
      return empty;
    }
    ArrayList<Object> list = new ArrayList();
    list.addAll(resourceMappings);
    list.addAll(runtimePaths);
    return list.toArray();
  }
  
  public Image getColumnImage(Object element, int columnIndex)
  {
    if ((element instanceof AddModuleDependenciesPropertiesPage.ComponentResourceProxy)) {
      return ModuleCoreUIPlugin.getInstance().getImage("folder");
    }
    if ((element instanceof IVirtualReference))
    {
      if (columnIndex == 0) {
        return handleSourceImage(((IVirtualReference)element).getReferencedComponent());
      }
      if (columnIndex == 1) {
        return ModuleCoreUIPlugin.getInstance().getImage("jar_obj");
      }
    }
    if ((element instanceof IProject)) {
      return decProvider.getImage(element);
    }
    return null;
  }
  
  public String getColumnText(Object element, int columnIndex)
  {
    if ((element instanceof AddModuleDependenciesPropertiesPage.ComponentResourceProxy))
    {
      if (columnIndex == 0) {
        return source.toString();
      }
      if (columnIndex == 1)
      {
        if (runtimePath.isRoot()) {
          return runtimePath.toString();
        }
        return runtimePath.makeRelative().toString();
      }
    }
    if ((element instanceof IVirtualReference))
    {
      if (columnIndex == 0) {
        return handleSourceText(((IVirtualReference)element).getReferencedComponent());
      }
      if (columnIndex == 1) {
        return new Path(AddModuleDependenciesPropertiesPage.getSafeRuntimePath((IVirtualReference)element)).makeRelative().toString();
      }
    }
    return null;
  }
  
  private String handleSourceText(IVirtualComponent component)
  {
    if (delegates != null) {
      for (int i = 0; i < delegates.length; i++) {
        if (delegates[i].canHandle(component)) {
          return delegates[i].getSourceText(component);
        }
      }
    }
    if (component.isBinary())
    {
      IPath p = (IPath)component.getAdapter(IPath.class);
      return p == null ? component.getName() : p.toString();
    }
    return component.getProject().getName();
  }
  
  private Image handleSourceImage(IVirtualComponent component)
  {
    if (delegates != null) {
      for (int i = 0; i < delegates.length; i++) {
        if (delegates[i].canHandle(component)) {
          return delegates[i].getSourceImage(component);
        }
      }
    }
    if (component.isBinary()) {
      return ModuleCoreUIPlugin.getInstance().getImage("jar_obj");
    }
    return decProvider.getImage(component.getProject());
  }
  
  public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
  
  public void setComponent(IVirtualComponent component)
  {
    this.component = component;
  }
  
  public IVirtualComponent getComponent()
  {
    return component;
  }
  
  public Object[] getChildren(Object parentElement)
  {
    return null;
  }
  
  public Object getParent(Object element)
  {
    return null;
  }
  
  public boolean hasChildren(Object element)
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.internal.propertypage.ComponentDependencyContentProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import java.util.Comparator;
import org.eclipse.core.runtime.IConfigurationElement;

class DependencyPageExtensionManager$1
  implements Comparator<IConfigurationElement>
{
  public int compare(IConfigurationElement o1, IConfigurationElement o2)
  {
    String o1String = o1.getAttribute("weight");
    String o2String = o2.getAttribute("weight");
    int o1int;
    try
    {
      o1int = Integer.parseInt(o1String);
    }
    catch (NumberFormatException localNumberFormatException1)
    {
      int o1int;
      o1int = 0;
    }
    int o2int;
    try
    {
      o2int = Integer.parseInt(o2String);
    }
    catch (NumberFormatException localNumberFormatException2)
    {
      int o2int;
      o2int = 0;
    }
    return o1int - o2int;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.internal.propertypage.DependencyPageExtensionManager.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import org.eclipse.core.expressions.EvaluationContext;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionConverter;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.wst.common.componentcore.ui.ModuleCoreUIPlugin;

public class DependencyPageExtensionManager$ReferenceExtension
{
  private IConfigurationElement element;
  private String id;
  private String name;
  private String imageLoc;
  private Image image;
  private boolean hidden;
  private Expression enablementExpression;
  
  public DependencyPageExtensionManager$ReferenceExtension(DependencyPageExtensionManager arg1, IConfigurationElement element)
  {
    this.element = element;
    id = element.getAttribute("id");
    name = element.getAttribute("name");
    imageLoc = element.getAttribute("icon");
    hidden = Boolean.parseBoolean(element.getAttribute("hidden"));
    IConfigurationElement[] arrayOfIConfigurationElement;
    int j = (arrayOfIConfigurationElement = element.getChildren("enablement")).length;
    IConfigurationElement child;
    for (int i = 0; i < j; i++)
    {
      child = arrayOfIConfigurationElement[i];
      try
      {
        enablementExpression = ExpressionConverter.getDefault().perform(child);
      }
      catch (CoreException e)
      {
        ModuleCoreUIPlugin.log(e);
      }
    }
  }
  
  public String getId()
  {
    return id;
  }
  
  public String getName()
  {
    return name;
  }
  
  public boolean isHidden()
  {
    return hidden;
  }
  
  public boolean isApplicable(IProject project)
  {
    if (enablementExpression != null)
    {
      EvaluationContext evalContext = new EvaluationContext(null, project);
      evalContext.setAllowPluginActivation(true);
      try
      {
        EvaluationResult evalResult = enablementExpression.evaluate(evalContext);
        if (evalResult == EvaluationResult.FALSE) {
          return false;
        }
      }
      catch (CoreException e)
      {
        ModuleCoreUIPlugin.log(e);
      }
    }
    return true;
  }
  
  public Image getImage()
  {
    if ((image == null) && 
      (imageLoc != null) && (element.getContributor().getName() != null))
    {
      ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor().getName(), imageLoc);
      image = desc.createImage();
    }
    return image;
  }
  
  public void disposeImage()
  {
    if (image != null)
    {
      image.dispose();
      image = null;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.internal.propertypage.DependencyPageExtensionManager.ReferenceExtension
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.expressions.EvaluationContext;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionConverter;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.wst.common.componentcore.ui.ModuleCoreUIPlugin;
import org.eclipse.wst.common.componentcore.ui.internal.taskwizard.WizardFragment;
import org.eclipse.wst.common.componentcore.ui.propertypage.IDependencyPageProvider;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;

public class DependencyPageExtensionManager
{
  private static final String DEFAULT_WEIGHT = "100";
  private static DependencyPageExtensionManager manager = null;
  
  public static DependencyPageExtensionManager getManager()
  {
    if (manager == null) {
      manager = new DependencyPageExtensionManager();
    }
    return manager;
  }
  
  private HashMap<String, IDependencyPageProvider> providers = null;
  private HashMap<String, String> providerWeight;
  
  public IDependencyPageProvider getProvider(IFacetedProject project)
  {
    if (providers == null) {
      loadProviders();
    }
    IDependencyPageProvider foundProvider = null;
    int highestWeight = 0;
    for (Iterator iterator = providers.keySet().iterator(); iterator.hasNext();)
    {
      String id = (String)iterator.next();
      IDependencyPageProvider temp = (IDependencyPageProvider)providers.get(id);
      if (temp.canHandle(project))
      {
        int weight = Integer.valueOf((String)providerWeight.get(id)).intValue();
        if (foundProvider == null)
        {
          foundProvider = temp;
          highestWeight = weight;
        }
        else if (highestWeight < weight)
        {
          foundProvider = temp;
          highestWeight = weight;
        }
      }
    }
    return foundProvider;
  }
  
  private void loadProviders()
  {
    HashMap<String, IDependencyPageProvider> temp = new HashMap();
    HashMap<String, String> tempProviderWeight = new HashMap();
    
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] cf = registry.getConfigurationElementsFor(
      "org.eclipse.wst.common.modulecore.ui", "moduleDependencyPropertyPage");
    for (int i = 0; i < cf.length; i++) {
      try
      {
        temp.put(cf[i].getAttribute("id"), 
          (IDependencyPageProvider)cf[i].createExecutableExtension("class"));
        String weight = cf[i].getAttribute("weight");
        tempProviderWeight.put(cf[i].getAttribute("id"), weight == null ? "100" : weight);
      }
      catch (CoreException ce)
      {
        ModuleCoreUIPlugin.log(ce);
      }
    }
    providers = temp;
    providerWeight = tempProviderWeight;
  }
  
  public WizardFragment[] loadAllReferenceWizardFragments()
  {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] cf = registry.getConfigurationElementsFor(
      "org.eclipse.wst.common.modulecore.ui", "referenceWizardFragment");
    ArrayList<WizardFragment> list = new ArrayList();
    for (int i = 0; i < cf.length; i++) {
      try
      {
        list.add((WizardFragment)cf[i].createExecutableExtension("class"));
      }
      catch (CoreException ce)
      {
        ModuleCoreUIPlugin.log(ce);
      }
    }
    return (WizardFragment[])list.toArray(new WizardFragment[list.size()]);
  }
  
  public WizardFragment loadReferenceWizardFragment(String id)
  {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] cf = registry.getConfigurationElementsFor(
      "org.eclipse.wst.common.modulecore.ui", "referenceWizardFragment");
    for (int i = 0; i < cf.length; i++) {
      if (cf[i].getAttribute("id").equals(id)) {
        try
        {
          return (WizardFragment)cf[i].createExecutableExtension("class");
        }
        catch (CoreException ce)
        {
          ModuleCoreUIPlugin.log(ce);
        }
      }
    }
    return null;
  }
  
  public List<ReferenceExtension> getExposedReferenceExtensions()
  {
    List<ReferenceExtension> list = new ArrayList();
    Set<String> hidden = new HashSet();
    for (ReferenceExtension ext : getAllReferenceExtensions()) {
      if (ext.isHidden()) {
        hidden.add(ext.getId());
      }
    }
    for (ReferenceExtension ext : getAllReferenceExtensions()) {
      if ((!ext.isHidden()) && (!hidden.contains(ext.getId()))) {
        list.add(ext);
      }
    }
    return list;
  }
  
  public List<ReferenceExtension> getAllReferenceExtensions()
  {
    ArrayList<ReferenceExtension> list = new ArrayList();
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] arrayOfIConfigurationElement;
    int j = (arrayOfIConfigurationElement = registry.getConfigurationElementsFor("org.eclipse.wst.common.modulecore.ui", "referenceWizardFragment")).length;
    for (int i = 0; i < j; i++)
    {
      IConfigurationElement cf = arrayOfIConfigurationElement[i];
      
      list.add(new ReferenceExtension(cf));
    }
    return list;
  }
  
  public ReferenceExtension findReferenceExtension(String id)
  {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] cf = registry.getConfigurationElementsFor(
      "org.eclipse.wst.common.modulecore.ui", "referenceWizardFragment");
    new ArrayList();
    for (int i = 0; i < cf.length; i++) {
      if (cf[i].getAttribute("id").equals(id)) {
        return new ReferenceExtension(cf[i]);
      }
    }
    return null;
  }
  
  public class ReferenceExtension
  {
    private IConfigurationElement element;
    private String id;
    private String name;
    private String imageLoc;
    private Image image;
    private boolean hidden;
    private Expression enablementExpression;
    
    public ReferenceExtension(IConfigurationElement element)
    {
      this.element = element;
      id = element.getAttribute("id");
      name = element.getAttribute("name");
      imageLoc = element.getAttribute("icon");
      hidden = Boolean.parseBoolean(element.getAttribute("hidden"));
      IConfigurationElement[] arrayOfIConfigurationElement;
      int j = (arrayOfIConfigurationElement = element.getChildren("enablement")).length;
      IConfigurationElement child;
      for (int i = 0; i < j; i++)
      {
        child = arrayOfIConfigurationElement[i];
        try
        {
          enablementExpression = ExpressionConverter.getDefault().perform(child);
        }
        catch (CoreException e)
        {
          ModuleCoreUIPlugin.log(e);
        }
      }
    }
    
    public String getId()
    {
      return id;
    }
    
    public String getName()
    {
      return name;
    }
    
    public boolean isHidden()
    {
      return hidden;
    }
    
    public boolean isApplicable(IProject project)
    {
      if (enablementExpression != null)
      {
        EvaluationContext evalContext = new EvaluationContext(null, project);
        evalContext.setAllowPluginActivation(true);
        try
        {
          EvaluationResult evalResult = enablementExpression.evaluate(evalContext);
          if (evalResult == EvaluationResult.FALSE) {
            return false;
          }
        }
        catch (CoreException e)
        {
          ModuleCoreUIPlugin.log(e);
        }
      }
      return true;
    }
    
    public Image getImage()
    {
      if ((image == null) && 
        (imageLoc != null) && (element.getContributor().getName() != null))
      {
        ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor().getName(), imageLoc);
        image = desc.createImage();
      }
      return image;
    }
    
    public void disposeImage()
    {
      if (image != null)
      {
        image.dispose();
        image = null;
      }
    }
  }
  
  public static IVirtualComponentLabelProvider[] loadDelegates()
  {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    IConfigurationElement[] cf = registry.getConfigurationElementsFor(
      "org.eclipse.wst.common.modulecore.ui", "virtualComponentLabelProvider");
    List<IConfigurationElement> list = Arrays.asList(cf);
    Comparator c = new Comparator()
    {
      public int compare(IConfigurationElement o1, IConfigurationElement o2)
      {
        String o1String = o1.getAttribute("weight");
        String o2String = o2.getAttribute("weight");
        int o1int;
        try
        {
          o1int = Integer.parseInt(o1String);
        }
        catch (NumberFormatException localNumberFormatException1)
        {
          int o1int;
          o1int = 0;
        }
        int o2int;
        try
        {
          o2int = Integer.parseInt(o2String);
        }
        catch (NumberFormatException localNumberFormatException2)
        {
          int o2int;
          o2int = 0;
        }
        return o1int - o2int;
      }
    };
    Collections.sort(list, c);
    ArrayList<IVirtualComponentLabelProvider> retList = new ArrayList();
    Iterator<IConfigurationElement> i = list.iterator();
    while (i.hasNext()) {
      try
      {
        IConfigurationElement el = (IConfigurationElement)i.next();
        el.getAttribute("class");
        retList.add((IVirtualComponentLabelProvider)el.createExecutableExtension("class"));
      }
      catch (CoreException ce)
      {
        ModuleCoreUIPlugin.log(ce);
      }
    }
    return (IVirtualComponentLabelProvider[])retList.toArray(new IVirtualComponentLabelProvider[retList.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.componentcore.ui.internal.propertypage.DependencyPageExtensionManager
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.componentcore.ui.internal.propertypage;

import org.eclipse.core.resources.IContainer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.wst.common.componentcore.ui.Messages;
import org.eclipse.wst.common.componentcore.ui.internal.taskwizard.IWizardHandle;

class FolderMappingWizardFragment$1
  implements ISelectionChangedListener
{
  FolderMappingWizardFragment$1(FolderMappingWizardFragment paramFolderMappingWizardFragment) {}
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    IStructuredSelection sel = (IStructuredSelection)FolderMappingWizardFragment.access$0(this$0).getSelection();
    Object first = sel.getFirstElement();
    if ((first instanceof IContainer))
    {
      FolderMappingWizardFragment.access$1(this$0, (IContainer)first);
      String errorMess
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