Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/outline
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11776/src/org/python/pydev/outline
Modified Files:
ParsedItem.java
Log Message:
Two methods have now static versions with parameters, so that
they can be used only with those parameters and not with an
instanciated class.
Index: ParsedItem.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/outline/ParsedItem.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ParsedItem.java 31 Dec 2003 19:34:07 -0000 1.4
--- ParsedItem.java 5 Mar 2004 14:38:51 -0000 1.5
***************
*** 26,30 ****
* and this is then converted to a tree of ParsedItems
*/
! class ParsedItem {
ParsedItem parent;
ParsedItem[] children = null; // array of modTypes
--- 26,30 ----
* and this is then converted to a tree of ParsedItems
*/
! public class ParsedItem {
ParsedItem parent;
ParsedItem[] children = null; // array of modTypes
***************
*** 112,115 ****
--- 112,122 ----
*/
public IOutlineModel.SelectThis getPosition() {
+ return getPosition(token);
+ }
+
+ /*
+ * @return where in the document is this item located
+ */
+ public static IOutlineModel.SelectThis getPosition(SimpleNode token) {
int startOffset = 0;
boolean wholeLine = false;
***************
*** 128,132 ****
}
! IOutlineModel.SelectThis position = new IOutlineModel.SelectThis(token.beginLine, token.beginColumn+startOffset, toString().length());
if (wholeLine)
--- 135,139 ----
}
! IOutlineModel.SelectThis position = new IOutlineModel.SelectThis(token.beginLine, token.beginColumn+startOffset, toString(token).length());
if (wholeLine)
***************
*** 134,138 ****
return position;
}
!
public ParsedItem[] getChildren() {
if (children == null) {
--- 141,145 ----
return position;
}
!
public ParsedItem[] getChildren() {
if (children == null) {
***************
*** 152,156 ****
--- 159,168 ----
}
+
public String toString() {
+ return toString(token);
+ }
+
+ public static String toString(SimpleNode token) {
if (token instanceof ClassDef) {
return ((ClassDef)token).name;
|