org.eclipse.mylyn.context.core_3.7.1.v20120425-0100

16:46:36.527 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.context.core_3.7.1.v20120425-0100.jar
package org.eclipse.mylyn.context.core;

import java.util.Set;
import org.eclipse.mylyn.internal.context.core.ContextCorePlugin;

public final class ContextCore
{
  public static final String CONTENT_TYPE_RESOURCE = "resource";
  
  public static IInteractionContextManager getContextManager()
  {
    return ContextCorePlugin.getContextManager();
  }
  
  public static IInteractionContextScaling getCommonContextScaling()
  {
    return ContextCorePlugin.getDefault().getCommonContextScaling();
  }
  
  public static AbstractContextStructureBridge getStructureBridge(Object object)
  {
    return ContextCorePlugin.getDefault().getStructureBridge(object);
  }
  
  public static AbstractContextStructureBridge getStructureBridge(String contentType)
  {
    return ContextCorePlugin.getDefault().getStructureBridge(contentType);
  }
  
  public static Set<String> getContentTypes()
  {
    return ContextCorePlugin.getDefault().getContentTypes();
  }
  
  public static Set<String> getChildContentTypes(String contentType)
  {
    return ContextCorePlugin.getDefault().getChildContentTypes(contentType);
  }
  
  public static IContextStore getContextStore()
  {
    return ContextCorePlugin.getContextStore();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.ContextCore
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.util.Collection;
import java.util.Set;
import org.eclipse.mylyn.monitor.core.InteractionEvent;

public abstract interface IInteractionContextManager
{
  public abstract IInteractionElement getElement(String paramString);
  
  public abstract void addListener(AbstractContextListener paramAbstractContextListener);
  
  public abstract void removeListener(AbstractContextListener paramAbstractContextListener);
  
  public abstract void activateContext(String paramString);
  
  public abstract void deactivateContext(String paramString);
  
  public abstract void deleteContext(String paramString);
  
  public abstract IInteractionContext getActiveContext();
  
  public abstract Set<IInteractionElement> getActiveLandmarks();
  
  public abstract Set<IInteractionElement> getActiveDocuments(IInteractionContext paramIInteractionContext);
  
  public abstract void updateHandle(IInteractionElement paramIInteractionElement, String paramString);
  
  public abstract void deleteElement(IInteractionElement paramIInteractionElement);
  
  public abstract void deleteElements(Collection<IInteractionElement> paramCollection);
  
  public abstract IInteractionElement getActiveElement();
  
  public abstract IInteractionElement processInteractionEvent(InteractionEvent paramInteractionEvent);
  
  public abstract boolean isContextActive();
  
  public abstract boolean hasContext(String paramString);
  
  public abstract boolean isContextActivePropertySet();
  
  public abstract boolean isContextCapturePaused();
  
  public abstract void setContextCapturePaused(boolean paramBoolean);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.IInteractionContextManager
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.util.Collection;
import org.eclipse.mylyn.internal.context.core.InteractionContextRelation;

public abstract interface IInteractionElement
  extends IInteractionObject
{
  public abstract String getHandleIdentifier();
  
  public abstract void setHandleIdentifier(String paramString);
  
  public abstract IInteractionContext getContext();
  
  public abstract Collection<InteractionContextRelation> getRelations();
  
  public abstract IInteractionRelation getRelation(String paramString);
  
  public abstract void clearRelations();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.IInteractionElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.util.Collections;
import java.util.List;
import org.eclipse.core.runtime.Assert;

public class ContextChangeEvent
{
  private final String contextHandle;
  private final IInteractionContext context;
  private final ContextChangeKind eventKind;
  private final List<IInteractionElement> elements;
  private final boolean isExplicitManipulation;
  
  public static enum ContextChangeKind
  {
    PRE_ACTIVATED,  ACTIVATED,  DEACTIVATED,  CLEARED,  INTEREST_CHANGED,  LANDMARKS_ADDED,  LANDMARKS_REMOVED,  ELEMENTS_DELETED;
  }
  
  public ContextChangeEvent(ContextChangeKind eventKind, String contextHandle, IInteractionContext context, List<IInteractionElement> elements)
  {
    this(eventKind, contextHandle, context, elements, false);
  }
  
  public ContextChangeEvent(ContextChangeKind eventKind, String contextHandle, IInteractionContext context, List<IInteractionElement> elements, boolean isExplicitManipulation)
  {
    Assert.isNotNull(eventKind);
    this.contextHandle = contextHandle;
    this.context = context;
    this.eventKind = eventKind;
    if (elements == null) {
      this.elements = Collections.emptyList();
    } else {
      this.elements = elements;
    }
    this.isExplicitManipulation = isExplicitManipulation;
  }
  
  public ContextChangeKind getEventKind()
  {
    return eventKind;
  }
  
  public List<IInteractionElement> getElements()
  {
    return elements;
  }
  
  public String getContextHandle()
  {
    return contextHandle;
  }
  
  public IInteractionContext getContext()
  {
    return context;
  }
  
  public boolean isActiveContext()
  {
    IInteractionContext activeContext = ContextCore.getContextManager().getActiveContext();
    
    return (activeContext != null) && (activeContext.getHandleIdentifier() != null) && (activeContext.getHandleIdentifier().equals(contextHandle));
  }
  
  public boolean isExplicitManipulation()
  {
    return isExplicitManipulation;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.ContextChangeEvent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.util.List;
import org.eclipse.mylyn.monitor.core.InteractionEvent;

public abstract interface IDegreeOfInterest
{
  public abstract boolean isPropagated();
  
  public abstract boolean isPredicted();
  
  public abstract boolean isLandmark();
  
  public abstract boolean isInteresting();
  
  public abstract float getEncodedValue();
  
  public abstract float getDecayValue();
  
  public abstract float getValue();
  
  public abstract List<InteractionEvent> getEvents();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.IDegreeOfInterest
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.util.List;

public abstract class AbstractContextStructureBridge
{
  protected String parentContentType = null;
  
  public void setParentContentType(String contentType)
  {
    parentContentType = contentType;
  }
  
  public abstract String getContentType();
  
  public abstract String getHandleIdentifier(Object paramObject);
  
  public String getParentHandle(String handle, boolean allowChildBridgeHandles)
  {
    return getParentHandle(handle);
  }
  
  public abstract String getParentHandle(String paramString);
  
  public abstract Object getObjectForHandle(String paramString);
  
  public abstract List<String> getChildHandles(String paramString);
  
  public abstract String getLabel(Object paramObject);
  
  public abstract boolean canBeLandmark(String paramString);
  
  public abstract boolean acceptsObject(Object paramObject);
  
  public abstract boolean canFilter(Object paramObject);
  
  public abstract boolean isDocument(String paramString);
  
  public abstract String getHandleForOffsetInObject(Object paramObject, int paramInt);
  
  public abstract String getContentType(String paramString);
  
  public String getParentContentType()
  {
    return parentContentType;
  }
  
  public Object getAdaptedParent(Object object)
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.AbstractContextStructureBridge
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;

public abstract class ContextComputationStrategy
{
  public abstract List<Object> computeContext(IInteractionContext paramIInteractionContext, IAdaptable paramIAdaptable, IProgressMonitor paramIProgressMonitor);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.ContextComputationStrategy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.io.File;
import org.eclipse.core.runtime.CoreException;

public abstract interface IContextStore
{
  public abstract boolean hasContext(String paramString);
  
  public abstract IInteractionContext importContext(String paramString, File paramFile)
    throws CoreException;
  
  public abstract IInteractionContext cloneContext(String paramString1, String paramString2);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.IContextStore
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

public abstract interface IInteractionRelation
  extends IInteractionObject
{
  public abstract String getLabel();
  
  public abstract String getRelationshipHandle();
  
  public abstract IInteractionElement getTarget();
  
  public abstract IInteractionElement getSource();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.IInteractionRelation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

public enum ContextChangeEvent$ContextChangeKind
{
  PRE_ACTIVATED,  ACTIVATED,  DEACTIVATED,  CLEARED,  INTEREST_CHANGED,  LANDMARKS_ADDED,  LANDMARKS_REMOVED,  ELEMENTS_DELETED;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.ContextChangeEvent.ContextChangeKind
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import org.eclipse.mylyn.monitor.core.InteractionEvent.Kind;

public abstract interface IInteractionContextScaling
{
  public abstract float get(InteractionEvent.Kind paramKind);
  
  public abstract float getDecay();
  
  public abstract float getInteresting();
  
  public abstract float getLandmark();
  
  public abstract float getForcedLandmark();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.IInteractionContextScaling
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.util.Collection;
import java.util.List;
import org.eclipse.mylyn.monitor.core.InteractionEvent;

public abstract interface IInteractionContext
{
  public abstract String getHandleIdentifier();
  
  public abstract List<InteractionEvent> getInteractionHistory();
  
  public abstract boolean isInteresting(String paramString);
  
  public abstract List<IInteractionElement> getInteresting();
  
  public abstract List<IInteractionElement> getLandmarks();
  
  public abstract IInteractionElement get(String paramString);
  
  public abstract IInteractionElement getActiveNode();
  
  public abstract void delete(IInteractionElement paramIInteractionElement);
  
  public abstract void delete(Collection<IInteractionElement> paramCollection);
  
  public abstract void updateElementHandle(IInteractionElement paramIInteractionElement, String paramString);
  
  public abstract List<IInteractionElement> getAllElements();
  
  public abstract IInteractionContextScaling getScaling();
  
  public abstract String getContentLimitedTo();
  
  public abstract void setContentLimitedTo(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.IInteractionContext
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.util.Comparator;

public class InterestComparator<T>
  implements Comparator<T>
{
  public int compare(T e1, T e2)
  {
    if (((e1 instanceof IInteractionElement)) && ((e2 instanceof IInteractionElement)))
    {
      IInteractionElement info1 = (IInteractionElement)e1;
      IInteractionElement info2 = (IInteractionElement)e2;
      float v1 = info1.getInterest().getValue();
      float v2 = info2.getInterest().getValue();
      if (v1 >= v2) {
        return -1;
      }
      if (v1 < v2) {
        return 1;
      }
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.InterestComparator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

import java.util.List;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;

public abstract class AbstractContextListener
{
  @Deprecated
  public void contextPreActivated(IInteractionContext context) {}
  
  @Deprecated
  public void contextActivated(IInteractionContext context) {}
  
  @Deprecated
  public void contextDeactivated(IInteractionContext context) {}
  
  @Deprecated
  public void contextCleared(IInteractionContext context) {}
  
  @Deprecated
  public void interestChanged(List<IInteractionElement> elements) {}
  
  @Deprecated
  public void landmarkAdded(IInteractionElement element) {}
  
  @Deprecated
  public void landmarkRemoved(IInteractionElement element) {}
  
  @Deprecated
  public void elementsDeleted(List<IInteractionElement> elements) {}
  
  public void contextChanged(ContextChangeEvent event)
  {
    switch (event.getEventKind())
    {
    case ACTIVATED: 
      contextPreActivated(event.getContext());
      break;
    case CLEARED: 
      contextActivated(event.getContext());
      break;
    case DEACTIVATED: 
      contextDeactivated(event.getContext());
      break;
    case ELEMENTS_DELETED: 
      contextCleared(event.getContext());
      break;
    case INTEREST_CHANGED: 
      interestChanged(event.getElements());
      break;
    case LANDMARKS_ADDED: 
      for (IInteractionElement element : event.getElements()) {
        landmarkAdded(element);
      }
      break;
    case LANDMARKS_REMOVED: 
      for (IInteractionElement element : event.getElements()) {
        landmarkRemoved(element);
      }
      break;
    case PRE_ACTIVATED: 
      elementsDeleted(event.getElements());
      break;
    default: 
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.context.core", 
        "Unknown context changed event type"));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.AbstractContextListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

public abstract interface IImplicitlyIntersting {}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.IImplicitlyIntersting
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.context.core;

public abstract interface IInteractionObject
{
  public abstract IDegreeOfInterest getInterest();
  
  public abstract String getContentType();
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.context.core.IInteractionObject
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.context.core;

import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;

class ContextCorePlugin$BridgesExtensionPointReader
{
  private static final String EXTENSION_ID_CONTEXT = "org.eclipse.mylyn.context.core.bridges";
  private static final String EXTENSION_ID_INTERNAL_CONTEXT = "org.eclipse.mylyn.context.core.internalBridges";
  private static final String EXTENSION_ID_RELATION_PROVIDERS = "org.eclipse.mylyn.context.core.relationProviders";
  private static final String ELEMENT_STRUCTURE_BRIDGE = "structureBridge";
  private static final String ELEMENT_RELATION_PROVIDER = "provider";
  private static final String ELEMENT_SHADOW = "shadow";
  private static final String ATTR_CLASS = "class";
  private static final String ATTR_CONTENT_TYPE = "contentType";
  private static final String ATTR_PARENT_CONTENT_TYPE = "parentContentType";
  private static final String ATTR_BASE_CONTENT = "baseContent";
  private static final String ATTR_SHADOWED_BY_CONTENT = "shadowedByContent";
  private static boolean extensionsRead = false;
  
  public static void initExtensions()
  {
    if (!extensionsRead)
    {
      IExtensionRegistry registry = Platform.getExtensionRegistry();
      
      IExtensionPoint extensionPoint = registry.getExtensionPoint("org.eclipse.mylyn.context.core.bridges");
      IExtension[] extensions = extensionPoint.getExtensions();
      IExtension[] arrayOfIExtension1;
      int j = (arrayOfIExtension1 = extensions).length;
      IConfigurationElement[] arrayOfIConfigurationElement1;
      int m;
      int k;
      for (int i = 0; i < j; i++)
      {
        IExtension extension = arrayOfIExtension1[i];
        IConfigurationElement[] elements = extension.getConfigurationElements();
        m = (arrayOfIConfigurationElement1 = elements).length;
        for (k = 0; k < m; k++)
        {
          IConfigurationElement element = arrayOfIConfigurationElement1[k];
          if (element.getName().compareTo("structureBridge") == 0) {
            readBridge(element);
          }
        }
      }
      extensionPoint = registry.getExtensionPoint("org.eclipse.mylyn.context.core.internalBridges");
      extensions = extensionPoint.getExtensions();
      j = (arrayOfIExtension1 = extensions).length;
      for (i = 0; i < j; i++)
      {
        IExtension extension = arrayOfIExtension1[i];
        IConfigurationElement[] elements = extension.getConfigurationElements();
        m = (arrayOfIConfigurationElement1 = elements).length;
        for (k = 0; k < m; k++)
        {
          IConfigurationElement element = arrayOfIConfigurationElement1[k];
          if (element.getName().compareTo("shadow") == 0) {
            readInternalBridge(element);
          }
        }
      }
      extensionPoint = registry.getExtensionPoint("org.eclipse.mylyn.context.core.relationProviders");
      extensions = extensionPoint.getExtensions();
      j = (arrayOfIExtension1 = extensions).length;
      for (i = 0; i < j; i++)
      {
        IExtension extension = arrayOfIExtension1[i];
        IConfigurationElement[] elements = extension.getConfigurationElements();
        m = (arrayOfIConfigurationElement1 = elements).length;
        for (k = 0; k < m; k++)
        {
          IConfigurationElement element = arrayOfIConfigurationElement1[k];
          if (element.getName().compareTo("provider") == 0) {
            readRelationProvider(element);
          }
        }
      }
      extensionsRead = true;
    }
  }
  
  private static void readBridge(IConfigurationElement element)
  {
    try
    {
      Object object = element.createExecutableExtension("class");
      if (!(object instanceof AbstractContextStructureBridge))
      {
        StatusHandler.log(new Status(2, "org.eclipse.mylyn.context.core", 
          "Could not load bridge: " + object.getClass().getCanonicalName() + " must implement " + 
          AbstractContextStructureBridge.class.getCanonicalName()));
        return;
      }
      AbstractContextStructureBridge bridge = (AbstractContextStructureBridge)object;
      if (element.getAttribute("parentContentType") != null)
      {
        String parentContentType = element.getAttribute("parentContentType");
        if (parentContentType != null) {
          bridge.setParentContentType(parentContentType);
        }
      }
      ContextCorePlugin.getDefault().addStructureBridge(bridge);
    }
    catch (Throwable e)
    {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.context.core", 
        "Could not load bridge extension", e));
    }
  }
  
  private static void readInternalBridge(IConfigurationElement element)
  {
    String baseContent = element.getAttribute("baseContent");
    String shadowedByContent = element.getAttribute("shadowedByContent");
    if ((baseContent == null) || (shadowedByContent == null)) {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.context.core", 
        "Ignoring bridge shadowing because of invalid extension point structureBridge", 
        new Exception()));
    }
    ContextCorePlugin.access$0(ContextCorePlugin.getDefault(), baseContent, shadowedByContent);
  }
  
  private static void readRelationProvider(IConfigurationElement element)
  {
    try
    {
      String contentType = element.getAttribute("contentType");
      AbstractRelationProvider relationProvider = (AbstractRelationProvider)element.createExecutableExtension("class");
      if (contentType != null) {
        ContextCorePlugin.access$1(ContextCorePlugin.getDefault(), contentType, relationProvider);
      }
    }
    catch (Throwable e)
    {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.context.core", 
        "Could not load relation provider", e));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.context.core.ContextCorePlugin.BridgesExtensionPointReader
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.context.core;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.mylyn.context.core.IInteractionContext;
import org.eclipse.mylyn.context.core.IInteractionContextScaling;
import org.eclipse.mylyn.context.core.IInteractionElement;
import org.eclipse.mylyn.monitor.core.InteractionEvent;

public class CompositeInteractionContext
  implements IInteractionContext
{
  protected Map<String, InteractionContext> contexts = new HashMap();
  protected IInteractionElement activeNode = null;
  private final IInteractionContextScaling contextScaling;
  public String contentLimitedTo = null;
  
  public CompositeInteractionContext(IInteractionContextScaling contextScaling)
  {
    this.contextScaling = contextScaling;
  }
  
  public IInteractionElement addEvent(InteractionEvent event)
  {
    List<InteractionContextElement> nodes = new ArrayList();
    for (InteractionContext context : contexts.values())
    {
      InteractionContextElement info = (InteractionContextElement)context.parseEvent(event);
      nodes.add(info);
    }
    CompositeContextElement compositeNode = new CompositeContextElement(event.getStructureHandle(), nodes, 
      contextScaling);
    return compositeNode;
  }
  
  public IInteractionElement get(String handle)
  {
    if ((handle == null) || (contexts.values().size() == 0)) {
      return null;
    }
    List<InteractionContextElement> nodes = new ArrayList();
    for (InteractionContext taskscape : contexts.values())
    {
      InteractionContextElement node = (InteractionContextElement)taskscape.get(handle);
      if (node != null) {
        nodes.add(node);
      }
    }
    CompositeContextElement composite = new CompositeContextElement(handle, nodes, contextScaling);
    return composite;
  }
  
  public List<IInteractionElement> getLandmarks()
  {
    Set<IInteractionElement> landmarks = new HashSet();
    Iterator localIterator2;
    for (Iterator localIterator1 = contexts.values().iterator(); localIterator1.hasNext(); localIterator2.hasNext())
    {
      InteractionContext taskscape = (InteractionContext)localIterator1.next();
      localIterator2 = taskscape.getLandmarks().iterator(); continue;IInteractionElement concreteNode = (IInteractionElement)localIterator2.next();
      if (concreteNode != null) {
        landmarks.add(get(concreteNode.getHandleIdentifier()));
      }
    }
    return new ArrayList(landmarks);
  }
  
  public List<IInteractionElement> getInteresting()
  {
    Set<IInteractionElement> landmarks = new HashSet();
    Iterator localIterator2;
    for (Iterator localIterator1 = contexts.values().iterator(); localIterator1.hasNext(); localIterator2.hasNext())
    {
      InteractionContext context = (InteractionContext)localIterator1.next();
      localIterator2 = context.getInteresting().iterator(); continue;IInteractionElement concreteNode = (IInteractionElement)localIterator2.next();
      if (concreteNode != null) {
        landmarks.add(get(concreteNode.getHandleIdentifier()));
      }
    }
    return new ArrayList(landmarks);
  }
  
  public boolean isInteresting(String elementHandle)
  {
    for (InteractionContext context : contexts.values()) {
      if (context.isInteresting(elementHandle)) {
        return true;
      }
    }
    return false;
  }
  
  public void setActiveElement(IInteractionElement activeElement)
  {
    activeNode = activeElement;
  }
  
  public IInteractionElement getActiveNode()
  {
    return activeNode;
  }
  
  public void delete(IInteractionElement node)
  {
    for (InteractionContext taskscape : contexts.values()) {
      taskscape.delete(node);
    }
  }
  
  public void delete(Collection<IInteractionElement> nodes)
  {
    for (InteractionContext context : contexts.values()) {
      context.delete(nodes);
    }
  }
  
  public void clear()
  {
    for (InteractionContext taskscape : contexts.values()) {
      taskscape.reset();
    }
  }
  
  public Map<String, InteractionContext> getContextMap()
  {
    return contexts;
  }
  
  public List<IInteractionElement> getAllElements()
  {
    Set<IInteractionElement> nodes = new HashSet();
    Iterator localIterator2;
    for (Iterator localIterator1 = contexts.values().iterator(); localIterator1.hasNext(); localIterator2.hasNext())
    {
      InteractionContext context = (InteractionContext)localIterator1.next();
      localIterator2 = context.getAllElements().iterator(); continue;IInteractionElement concreteNode = (IInteractionElement)localIterator2.next();
      nodes.add(get(concreteNode.getHandleIdentifier()));
    }
    return new ArrayList(nodes);
  }
  
  public List<InteractionEvent> getInteractionHistory()
  {
    Set<InteractionEvent> events = new HashSet();
    for (InteractionContext taskscape : contexts.values()) {
      events.addAll(taskscape.getInteractionHistory());
    }
    return new ArrayList(events);
  }
  
  public void updateElementHandle(IInteractionElement element, String newHandle)
  {
    for (InteractionContext context : contexts.values()) {
      context.updateElementHandle(element, newHandle);
    }
    element.setHandleIdentifier(newHandle);
  }
  
  public String getHandleIdentifier()
  {
    if (contexts.values().size() == 1) {
      return (String)contexts.keySet().iterator().next();
    }
    return null;
  }
  
  public IInteractionContextScaling getScaling()
  {
    return contextScaling;
  }
  
  public String getContentLimitedTo()
  {
    return contentLimitedTo;
  }
  
  public void setContentLimitedTo(String contentLimitedTo)
  {
    this.contentLimitedTo = contentLimitedTo;
  }
  
  public void addEvents(IInteractionContext otherContext)
  {
    for (InteractionContext context : contexts.values()) {
      context.addEvents(otherContext);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.context.core.CompositeInteractionContext
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.context.core;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.AbstractContextListener;
import org.eclipse.mylyn.context.core.ContextChangeEvent;
import org.eclipse.mylyn.context.core.ContextChangeEvent.ContextChangeKind;
import org.eclipse.mylyn.context.core.IInteractionContext;
import org.eclipse.mylyn.context.core.IInteractionElement;

class InteractionContextManager$2
  implements ISafeRunnable
{
  InteractionContextManager$2(InteractionContextManager paramInteractionContextManager, AbstractContextListener paramAbstractContextListener, IInteractionElement paramIInteractionElement, IInteractionContext paramIInteractionContext, boolean paramBoolean) {}
  
  public void handleException(Throwable e)
  {
    StatusHandler.log(new Status(2, "org.eclipse.mylyn.context.core", 
      "Listener failed: " + 
      val$listener.getClass(), e));
  }
  
  public void run()
    throws Exception
  {
    List<IInteractionElement> changed = new ArrayList(1);
    changed.add(val$node);
    ContextChangeEvent event = new ContextChangeEvent(ContextChangeEvent.ContextChangeKind.LANDMARKS_REMOVED, 
      val$context.getHandleIdentifier(), val$context, changed, val$isExplicitManipulation);
    val$listener.contextChanged(event);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.context.core.InteractionContextManager.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.context.core;

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.AbstractContextListener;
import org.eclipse.mylyn.context.core.IInteractionElement;

class InteractionContextManager$11
  implements ISafeRunnable
{
  InteractionContextManager$11(InteractionContextManager paramInteractionContextManager, AbstractContextListener paramAbstractContextListener, IInteractionElement paramIInteractionElement) {}
  
  public void handleException(Throwable e)
  {
    StatusHandler.log(new Status(2, "org.eclipse.mylyn.context.core", "Listener failed: " + 
      val$listener.getClass(), e));
  }
  
  public void run()
    throws Exception
  {
    ((IRelationsListener)val$listener).relationsChanged(val$element);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.context.core.InteractionContextManager.11
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.context.core;

import java.util.List;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.AbstractContextListener;
import org.eclipse.mylyn.context.core.ContextChangeEvent;
import org.eclipse.mylyn.context.core.ContextChangeEvent.ContextChangeKind;
import org.eclipse.mylyn.context.core.IInteractionContext;

class InteractionContextManager$9
  implements ISafeRunnable
{
  InteractionContextManager$9(InteractionContextManager paramInteractionContextManager, AbstractContextListener paramAbstractContextListener, IInteractionContext paramIInteractionContext, List paramList, boolean paramBoolean) {}
  
  public void handleException(Throwable e)
  {
    StatusHandler.log(new Status(2, "org.eclipse.mylyn.context.core", "Listener failed: " + 
      val$listener.getClass(), e));
  }
  
  public void run()
    throws Exception
  {
    ContextChangeEvent event = new ContextChangeEvent(ContextChangeEvent.ContextChangeKind.ELEMENTS_DELETED, 
      val$context.getHandleIdentifier(), val$context, val$interestDelta, val$isExplicitManipulation);
    val$listener.contextChanged(event);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.context.core.InteractionContextManager.9
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.context.core;

import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Locale;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.IInteractionContext;
import org.eclipse.mylyn.internal.commons.core.XmlStringConverter;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.eclipse.mylyn.monitor.core.InteractionEvent.Kind;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.AttributesImpl;

public class SaxContextWriter
  implements IInteractionContextWriter
{
  private OutputStream outputStream;
  
  public void setOutputStream(OutputStream outputStream)
  {
    this.outputStream = outputStream;
  }
  
  public void writeContextToStream(IInteractionContext context)
    throws IOException
  {
    if (outputStream == null)
    {
      IOException ioe = new IOException("OutputStream not set");
      throw ioe;
    }
    try
    {
      Transformer transformer = TransformerFactory.newInstance().newTransformer();
      transformer.transform(new SAXSource(new SaxWriter(null), new InteractionContextInputSource(context)), 
        new StreamResult(outputStream));
    }
    catch (TransformerException e)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.context.core", "Could not write context", e));
      throw new IOException(e.getMessage());
    }
  }
  
  private static class InteractionContextInputSource
    extends InputSource
  {
    private final IInteractionContext context;
    
    public InteractionContextInputSource(IInteractionContext context)
    {
      this.context = context;
    }
    
    public IInteractionContext getContext()
    {
      return context;
    }
  }
  
  private class SaxWriter
    implements XMLReader
  {
    private ContentHandler handler;
    private ErrorHandler errorHandler;
    
    private SaxWriter() {}
    
    public boolean getFeature(String name)
      throws SAXNotRecognizedException, SAXNotSupportedException
    {
      return false;
    }
    
    public void setFeature(String name, boolean value)
      throws SAXNotRecognizedException, SAXNotSupportedException
    {}
    
    public Object getProperty(String name)
      throws SAXNotRecognizedException, SAXNotSupportedException
    {
      return null;
    }
    
    public void setProperty(String name, Object value)
      throws SAXNotRecognizedException, SAXNotSupportedException
    {}
    
    public void setEntityResolver(EntityResolver resolver) {}
    
    public EntityResolver getEntityResolver()
    {
      return null;
    }
    
    public void setDTDHandler(DTDHandler handler) {}
    
    public DTDHandler getDTDHandler()
    {
      return null;
    }
    
    public void setContentHandler(ContentHandler handler)
    {
      this.handler = handler;
    }
    
    public ContentHandler getContentHandler()
    {
      return handler;
    }
    
    public void setErrorHandler(ErrorHandler handler)
    {
      errorHandler = handler;
    }
    
    public ErrorHandler getErrorHandler()
    {
      return errorHandler;
    }
    
    public void parse(InputSource input)
      throws IOException, SAXException
    {
      if (!(input instanceof SaxContextWriter.InteractionContextInputSource)) {
        throw new SAXException("Can only parse writable input sources");
      }
      IInteractionContext context = ((SaxContextWriter.InteractionContextInputSource)input).getContext();
      
      handler.startDocument();
      AttributesImpl rootAttributes = new AttributesImpl();
      rootAttributes.addAttribute("", "Id", 
        "Id", "", context.getHandleIdentifier());
      if (context.getContentLimitedTo() != null) {
        rootAttributes.addAttribute("", "Content", 
          "Content", "", context.getContentLimitedTo());
      }
      rootAttributes.addAttribute("", "Version", 
        "Version", "", "1");
      
      handler.startElement("", "InteractionHistory", 
        "InteractionHistory", rootAttributes);
      for (InteractionEvent ie : context.getInteractionHistory())
      {
        Attributes ieAttributes = SaxContextWriter.this.createEventAttributes(ie);
        handler.startElement("", "InteractionEvent", 
          "InteractionEvent", ieAttributes);
        handler.endElement("", "InteractionEvent", 
          "InteractionEvent");
      }
      handler.endElement("", "InteractionHistory", 
        "InteractionHistory");
      
      handler.endDocument();
    }
    
    public void parse(String systemId)
      throws IOException, SAXException
    {
      throw new SAXException("Can only parse writable input sources");
    }
  }
  
  private Attributes createEventAttributes(InteractionEvent ie)
  {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S z", 
      Locale.ENGLISH);
    
    AttributesImpl ieAttributes = new AttributesImpl();
    
    ieAttributes.addAttribute("", "Delta", 
      "Delta", "", 
      XmlStringConverter.convertToXmlString(ie.getDelta()));
    ieAttributes.addAttribute("", "EndDate", 
      "EndDate", "", dateFormat.format(ie.getEndDate()));
    ieAttributes.addAttribute("", "Interest", 
      "Interest", "", Float.toString(ie.getInterestContribution()));
    ieAttributes.addAttribute("", "Kind", "Kind", 
      "", ie.getKind().toString());
    ieAttributes.addAttribute("", "Navigation", 
      "Navigation", "", 
      XmlStringConverter.convertToXmlString(ie.getNavigation()));
    ieAttributes.addAttribute("", "OriginId", 
      "OriginId", "", 
      XmlStringConverter.convertToXmlString(ie.getOriginId()));
    ieAttributes.addAttribute("", "StartDate", 
      "StartDate", "", dateFormat.format(ie.getDate()));
    ieAttributes.addAttribute("", "StructureHandle", 
      "StructureHandle", "", 
      XmlStringConverter.convertToXmlString(ie.getStructureHandle()));
    ieAttributes.addAttribute("", "StructureKind", 
      "StructureKind", "", 
      XmlStringConverter.convertToXmlString(ie.getStructureKind()));
    if ((ie instanceof AggregateInteractionEvent))
    {
      ieAttributes.addAttribute("", "NumEvents", 
        "NumEvents", "", 
        Integer.toString(((AggregateInteractionEvent)ie).getNumCollapsedEvents()));
      ieAttributes.addAttribute("", "CreationCount", 
        "CreationCount", "", 
        Integer.toString(((AggregateInteractionEvent)ie).getEventCountOnCreation()));
    }
    return ieAttributes;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.context.core.SaxContextWriter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.context.core;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.ContextComputationStrategy;
import org.eclipse.osgi.util.NLS;

public class StrategiesExtensionPointReader
{
  private static final String CONTEXT_COMPUTATION_STRATEGY = "contextComputationStrategy";
  private static final String ATTRIBUTE_CLASS = "
1 2 3 4 5 6

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd