org.eclipse.mylyn.ide.ui_3.7.1.v20120425-0100

16:46:44.506 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.ide.ui_3.7.1.v20120425-0100.jar
package org.eclipse.mylyn.ide.ui;

import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IInteractionContextManager;
import org.eclipse.mylyn.context.ui.InterestFilter;
import org.eclipse.osgi.util.NLS;

public abstract class AbstractMarkerInterestFilter
  extends InterestFilter
{
  protected boolean isInteresting(IMarker marker, Viewer viewer, Object parent)
  {
    try
    {
      if (isImplicitlyInteresting(marker)) {
        return true;
      }
      String handle = ContextCore.getStructureBridge(marker.getResource().getFileExtension())
        .getHandleForOffsetInObject(marker, 0);
      if (handle == null) {
        return false;
      }
      return super.select(viewer, parent, ContextCore.getContextManager().getElement(handle));
    }
    catch (Throwable t)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.ide", NLS.bind(
        "Unable to get handle for marker: {0}", marker.getResource()), t));
    }
    return false;
  }
  
  protected abstract boolean isImplicitlyInteresting(IMarker paramIMarker);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.ide.ui.AbstractMarkerInterestFilter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.ide.ui;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.ui.AbstractFocusViewAction;
import org.eclipse.mylyn.context.ui.InterestFilter;
import org.eclipse.mylyn.internal.ide.ui.MarkerInterestFilter;
import org.eclipse.mylyn.internal.ide.ui.MarkerViewLabelProvider;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.internal.views.markers.ExtendedMarkersView;
import org.eclipse.ui.internal.views.markers.MarkersTreeViewer;
import org.eclipse.ui.views.markers.internal.TableViewLabelProvider;

public abstract class AbstractFocusMarkerViewAction
  extends AbstractFocusViewAction
{
  private StructuredViewer cachedViewer = null;
  
  public AbstractFocusMarkerViewAction()
  {
    super(new MarkerInterestFilter(), true, true, false);
  }
  
  public AbstractFocusMarkerViewAction(InterestFilter interestFilter, boolean manageViewer, boolean manageFilters, boolean manageLinking)
  {
    super(interestFilter, manageFilters, manageFilters, manageLinking);
  }
  
  protected void updateMarkerViewLabelProvider(StructuredViewer viewer)
  {
    if (viewer != null)
    {
      IBaseLabelProvider currentProvider = viewer.getLabelProvider();
      if (((currentProvider instanceof TableViewLabelProvider)) && 
        (!(currentProvider instanceof MarkerViewLabelProvider))) {
        viewer.setLabelProvider(new MarkerViewLabelProvider((TableViewLabelProvider)currentProvider));
      }
    }
  }
  
  public List<StructuredViewer> getViewers()
  {
    List<StructuredViewer> viewers = new ArrayList();
    if (cachedViewer == null) {
      try
      {
        IViewPart viewPart = super.getPartForAction();
        if (viewPart != null)
        {
          Class<?> clazz = ExtendedMarkersView.class;
          Field field = clazz.getDeclaredField("viewer");
          field.setAccessible(true);
          cachedViewer = ((MarkersTreeViewer)field.get(viewPart));
          if ((cachedViewer != null) && (!cachedViewer.getControl().isDisposed())) {
            updateMarkerViewLabelProvider(cachedViewer);
          }
        }
      }
      catch (Exception e)
      {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.ide", 
          "Could not get problems view viewer", e));
      }
    }
    if (cachedViewer != null) {
      viewers.add(cachedViewer);
    }
    return viewers;
  }
  
  public void update()
  {
    super.update();
    cachedViewer = null;
    for (StructuredViewer viewer : getViewers()) {
      if ((viewer instanceof TableViewer))
      {
        TableViewer tableViewer = (TableViewer)viewer;
        if (!(tableViewer.getLabelProvider() instanceof MarkerViewLabelProvider)) {
          tableViewer.setLabelProvider(new MarkerViewLabelProvider(
            (TableViewLabelProvider)tableViewer.getLabelProvider()));
        }
      }
    }
  }
}

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

import java.lang.reflect.Method;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.ide.ui.AbstractMarkerInterestFilter;
import org.eclipse.ui.views.markers.MarkerItem;

public class MarkerInterestFilter
  extends AbstractMarkerInterestFilter
{
  private Method markerCategoryMethod = null;
  
  public boolean select(Viewer viewer, Object parent, Object element)
  {
    if ((element instanceof MarkerItem))
    {
      if (element.getClass().getSimpleName().equals("MarkerCategory"))
      {
        try
        {
          if (markerCategoryMethod == null)
          {
            Class<?> markerCategoryClass = Class.forName("org.eclipse.ui.internal.views.markers.MarkerCategory");
            markerCategoryMethod = markerCategoryClass.getDeclaredMethod("getChildren", new Class[0]);
            markerCategoryMethod.setAccessible(true);
          }
          Object[] entries = (Object[])markerCategoryMethod.invoke(element, new Object[0]);
          if ((entries != null) && (entries.length == 0)) {
            return false;
          }
          if ((entries != null) && (entries.length != 0))
          {
            Object[] arrayOfObject1;
            int j = (arrayOfObject1 = entries).length;
            for (int i = 0; i < j; i++)
            {
              Object markerEntry = arrayOfObject1[i];
              if ((markerEntry.getClass().getSimpleName().equals("MarkerEntry")) && 
                (isInteresting(((MarkerItem)markerEntry).getMarker(), viewer, parent))) {
                return true;
              }
            }
            return false;
          }
        }
        catch (Exception localException)
        {
          StatusHandler.log(new Status(4, "org.eclipse.mylyn.ide", 
            "Could not access marker view elements."));
        }
        return true;
      }
      if (element.getClass().getSimpleName().equals("MarkerEntry")) {
        return isInteresting(((MarkerItem)element).getMarker(), viewer, parent);
      }
    }
    return false;
  }
  
  protected boolean isImplicitlyInteresting(IMarker marker)
  {
    try
    {
      Object severity = marker.getAttribute("severity");
      return (severity != null) && (severity.equals(Integer.valueOf(2)));
    }
    catch (CoreException localCoreException) {}
    return false;
  }
}

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

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.mylyn.context.ui.IContextUiStartup;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class IdeUiBridgePlugin
  extends AbstractUIPlugin
{
  public static final String ID_PLUGIN = "org.eclipse.mylyn.ide";
  private static IdeUiBridgePlugin INSTANCE;
  public static final ImageDescriptor EDGE_REF_XML = getImageDescriptor("icons/elcl16/edge-ref-xml.gif");
  
  public IdeUiBridgePlugin()
  {
    INSTANCE = this;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    super.stop(context);
  }
  
  public static IdeUiBridgePlugin getDefault()
  {
    return INSTANCE;
  }
  
  public static ImageDescriptor getImageDescriptor(String path)
  {
    return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.mylyn.ide", path);
  }
  
  public static class IdeUiBridgeStartup
    implements IContextUiStartup
  {
    public void lazyStartup() {}
  }
}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;

public class XmlNodeHelper
{
  private String filename;
  private String end;
  
  public XmlNodeHelper(String handle)
  {
    int first = handle.indexOf(";");
    if (first == -1)
    {
      filename = handle;
      end = "";
    }
    else
    {
      filename = handle.substring(0, first);
      end = handle.substring(first + 1);
    }
  }
  
  public XmlNodeHelper(String filename, int s)
  {
    this.filename = filename;
    end = s;
  }
  
  public XmlNodeHelper(String filename, String s)
  {
    this.filename = filename;
    end = s;
  }
  
  public String getHandle()
  {
    return filename + ";" + getValue();
  }
  
  public String getFilename()
  {
    if (filename != null) {
      filename = filename.trim();
    }
    return filename;
  }
  
  public String getValue()
  {
    return end;
  }
  
  public boolean equals(Object e)
  {
    if ((e instanceof XmlNodeHelper))
    {
      XmlNodeHelper xnode = (XmlNodeHelper)e;
      return xnode.getHandle().equals(getHandle());
    }
    return false;
  }
  
  public int hashCode()
  {
    return getHandle().hashCode();
  }
  
  public static String getContents(InputStream is)
  {
    String contents = "";
    
    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    try
    {
      String s = "";
      char[] cbuf = new char['?'];
      while (br.read(cbuf) != -1)
      {
        s = new String(cbuf);
        contents = contents + s;
      }
    }
    catch (IOException e)
    {
      StatusHandler.log(new Status(4, "org.eclipse.mylyn.ide", "Could not get contents", e));
    }
    return contents;
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.mylyn.commons.ui.compatibility.CommonFonts;
import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IDegreeOfInterest;
import org.eclipse.mylyn.context.core.IInteractionContextManager;
import org.eclipse.mylyn.context.core.IInteractionElement;
import org.eclipse.mylyn.context.ui.ContextUi;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.views.markers.internal.ConcreteMarker;
import org.eclipse.ui.views.markers.internal.TableViewLabelProvider;

public class MarkerViewLabelProvider
  implements ITableLabelProvider, IColorProvider, IFontProvider
{
  private final TableViewLabelProvider provider;
  
  public MarkerViewLabelProvider(TableViewLabelProvider provider)
  {
    this.provider = provider;
  }
  
  public Font getFont(Object element)
  {
    if ((element instanceof ConcreteMarker))
    {
      String handle = ContextCore.getStructureBridge(((ConcreteMarker)element).getResource().getFileExtension())
        .getHandleForOffsetInObject(element, 0);
      IInteractionElement node = ContextCore.getContextManager().getElement(handle);
      if ((node != null) && 
        (node.getInterest().isLandmark()) && (!node.getInterest().isPropagated())) {
        return CommonFonts.BOLD;
      }
    }
    return null;
  }
  
  public Image getColumnImage(Object element, int columnIndex)
  {
    return provider.getColumnImage(element, columnIndex);
  }
  
  public String getColumnText(Object element, int columnIndex)
  {
    return provider.getColumnText(element, columnIndex);
  }
  
  public Color getForeground(Object element)
  {
    if ((element instanceof ConcreteMarker))
    {
      String handle = ContextCore.getStructureBridge(((ConcreteMarker)element).getResource().getFileExtension())
        .getHandleForOffsetInObject(element, 0);
      return ContextUi.getForeground(ContextCore.getContextManager().getElement(handle));
    }
    return null;
  }
  
  public Color getBackground(Object element)
  {
    return null;
  }
  
  public void addListener(ILabelProviderListener listener) {}
  
  public void dispose()
  {
    provider.dispose();
  }
  
  public boolean isLabelProperty(Object element, String property)
  {
    return provider.isLabelProperty(element, property);
  }
  
  public void removeListener(ILabelProviderListener listener) {}
}

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

import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.navigator.ResourceNavigator;

public class IdeUiUtil
{
  public static final String ID_VIEW_SYNCHRONIZE = "org.eclipse.team.sync.views.SynchronizeView";
  public static final String ID_NAVIGATOR = "org.eclipse.ui.views.ResourceNavigator";
  
  public static IViewPart getView(String id)
  {
    IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (activePage == null) {
      return null;
    }
    IViewPart view = activePage.findView(id);
    return view;
  }
  
  public static ResourceNavigator getNavigatorFromActivePage()
  {
    if ((PlatformUI.getWorkbench() == null) || (PlatformUI.getWorkbench().getActiveWorkbenchWindow() == null)) {
      return null;
    }
    IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    if (activePage == null) {
      return null;
    }
    IViewPart view = activePage.findView("org.eclipse.ui.views.ResourceNavigator");
    if ((view instanceof ResourceNavigator)) {
      return (ResourceNavigator)view;
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.ide.ui.IdeUiUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.ide.ui.actions;

import org.eclipse.mylyn.ide.ui.AbstractFocusMarkerViewAction;

public class FocusTaskMarkersViewAction
  extends AbstractFocusMarkerViewAction
{}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.ide.ui.actions.FocusTaskMarkersViewAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.ide.ui.actions;

import org.eclipse.mylyn.ide.ui.AbstractFocusMarkerViewAction;

public class FocusBookmarkMarkersViewAction
  extends AbstractFocusMarkerViewAction
{}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.ide.ui.actions.FocusBookmarkMarkersViewAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.ide.ui.actions;

import org.eclipse.mylyn.ide.ui.AbstractFocusMarkerViewAction;

public class FocusProblemsListAction
  extends AbstractFocusMarkerViewAction
{}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.ide.ui.actions.FocusProblemsListAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.ide.ui.actions;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.mylyn.context.ui.AbstractAutoFocusViewAction;
import org.eclipse.mylyn.context.ui.InterestFilter;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.views.navigator.FilterSelectionAction;
import org.eclipse.ui.views.navigator.IResourceNavigator;
import org.eclipse.ui.views.navigator.ResourceNavigator;
import org.eclipse.ui.views.navigator.ToggleLinkingAction;

public class FocusResourceNavigatorAction
  extends AbstractAutoFocusViewAction
{
  public FocusResourceNavigatorAction()
  {
    super(new InterestFilter(), true, true, true);
  }
  
  public List<StructuredViewer> getViewers()
  {
    List<StructuredViewer> viewers = new ArrayList();
    IViewPart part = super.getPartForAction();
    if ((part instanceof ResourceNavigator)) {
      viewers.add(((ResourceNavigator)part).getTreeViewer());
    }
    return viewers;
  }
  
  protected ISelection resolveSelection(IEditorPart part, ITextSelection changedSelection, StructuredViewer viewer)
    throws CoreException
  {
    IEditorInput input = part.getEditorInput();
    Object adapted = input.getAdapter(IResource.class);
    if ((adapted instanceof IResource)) {
      return new StructuredSelection(adapted);
    }
    return null;
  }
  
  protected void setManualFilteringAndLinkingEnabled(boolean on)
  {
    IViewPart part = super.getPartForAction();
    if ((part instanceof IResourceNavigator))
    {
      IContributionItem[] arrayOfIContributionItem;
      int j = (arrayOfIContributionItem = ((IResourceNavigator)part).getViewSite().getActionBars().getToolBarManager().getItems()).length;
      for (int i = 0; i < j; i++)
      {
        IContributionItem item = arrayOfIContributionItem[i];
        if ((item instanceof ActionContributionItem))
        {
          ActionContributionItem actionItem = (ActionContributionItem)item;
          if ((actionItem.getAction() instanceof ToggleLinkingAction)) {
            actionItem.getAction().setEnabled(on);
          }
        }
      }
      j = (arrayOfIContributionItem = ((IResourceNavigator)part).getViewSite().getActionBars().getMenuManager().getItems()).length;
      for (i = 0; i < j; i++)
      {
        IContributionItem item = arrayOfIContributionItem[i];
        if ((item instanceof ActionContributionItem))
        {
          ActionContributionItem actionItem = (ActionContributionItem)item;
          if ((actionItem.getAction() instanceof FilterSelectionAction)) {
            actionItem.getAction().setEnabled(on);
          }
        }
      }
    }
  }
  
  protected void setDefaultLinkingEnabled(boolean on)
  {
    IViewPart part = super.getPartForAction();
    if ((part instanceof IResourceNavigator)) {
      ((IResourceNavigator)part).setLinkingEnabled(on);
    }
  }
  
  protected boolean isDefaultLinkingEnabled()
  {
    IViewPart part = super.getPartForAction();
    if ((part instanceof IResourceNavigator)) {
      return ((IResourceNavigator)part).isLinkingEnabled();
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.ide.ui.actions.FocusResourceNavigatorAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.ide.ui.actions;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.mylyn.context.ui.InterestFilter;
import org.eclipse.mylyn.resources.ui.FocusCommonNavigatorAction;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.navigator.CommonNavigator;

public class FocusProjectExplorerAction
  extends FocusCommonNavigatorAction
{
  public FocusProjectExplorerAction()
  {
    super(new InterestFilter(), true, true, true);
  }
  
  protected FocusProjectExplorerAction(InterestFilter filter)
  {
    super(filter, true, true, true);
  }
  
  public List<StructuredViewer> getViewers()
  {
    List<StructuredViewer> viewers = new ArrayList();
    
    IViewPart view = super.getPartForAction();
    if ((view instanceof CommonNavigator))
    {
      CommonNavigator navigator = (CommonNavigator)view;
      viewers.add(navigator.getCommonViewer());
    }
    return viewers;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.ide.ui.actions.FocusProjectExplorerAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.ide.ui.actions;

import org.eclipse.mylyn.ide.ui.AbstractFocusMarkerViewAction;

public class FocusAllMarkersViewAction
  extends AbstractFocusMarkerViewAction
{}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.ide.ui.actions.FocusAllMarkersViewAction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.ide.ui;

import org.eclipse.mylyn.context.ui.IContextUiStartup;

public class IdeUiBridgePlugin$IdeUiBridgeStartup
  implements IContextUiStartup
{
  public void lazyStartup() {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.ide.ui.IdeUiBridgePlugin.IdeUiBridgeStartup
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.ide.ui;

import org.eclipse.core.resources.IResource;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IInteractionContextManager;
import org.eclipse.mylyn.context.core.IInteractionElement;
import org.eclipse.mylyn.context.core.InterestComparator;
import org.eclipse.ui.views.markers.internal.ProblemMarker;

public class MarkerViewerInterestSorter
  extends ViewerSorter
{
  protected InterestComparator<IInteractionElement> interestComparator = new InterestComparator();
  
  public int compare(Viewer viewer, Object obj1, Object obj2)
  {
    if (((obj1 instanceof ProblemMarker)) && ((obj1 instanceof ProblemMarker)))
    {
      ProblemMarker marker1 = (ProblemMarker)obj1;
      ProblemMarker marker2 = (ProblemMarker)obj2;
      if ((marker1.getSeverity() == 2) && (marker2.getSeverity() < 2)) {
        return -1;
      }
      if ((marker2.getSeverity() == 2) && 
        (marker1.getSeverity() < 2)) {
        return 1;
      }
      if (ContextCore.getContextManager().isContextActive())
      {
        AbstractContextStructureBridge bridge = ContextCore.getStructureBridge(marker1.getResource()
          .getFileExtension());
        IInteractionElement node1 = ContextCore.getContextManager().getElement(
          bridge.getHandleForOffsetInObject(marker1, 0));
        IInteractionElement node2 = ContextCore.getContextManager().getElement(
          bridge.getHandleForOffsetInObject(marker2, 0));
        return interestComparator.compare(node1, node2);
      }
    }
    return super.compare(viewer, obj1, obj2);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.ide.ui.MarkerViewerInterestSorter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
1

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