[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/actions/codefolding PyUnCollapseAll.java,
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-09-28 12:46:33
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/codefolding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4313/src/org/python/pydev/editor/actions/codefolding Modified Files: PyUnCollapseAll.java PyCollapseAll.java Log Message: Synching to latest changes: Pydev <ul> <li><strong>Editor</strong>: Cursor settings no longer overridden</li> <li><strong>Code-completion</strong>: If __all__ is defined with runtime elements (and not only in a single assign statement), it's ignored for code-completion purposes</li> <li><strong>Debugger</strong>: Pythonpath the same in debug and regular modes (sys.path[0] is the same directory as the file run)</li> <li><strong>Debugger</strong>: Persist choices done in the debugger when files from the debugger are not found</li> <li><strong>Interpreter config</strong>: "email" automatically added to the "forced builtins"</li> <li><strong>Parser</strong>: Correctly recognizing absolute import with 3 or more levels</li> <li><strong>Syntax check</strong>: Option to do only on active editor</li> </ul> Also: tabs changed for spaces Index: PyUnCollapseAll.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/codefolding/PyUnCollapseAll.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyUnCollapseAll.java 9 Jul 2005 01:05:56 -0000 1.5 --- PyUnCollapseAll.java 28 Sep 2008 12:45:49 -0000 1.6 *************** *** 23,27 **** */ public void run(IAction action) { ! final ProjectionAnnotationModel model = getModel(); if (model != null) { --- 23,27 ---- */ public void run(IAction action) { ! final ProjectionAnnotationModel model = getModel(); if (model != null) { *************** *** 31,56 **** if(iter != null){ ! //we just want to expand the roots, and we are working only with the collapsed sorted by offset. ! ! List elements = new ArrayList(); //used to know the context ! while (iter.hasNext()) { ! PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); ! ! //special case, we have none in our context ! if(elements.size() == 0){ ! model.expand(element); ! elements.add(element); ! ! } else{ ! if(isInsideLast(element, elements, model)){ ! //ignore ! ! }else{ ! //ok, the one in the top has to be collapsed ( and this one added ) ! model.expand(element); ! elements.add(element); ! } ! } ! } } } --- 31,56 ---- if(iter != null){ ! //we just want to expand the roots, and we are working only with the collapsed sorted by offset. ! ! List elements = new ArrayList(); //used to know the context ! while (iter.hasNext()) { ! PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); ! ! //special case, we have none in our context ! if(elements.size() == 0){ ! model.expand(element); ! elements.add(element); ! ! } else{ ! if(isInsideLast(element, elements, model)){ ! //ignore ! ! }else{ ! //ok, the one in the top has to be collapsed ( and this one added ) ! model.expand(element); ! elements.add(element); ! } ! } ! } } } Index: PyCollapseAll.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/codefolding/PyCollapseAll.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyCollapseAll.java 9 Jul 2005 01:05:56 -0000 1.5 --- PyCollapseAll.java 28 Sep 2008 12:45:49 -0000 1.6 *************** *** 25,29 **** */ public void run(IAction action) { ! final ProjectionAnnotationModel model = getModel(); if (model != null) { --- 25,29 ---- */ public void run(IAction action) { ! final ProjectionAnnotationModel model = getModel(); if (model != null) { *************** *** 33,62 **** if(iter != null){ ! //we just want to collapse the leafs, and we are working only with the not collapsed sorted by offset. ! ! List elements = new ArrayList(); //used to know the context ! while (iter.hasNext()) { ! PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); ! ! //special case, we have none in our context ! if(elements.size() == 0){ ! elements.add(element); ! ! } else{ ! if(isInsideLast(element, elements, model)){ ! elements.add(element); ! ! }else{ ! //ok, the one in the top has to be collapsed ( and this one added ) ! PyProjectionAnnotation top = (PyProjectionAnnotation) elements.remove(elements.size()-1); ! model.collapse(top); ! elements.add(element); ! } ! } ! } ! if(elements.size() > 0){ ! PyProjectionAnnotation top = (PyProjectionAnnotation) elements.remove(elements.size()-1); ! model.collapse(top); ! } } } --- 33,62 ---- if(iter != null){ ! //we just want to collapse the leafs, and we are working only with the not collapsed sorted by offset. ! ! List elements = new ArrayList(); //used to know the context ! while (iter.hasNext()) { ! PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); ! ! //special case, we have none in our context ! if(elements.size() == 0){ ! elements.add(element); ! ! } else{ ! if(isInsideLast(element, elements, model)){ ! elements.add(element); ! ! }else{ ! //ok, the one in the top has to be collapsed ( and this one added ) ! PyProjectionAnnotation top = (PyProjectionAnnotation) elements.remove(elements.size()-1); ! model.collapse(top); ! elements.add(element); ! } ! } ! } ! if(elements.size() > 0){ ! PyProjectionAnnotation top = (PyProjectionAnnotation) elements.remove(elements.size()-1); ! model.collapse(top); ! } } } |