Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/autoedit
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1469/src/org/python/pydev/editor/autoedit
Modified Files:
DefaultIndentPrefs.java AbstractIndentPrefs.java
Log Message:
synching mercurial
Index: AbstractIndentPrefs.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/autoedit/AbstractIndentPrefs.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AbstractIndentPrefs.java 14 Jun 2008 22:14:57 -0000 1.5
--- AbstractIndentPrefs.java 28 Jul 2008 15:53:31 -0000 1.6
***************
*** 40,43 ****
--- 40,46 ----
}
+ /**
+ * Converts spaces to tabs or vice-versa depending on the user preferences
+ */
public void convertToStd(IDocument document, DocumentCommand command){
try {
***************
*** 129,136 ****
private boolean isWhitespace(String s) {
! for (int i = s.length() - 1; i > -1 ; i--)
! if (!Character.isWhitespace(s.charAt(i)))
return false;
return true;
}
--- 132,151 ----
+ /**
+ * Checks if the string is solely composed of spaces
+ *
+ * @param s the string analyzed
+ * @return true if it's only composed of spaces and false otherwise.
+ */
private boolean isWhitespace(String s) {
! int len = s.length();
!
! //it's done backwards because the chance of finding a non-whitespace char is higher at the end of the string
! //than at the beggining
! for (int i = len - 1; i > -1 ; i--){
! if (!Character.isWhitespace(s.charAt(i))){
return false;
+ }
+ }
return true;
}
Index: DefaultIndentPrefs.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/autoedit/DefaultIndentPrefs.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** DefaultIndentPrefs.java 4 Aug 2007 16:01:11 -0000 1.12
--- DefaultIndentPrefs.java 28 Jul 2008 15:53:31 -0000 1.13
***************
*** 10,14 ****
--- 10,18 ----
import org.python.pydev.plugin.PydevPrefs;
+ /**
+ * Provides indentation preferences from the preferences set in the preferences pages within eclipse.
+ */
public class DefaultIndentPrefs extends AbstractIndentPrefs {
+
/**
* Cache for indentation string
***************
*** 22,27 ****
--- 26,37 ----
private static PyPreferencesCache cache;
+ /**
+ * Singleton instance for the preferences
+ */
private static IIndentPrefs indentPrefs;
+ /**
+ * @return the indentation preferences to be used
+ */
public synchronized static IIndentPrefs get() {
if(indentPrefs == null){
***************
*** 31,34 ****
--- 41,47 ----
}
+ /**
+ * @return a cache for the preferences.
+ */
private PyPreferencesCache getCache(){
if(cache == null){
|