com.intellij.usages
Class UsageInfo2UsageAdapter

java.lang.Object
  extended by com.intellij.usages.UsageInfo2UsageAdapter
All Implemented Interfaces:
Navigatable, MergeableUsage, PsiElementUsage, UsageInFile, UsageInLibrary, UsageInModule, Usage
Direct Known Subclasses:
ReadWriteAccessUsageInfo2UsageAdapter

public class UsageInfo2UsageAdapter
extends java.lang.Object
implements Usage, UsageInModule, UsageInLibrary, UsageInFile, PsiElementUsage, MergeableUsage

Created by IntelliJ IDEA. User: max Date: Dec 17, 2004 Time: 2:42:29 PM To change this template use File | Settings | File Templates.


Field Summary
protected  javax.swing.Icon myIcon
           
 
Constructor Summary
UsageInfo2UsageAdapter(UsageInfo usageInfo)
           
 
Method Summary
 boolean canNavigate()
           
 boolean canNavigateToSource()
           
static UsageInfo2UsageAdapter[] convert(UsageInfo[] usageInfos)
           
 PsiElement getElement()
           
 VirtualFile getFile()
           
 OrderEntry getLibraryEntry()
           
 int getLine()
           
 FileEditorLocation getLocation()
           
 Module getModule()
           
 UsagePresentation getPresentation()
           
 RangeMarker getRangeMarker()
           
 UsageInfo getUsageInfo()
           
 void highlightInEditor()
           
 boolean isNonCodeUsage()
           
 boolean isReadOnly()
           
 boolean isValid()
           
 boolean merge(MergeableUsage other)
           
 void navigate(boolean focus)
          Open editor and select/navigate to the object there if possible.
 void reset()
          Revert to original status prior any merges
 void selectInEditor()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myIcon

protected javax.swing.Icon myIcon
Constructor Detail

UsageInfo2UsageAdapter

public UsageInfo2UsageAdapter(UsageInfo usageInfo)
Method Detail

getPresentation

public UsagePresentation getPresentation()
Specified by:
getPresentation in interface Usage

isValid

public boolean isValid()
Specified by:
isValid in interface Usage

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface Usage

getLocation

public FileEditorLocation getLocation()
Specified by:
getLocation in interface Usage

selectInEditor

public void selectInEditor()
Specified by:
selectInEditor in interface Usage

highlightInEditor

public void highlightInEditor()
Specified by:
highlightInEditor in interface Usage

getRangeMarker

public final RangeMarker getRangeMarker()

navigate

public void navigate(boolean focus)
Description copied from interface: Navigatable
Open editor and select/navigate to the object there if possible. Just do nothing if navigation is not possible like in case of a package

Specified by:
navigate in interface Navigatable

canNavigate

public boolean canNavigate()
Specified by:
canNavigate in interface Navigatable
Returns:
false if navigation is not possible for any reason.

canNavigateToSource

public boolean canNavigateToSource()
Specified by:
canNavigateToSource in interface Navigatable
Returns:
false if navigation to source is not possible for any reason. Source means some kind of editor

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getModule

public Module getModule()
Specified by:
getModule in interface UsageInModule

getLibraryEntry

public OrderEntry getLibraryEntry()
Specified by:
getLibraryEntry in interface UsageInLibrary

getFile

public VirtualFile getFile()
Specified by:
getFile in interface UsageInFile

getLine

public int getLine()

merge

public boolean merge(MergeableUsage other)
Specified by:
merge in interface MergeableUsage
Returns:
true if merge successed

reset

public void reset()
Description copied from interface: MergeableUsage
Revert to original status prior any merges

Specified by:
reset in interface MergeableUsage

getElement

public PsiElement getElement()
Specified by:
getElement in interface PsiElementUsage

isNonCodeUsage

public boolean isNonCodeUsage()
Specified by:
isNonCodeUsage in interface PsiElementUsage

getUsageInfo

public UsageInfo getUsageInfo()

convert

public static UsageInfo2UsageAdapter[] convert(UsageInfo[] usageInfos)