~vil/pydev/upstream

« back to all changes in this revision

Viewing changes to org.python.pydev/src/org/python/pydev/editor/autoedit/IIndentPrefs.java

  • Committer: Vladimír Lapáček
  • Date: 2006-08-30 18:38:44 UTC
  • Revision ID: vladimir.lapacek@gmail.com-20060830183844-f4d82c1239a7770a
Initial import of upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Created on May 5, 2005
 
3
 *
 
4
 * @author Fabio Zadrozny
 
5
 */
 
6
package org.python.pydev.editor.autoedit;
 
7
 
 
8
import org.eclipse.jface.text.DocumentCommand;
 
9
import org.eclipse.jface.text.IDocument;
 
10
 
 
11
/**
 
12
 * @author Fabio Zadrozny
 
13
 */
 
14
public interface IIndentPrefs {
 
15
 
 
16
    /**
 
17
     * @return True if we should substitute tabs for spaces.
 
18
     */
 
19
    public boolean getUseSpaces();
 
20
    
 
21
    /**
 
22
     * Sets the forceTabs preference for auto-indentation.
 
23
     * 
 
24
     * <p>
 
25
     * This is the preference that overrides "use spaces" preference when file
 
26
     * contains tabs (like mine do).
 
27
     * <p>
 
28
     * If the first indented line starts with a tab, then tabs override spaces.
 
29
     * 
 
30
     * @return True If tabs should be used even if it says we should use spaces.
 
31
     */
 
32
    public void setForceTabs(boolean forceTabs);
 
33
    public boolean getForceTabs();
 
34
    
 
35
    /**
 
36
     * @return the width a tab should have.
 
37
     */
 
38
    public int getTabWidth();
 
39
    
 
40
    /**
 
41
     * @return the indentation string based on the current settings.
 
42
     */
 
43
        public String getIndentationString();
 
44
 
 
45
        /**
 
46
         * Given the current settings, convert the current string to tabs or spaces.
 
47
         */
 
48
        public void convertToStd(IDocument document, DocumentCommand command);
 
49
        
 
50
        /**
 
51
         * @return whether we should auto-close parentesis
 
52
         */
 
53
        public boolean getAutoParentesis();
 
54
        
 
55
        /**
 
56
         * Get whether or not to do colon detection.
 
57
         * @return true iff colon detection is turned on
 
58
         */
 
59
        public boolean getAutoColon();
 
60
        
 
61
        /**
 
62
         * Get whether or not to auto-skip braces insertion  
 
63
         * @return iff auto-skip braces is ENABLED
 
64
         */
 
65
        public boolean getAutoBraces();
 
66
        
 
67
        /**
 
68
         * Get whether we should auto-write 'import' if we are in a from xxx import fff
 
69
         */
 
70
        public boolean getAutoWriteImport();
 
71
        
 
72
        /**
 
73
         * Get whether we should smart-indent after a '('
 
74
         */
 
75
        public boolean getSmartIndentPar();
 
76
        
 
77
        /**
 
78
         * Get whether we should add 'self' automatically when declaring method
 
79
         */
 
80
        public boolean getAutoAddSelf();
 
81
 
 
82
    /**
 
83
     * Get whether we should auto-dedent 'else:'
 
84
     */
 
85
    public boolean getAutoDedentElse();
 
86
    
 
87
    /**
 
88
     * @return whether we should indent to a parenthesis level on auto-indent or only add 1 tab to the indent).
 
89
     */
 
90
    public boolean getIndentToParLevel();
 
91
 
 
92
    /**
 
93
     * Should be called to regenerate the indent string that's in the cache.
 
94
     */
 
95
        public void regenerateIndentString();
 
96
}