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

Event event)
  {
    Object o = event.getSource();
    if ((o instanceof TreeViewer))
    {
      ((TreeViewer)o).refresh();
      ((TreeViewer)o).expandAll();
    }
  }
  
  public void treeCollapsed(TreeExpansionEvent event)
  {
    Object o = event.getSource();
    if ((o instanceof TreeViewer)) {
      ((TreeViewer)o).refresh();
    }
  }
  
  public void treeExpanded(TreeExpansionEvent event)
  {
    Object o = event.getSource();
    if ((o instanceof TreeViewer)) {
      ((TreeViewer)o).refresh();
    }
  }
}

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

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.internal.resources.File;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;
import org.eclipse.mylyn.context.core.IInteractionElement;
import org.eclipse.mylyn.internal.context.core.ContextCorePlugin;
import org.eclipse.mylyn.internal.context.core.IActiveSearchListener;
import org.eclipse.mylyn.internal.ide.ui.XmlNodeHelper;
import org.eclipse.search.internal.ui.text.FileSearchResult;
import org.eclipse.search.ui.text.Match;

class XmlJavaRelationProvider$1
  implements IActiveSearchListener
{
  private boolean gathered = false;
  
  XmlJavaRelationProvider$1(XmlJavaRelationProvider paramXmlJavaRelationProvider, IInteractionElement paramIInteractionElement, int paramInt) {}
  
  public void searchCompleted(List<?> l)
  {
    if (l.isEmpty()) {
      return;
    }
    Map<String, String> nodes = new HashMap();
    Object[] far;
    if ((l.get(0) instanceof FileSearchResult))
    {
      FileSearchResult fsr = (FileSearchResult)l.get(0);
      
      far = fsr.getElements();
      Object[] arrayOfObject1;
      int j = (arrayOfObject1 = far).length;
      for (int i = 0; i < j; i++)
      {
        Object element = arrayOfObject1[i];
        Match[] mar = fsr.getMatches(element);
        if ((element instanceof File))
        {
          File f = (File)element;
          Match[] arrayOfMatch1;
          int m = (arrayOfMatch1 = mar).length;
          for (int k = 0; k < m; k++)
          {
            Match m = arrayOfMatch1[k];
            try
            {
              AbstractContextStructureBridge bridge = ContextCorePlugin.getDefault()
                .getStructureBridge(f.getName());
              String handle = bridge.getHandleForOffsetInObject(f, m.getOffset());
              if (handle != null)
              {
                String second = handle.substring(handle.indexOf(";"));
                
                XmlNodeHelper xnode = new XmlNodeHelper(f.getFullPath().toString(), second);
                XmlJavaRelationProvider.nodeMap.put(m, xnode);
                Object o = bridge.getObjectForHandle(handle);
                String name = bridge.getLabel(o);
                if (o != null) {
                  nodes.put(handle, name);
                }
              }
            }
            catch (Exception e)
            {
              StatusHandler.log(new Status(4, "org.eclipse.mylyn.pde.ui", 
                "Unable to create match", e));
            }
          }
        }
      }
    }
    for (String handle : nodes.keySet()) {
      XmlJavaRelationProvider.access$0(this$0, val$node, "plugin.xml", handle, val$degreeOfSeparation);
    }
    gathered = true;
    XmlJavaRelationProvider.access$1(this$0, val$node);
  }
  
  public boolean resultsGathered()
  {
    return gathered;
  }
}

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

import java.util.List;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.mylyn.context.ui.IContextUiStartup;
import org.eclipse.mylyn.monitor.ui.MonitorUi;
import org.osgi.framework.BundleContext;

public class PdeUiBridgePlugin
  extends Plugin
{
  public static final String ID_PLUGIN = "org.eclipse.mylyn.pde.ui";
  private static PdeUiBridgePlugin INSTANCE;
  private PdeEditingMonitor pdeEditingMonitor;
  
  public static class PdeUiBrideStartup
    implements IContextUiStartup
  {
    public void lazyStartup()
    {
      PdeUiBridgePlugin.getDefault().lazyStart();
    }
  }
  
  public static PdeUiBridgePlugin getDefault()
  {
    return INSTANCE;
  }
  
  private void lazyStart()
  {
    pdeEditingMonitor = new PdeEditingMonitor();
    MonitorUi.getSelectionMonitors().add(pdeEditingMonitor);
  }
  
  private void lazyStop()
  {
    if (pdeEditingMonitor != null) {
      MonitorUi.getSelectionMonitors().remove(pdeEditingMonitor);
    }
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    INSTANCE = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    lazyStop();
    
    super.stop(context);
    INSTANCE = null;
  }
}

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

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.context.core.IActiveSearchListener;
import org.eclipse.mylyn.internal.context.core.IActiveSearchOperation;
import org.eclipse.mylyn.internal.java.ui.search.XmlActiveSearchUpdater;
import org.eclipse.search.core.text.TextSearchScope;
import org.eclipse.search.internal.ui.text.FileSearchQuery;
import org.eclipse.search.internal.ui.text.FileSearchResult;
import org.eclipse.search.ui.ISearchResult;
import org.eclipse.search.ui.text.FileTextSearchScope;

public class XmlJavaRelationProvider$XMLSearchOperation
  extends FileSearchQuery
  implements IActiveSearchOperation
{
  public ISearchResult getSearchResult()
  {
    try
    {
      Class<?> clazz = FileSearchQuery.class;
      Field field = clazz.getDeclaredField("fResult");
      field.setAccessible(true);
      FileSearchResult fResult = (FileSearchResult)field.get(this);
      if (fResult == null)
      {
        fResult = new FileSearchResult(this);
        field.set(this, fResult);
        new XmlActiveSearchUpdater(fResult);
      }
      return fResult;
    }
    catch (Exception e)
    {
      StatusHandler.log(new Status(2, "org.eclipse.mylyn.pde.ui", 
        "Failed to get search result: " + e.getMessage()));
    }
    return super.getSearchResult();
  }
  
  public IStatus run(IProgressMonitor monitor)
  {
    try
    {
      super.run(monitor);
      ISearchResult result = getSearchResult();
      if ((result instanceof FileSearchResult))
      {
        List<Object> l = new ArrayList();
        if (((FileSearchResult)result).getElements().length != 0) {
          l.add(result);
        }
        notifySearchCompleted(l);
      }
      return Status.OK_STATUS;
    }
    catch (Throwable localThrowable) {}
    return new Status(2, "org.eclipse.mylyn.context.core", 0, 
      Messages.XmlJavaRelationProvider_Skipped_XML_search, null);
  }
  
  public XmlJavaRelationProvider$XMLSearchOperation(TextSearchScope scope, String searchString)
  {
    super(searchString, false, true, (FileTextSearchScope)scope);
  }
  
  private final List<IActiveSearchListener> listeners = new ArrayList();
  
  public void addListener(IActiveSearchListener l)
  {
    listeners.add(l);
  }
  
  public void removeListener(IActiveSearchListener l)
  {
    listeners.remove(l);
  }
  
  public void notifySearchCompleted(List<Object> l)
  {
    for (IActiveSearchListener listener : listeners) {
      listener.searchCompleted(l);
    }
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.Job;

public class XmlJavaRelationProvider$XMLSearchJob
  extends Job
{
  private final XmlJavaRelationProvider.XMLSearchOperation op;
  
  public XmlJavaRelationProvider$XMLSearchJob(String name, XmlJavaRelationProvider.XMLSearchOperation op)
  {
    super(name);
    this.op = op;
  }
  
  protected IStatus run(IProgressMonitor monitor)
  {
    return op.run(monitor);
  }
}

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

import java.util.Collections;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
import org.eclipse.mylyn.internal.java.ui.JavaUiUtil;
import org.eclipse.pde.api.tools.ui.internal.completion.APIToolsJavadocCompletionProposalComputer;

public class FocusedApiToolsJavadocCompletionProposalComputer
  extends APIToolsJavadocCompletionProposalComputer
{
  private static final String ASSIST_API_TOOLS = "org.eclipse.pde.api.tools.ui.apitools_proposal_category";
  
  public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor)
  {
    if ((JavaUiUtil.getProposalCategory("org.eclipse.pde.api.tools.ui.apitools_proposal_category") == null) && 
      (!JavaUiUtil.isDefaultAssistActive("org.eclipse.jdt.ui.javaNoTypeProposalCategory"))) {
      return super.computeCompletionProposals(context, monitor);
    }
    return Collections.emptyList();
  }
}

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

import java.util.Locale;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.ide.ui.XmlNodeHelper;
import org.eclipse.mylyn.monitor.ui.AbstractUserInteractionMonitor;
import org.eclipse.pde.core.plugin.IPluginBase;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.core.plugin.IPluginObject;
import org.eclipse.pde.internal.core.plugin.ImportObject;
import org.eclipse.pde.internal.core.text.IDocumentAttributeNode;
import org.eclipse.pde.internal.core.text.IDocumentElementNode;
import org.eclipse.pde.internal.core.text.plugin.PluginModel;
import org.eclipse.pde.internal.core.text.plugin.PluginObjectNode;
import org.eclipse.pde.internal.ui.editor.context.InputContext;
import org.eclipse.pde.internal.ui.editor.plugin.ManifestEditor;
import org.eclipse.pde.internal.ui.editor.plugin.ManifestSourcePage;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.FileEditorInput;

public class PdeEditingMonitor
  extends AbstractUserInteractionMonitor
{
  protected void handleWorkbenchPartSelection(IWorkbenchPart part, ISelection selection, boolean contributeToContext)
  {
    if ((part instanceof ManifestEditor))
    {
      TextSelection textSelection = null;
      IEditorInput in = null;
      
      ManifestEditor editor = (ManifestEditor)part;
      if (!(editor.getEditorInput() instanceof FileEditorInput)) {
        return;
      }
      if ((!(editor.getSelection() instanceof TextSelection)) && (!(editor.getSelection() instanceof StructuredSelection))) {
        return;
      }
      if ((editor.getSelection() instanceof StructuredSelection))
      {
        StructuredSelection s = (StructuredSelection)editor.getSelection();
        if ((s.getFirstElement() instanceof PluginObjectNode))
        {
          PluginObjectNode n = (PluginObjectNode)s.getFirstElement();
          textSelection = new TextSelection(n.getOffset(), n.getLength());
        }
        else if ((s.getFirstElement() instanceof ImportObject))
        {
          ImportObject io = (ImportObject)s.getFirstElement();
          if (!(io.getImport() instanceof PluginObjectNode)) {
            break label193;
          }
          PluginObjectNode n = (PluginObjectNode)io.getImport();
          textSelection = new TextSelection(n.getOffset(), n.getLength());
        }
      }
      else
      {
        textSelection = (TextSelection)editor.getSelection();
      }
      label193:
      in = editor.getEditorInput();
      if (textSelection != null) {
        try
        {
          int offset = textSelection.getOffset();
          PluginObjectNode node = getNode(editor, offset, false);
          if (node != null)
          {
            FileEditorInput fei = (FileEditorInput)in;
            if (fei.getFile().getFullPath().toString().toLowerCase(Locale.ENGLISH).endsWith("/manifest.mf")) {
              return;
            }
            String nodeString = getStringOfNode(node);
            if (nodeString == null) {
              return;
            }
            XmlNodeHelper xnode = new XmlNodeHelper(fei.getFile().getFullPath().toString(), 
              nodeString.hashCode());
            
            super.handleElementSelection(part, xnode, contributeToContext);
          }
        }
        catch (Exception e)
        {
          StatusHandler.log(new Status(4, "org.eclipse.mylyn.pde.ui", 
            "Could not resolve selection", e));
        }
      }
    }
  }
  
  public static String getStringOfNode(IDocumentElementNode node)
  {
    if (node == null) {
      return null;
    }
    String s = node.getXMLTagName();
    IDocumentAttributeNode[] arrayOfIDocumentAttributeNode;
    int j = (arrayOfIDocumentAttributeNode = node.getNodeAttributes()).length;
    for (int i = 0; i < j; i++)
    {
      IDocumentAttributeNode a = arrayOfIDocumentAttributeNode[i];
      s = s + a.getAttributeName() + "=" + a.getAttributeValue();
    }
    return s;
  }
  
  public static PluginObjectNode getNode(ManifestEditor editor, int offset, boolean hashCode)
  {
    ManifestSourcePage page = (ManifestSourcePage)editor.findPage("plugin-context");
    if (page != null)
    {
      IPluginModelBase model = (IPluginModelBase)page.getInputContext().getModel();
      PluginObjectNode node = (PluginObjectNode)findNode(model.getPluginBase().getLibraries(), 
        offset, hashCode);
      if (node == null) {
        node = (PluginObjectNode)findNode(model.getPluginBase().getImports(), offset, 
          hashCode);
      }
      if (node == null) {
        node = (PluginObjectNode)findNode(model.getPluginBase().getExtensionPoints(), 
          offset, hashCode);
      }
      if (node == null) {
        node = (PluginObjectNode)findNode(model.getPluginBase().getExtensions(), offset, 
          hashCode);
      }
      if (node == null) {
        node = (PluginObjectNode)findNode(new IPluginObject[] { model.getPluginBase() }, 
          offset, hashCode);
      }
      return node;
    }
    return null;
  }
  
  public static PluginObjectNode getNode(IDocument d, IFile f, int num, boolean hashCode)
    throws CoreException
  {
    PluginModel model = new PluginModel(d, true);
    model.setUnderlyingResource(f);
    if (!model.isLoaded())
    {
      model.load();
      model.setEnabled(true);
    }
    PluginObjectNode node = (PluginObjectNode)findNode(model.getPluginBase().getLibraries(), 
      num, hashCode);
    if (node == null) {
      node = (PluginObjectNode)findNode(model.getPluginBase().getImports(), num, hashCode);
    }
    if (node == null) {
      node = (PluginObjectNode)findNode(model.getPluginBase().getExtensionPoints(), num, 
        hashCode);
    }
    if (node == null) {
      node = (PluginObjectNode)findNode(model.getPluginBase().getExtensions(), num, hashCode);
    }
    if (node == null) {
      node = (PluginObjectNode)findNode(new IPluginObject[] { model.getPluginBase() }, num, 
        hashCode);
    }
    return node;
  }
  
  private static IDocumentElementNode findNode(IPluginObject[] nodes, int offset, boolean hashCode)
  {
    IPluginObject[] arrayOfIPluginObject = nodes;int j = nodes.length;
    for (int i = 0; i < j; i++)
    {
      IPluginObject node3 = arrayOfIPluginObject[i];
      IDocumentElementNode node = (IDocumentElementNode)node3;
      IDocumentElementNode[] children = node.getChildNodes();
      
      IDocumentElementNode node2 = null;
      if (children.length > 0) {
        node2 = findNode(children, offset, hashCode);
      }
      if ((node2 != null) && ((node2 instanceof IPluginObject))) {
        return node2;
      }
      if (!hashCode)
      {
        if ((offset >= node.getOffset()) && (offset < node.getOffset() + node.getLength())) {
          return node;
        }
      }
      else if (getStringOfNode(node).hashCode() == offset) {
        return node;
      }
    }
    return null;
  }
  
  private static IDocumentElementNode findNode(IDocumentElementNode[] nodes, int offset, boolean hashCode)
  {
    IDocumentElementNode[] arrayOfIDocumentElementNode1 = nodes;int j = nodes.length;
    for (int i = 0; i < j; i++)
    {
      IDocumentElementNode node = arrayOfIDocumentElementNode1[i];
      IDocumentElementNode[] children = node.getChildNodes();
      IDocumentElementNode node2 = null;
      if (children.length > 0) {
        node2 = findNode(children, offset, hashCode);
      }
      if (node2 != null) {
        return node2;
      }
      if (!hashCode)
      {
        if ((offset >= node.getOffset()) && (offset < node.getOffset() + node.getLength())) {
          return node;
        }
      }
      else if (getStringOfNode(node).hashCode() == offset) {
        return node;
      }
    }
    return null;
  }
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.pde.ui.messages";
  public static String PdeContextLabelProvider_referenced_by;
  public static String XmlJavaRelationProvider_Skipped_XML_search;
  
  static {}
  
  public static void reloadMessages()
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.pde.ui.messages", Messages.class);
  }
}

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

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