|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.m2m.atl.adt.ui.editor.AtlOccurrencesFinder
public class AtlOccurrencesFinder
This class allows us to look into the model for the occurrence of the selected word (if there are). Several problems are encountered:
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.m2m.atl.adt.ui.editor.IOccurrencesFinder |
---|
IOccurrencesFinder.OccurrenceLocation |
Field Summary |
---|
Fields inherited from interface org.eclipse.m2m.atl.adt.ui.editor.IOccurrencesFinder |
---|
F_EXCEPTION_DECLARATION, F_READ_OCCURRENCE, F_WRITE_OCCURRENCE, K_BREAK_TARGET_OCCURRENCE, K_EXCEPTION_OCCURRENCE, K_EXIT_POINT_OCCURRENCE, K_IMPLEMENTS_OCCURRENCE, K_OCCURRENCE |
Constructor Summary | |
---|---|
AtlOccurrencesFinder(AtlEditor editor,
org.eclipse.jface.text.IDocument document)
|
Method Summary | |
---|---|
void |
browseModel(org.eclipse.emf.ecore.EObject element,
java.lang.String name,
java.lang.String featureName,
java.lang.String declarationType,
java.lang.String useType,
java.lang.String displayType)
Browses the model in order to find occurrences of an element and add it to the result list. |
void |
browseModelForType(org.eclipse.emf.ecore.EObject element,
java.lang.String name)
Browses the model in order to find occurrences of a type and add it to the result list. |
static java.lang.Object |
eGet(org.eclipse.emf.ecore.EObject self,
java.lang.String featureName)
Returns the value of a feature on an EObject. |
java.lang.String |
getElementName()
Returns the name of the element to look for or null if the finder hasn't
been initialized yet. |
java.lang.String |
getID()
Returns the id of this finder. |
java.lang.String |
getJobLabel()
|
IOccurrencesFinder.OccurrenceLocation[] |
getOccurrences()
Returns the occurrences |
org.eclipse.jface.text.IRegion |
getRegionFromElement(org.eclipse.emf.ecore.EObject element)
Gets the region of the element (actually, it gives the region of the word that is interesting for us in the expression given by the element. |
int |
getSearchKind()
|
java.lang.String |
getUnformattedPluralLabel()
Returns the plural label for this finder with 3 placeholders: {0} for the element name
{1} for the number of results found
{2} for the scope (name of the compilation unit)
|
java.lang.String |
getUnformattedSingularLabel()
Returns the singular label for this finder with 2 placeholders: {0} for the element name
{1} for the scope (name of the compilation unit)
|
java.lang.String |
initialize(org.eclipse.jface.text.IRegion selection)
Initialization of the finder, with a text selection. |
static boolean |
oclIsKindOf(org.eclipse.emf.ecore.EObject element,
java.lang.String testedElementName)
Equivalent of ASMOclAny oclIsKindOf method for EObjects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AtlOccurrencesFinder(AtlEditor editor, org.eclipse.jface.text.IDocument document)
Method Detail |
---|
public java.lang.String initialize(org.eclipse.jface.text.IRegion selection)
selection
- the current text selection
public java.lang.String getJobLabel()
getJobLabel
in interface IOccurrencesFinder
public java.lang.String getUnformattedPluralLabel()
IOccurrencesFinder
element name
getUnformattedPluralLabel
in interface IOccurrencesFinder
public java.lang.String getUnformattedSingularLabel()
IOccurrencesFinder
element name
getUnformattedSingularLabel
in interface IOccurrencesFinder
public java.lang.String getElementName()
IOccurrencesFinder
null
if the finder hasn't
been initialized yet.
getElementName
in interface IOccurrencesFinder
public IOccurrencesFinder.OccurrenceLocation[] getOccurrences()
getOccurrences
in interface IOccurrencesFinder
IOccurrencesFinder.getOccurrences()
public static java.lang.Object eGet(org.eclipse.emf.ecore.EObject self, java.lang.String featureName)
self
- the EObjectfeatureName
- the feature name
public static boolean oclIsKindOf(org.eclipse.emf.ecore.EObject element, java.lang.String testedElementName)
element
- the tested elementtestedElementName
- the type name
True
element has testedElementName in its superTypes, False
else.public org.eclipse.jface.text.IRegion getRegionFromElement(org.eclipse.emf.ecore.EObject element) throws org.eclipse.jface.text.BadLocationException
element
- the expression we want to extract the word
org.eclipse.jface.text.BadLocationException
public void browseModel(org.eclipse.emf.ecore.EObject element, java.lang.String name, java.lang.String featureName, java.lang.String declarationType, java.lang.String useType, java.lang.String displayType) throws org.eclipse.jface.text.BadLocationException
element
- the element we want the occurrences fromname
- the name of the element we are looking forfeatureName
- the name of the feature that allows us to find the name of the current navigated elementdeclarationType
- the type of the element that will be considered as "declaration" (different highlighting)useType
- the type of the element that will be considered as "occurrence" (different highlighting)displayType
- the type that is going to be displayed in the eclipse marker
org.eclipse.jface.text.BadLocationException
public void browseModelForType(org.eclipse.emf.ecore.EObject element, java.lang.String name) throws org.eclipse.jface.text.BadLocationException
element
- the typename
- the name of the type
org.eclipse.jface.text.BadLocationException
public int getSearchKind()
getSearchKind
in interface IOccurrencesFinder
public java.lang.String getID()
IOccurrencesFinder
getID
in interface IOccurrencesFinder
|
Copyright 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |