Changeset 351

Show
Ignore:
Timestamp:
09/14/08 10:41:50 (4 months ago)
Author:
sergey.kol..@gmail.com
Message:

Sergey Kolos:

  • Done #50. Cleaned up preferences.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/plugin.xml

    r345 r351  
    15581558    <page 
    15591559          category="jasko.tim.lisp.preferences.EditorPreferencePage" 
    1560           class="jasko.tim.lisp.preferences.REPLPreferencePage" 
    1561           id="jasko.tim.lisp.preferences.REPLPreferencePage" 
    1562           name="REPL"/> 
    1563     <page 
    1564           category="jasko.tim.lisp.preferences.EditorPreferencePage" 
    15651560          class="jasko.tim.lisp.preferences.ColorsPreferencePage" 
    15661561          id="jasko.tim.lisp.preferences.ColorsPreferencePage" 
     
    15711566          id="jasko.tim.lisp.preferences.AutoEditsPreferencePage" 
    15721567          name="Auto Edits"/> 
     1568    <page 
     1569          category="jasko.tim.lisp.preferences.CuspPreferencePage" 
     1570          class="jasko.tim.lisp.preferences.REPLPreferencePage" 
     1571          id="jasko.tim.lisp.preferences.REPLPreferencePage" 
     1572          name="REPL"/> 
    15731573    <page 
    15741574          category="jasko.tim.lisp.preferences.CuspPreferencePage" 
  • jasko.tim.lisp/src/jasko/tim/lisp/editors/LispConfiguration.java

    r350 r351  
    5252        private final IPropertyChangeListener prefsListener = new IPropertyChangeListener () { 
    5353        public void propertyChange (PropertyChangeEvent event) { 
     54                IPreferenceStore ps = LispPlugin.getDefault().getPreferenceStore(); 
    5455            String prop = event.getProperty(); 
    5556            if (prop.equals(PreferenceConstants.AUTO_POPUP_COMPLETIONS)) { 
     
    5758            } else if (prop.equals(PreferenceConstants.AUTO_INSERT_COMPLETIONS)) { 
    5859                ca.enableAutoInsert((Boolean)event.getNewValue()); 
     60            } else if (prop.equals(PreferenceConstants.AUTO_POPUP_COMPLETIONS_DELAY)){ 
     61                ca.setAutoActivationDelay(ps.getInt(PreferenceConstants.AUTO_POPUP_COMPLETIONS_DELAY)); 
     62            } else if (prop.equals(PreferenceConstants.ARGLIST_BELOW)){ 
     63                        if( ps.getBoolean(PreferenceConstants.ARGLIST_BELOW)){ 
     64                                ca.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_BELOW); 
     65                        } else { 
     66                                ca.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_ABOVE);                   
     67                        } 
    5968            } 
    6069        } 
  • jasko.tim.lisp/src/jasko/tim/lisp/editors/autoedits/PairAutoEdit.java

    r310 r351  
    2525                try{ 
    2626                        IPreferenceStore prefs = LispPlugin.getDefault().getPreferenceStore(); 
    27                         boolean pairBrackets = prefs.getBoolean(PreferenceConstants.PAIR_EDIT_BRACKETS); 
     27                        boolean pairBrackets = prefs.getBoolean(PreferenceConstants.PAIR_SMART_BRACKETS); 
     28                        //prefs.getBoolean(PreferenceConstants.PAIR_EDIT_BRACKETS); 
    2829                        String contentType = d.getContentType(c.offset); 
    2930                        if(contentType != LispPartitionScanner.LISP_STRING  
  • jasko.tim.lisp/src/jasko/tim/lisp/preferences/ColorsPreferencePage.java

    r350 r351  
    9595                setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 
    9696                setDescription("Set colors and styles for Lisp code formatting.\n" + 
    97                 "To see changes - close and reopen a lisp editor."); 
     97                "To see changes - close and reopen a lisp editor.\n" + 
     98                "For lisp expression highlighting see prefernce page:\n" + 
     99                "Preferences->General->Editors->Text Editors->Annotations\n" + 
     100                "(Current Lisp Expression and Outer Lisp Expression)"); 
    98101        } 
    99102         
  • jasko.tim.lisp/src/jasko/tim/lisp/preferences/EditorPreferencePage.java

    r95 r351  
    22 
    33import org.eclipse.jface.preference.*; 
     4import org.eclipse.swt.SWT; 
     5import org.eclipse.swt.events.SelectionAdapter; 
     6import org.eclipse.swt.events.SelectionEvent; 
     7import org.eclipse.swt.layout.GridData; 
     8import org.eclipse.swt.layout.GridLayout; 
     9import org.eclipse.swt.widgets.Button; 
     10import org.eclipse.swt.widgets.Composite; 
     11import org.eclipse.swt.widgets.Control; 
     12import org.eclipse.swt.widgets.Label; 
    413import org.eclipse.ui.IWorkbenchPreferencePage; 
    514import org.eclipse.ui.IWorkbench; 
     
    2433        implements IWorkbenchPreferencePage { 
    2534 
     35    private Composite autoPopupIndent; 
     36         
    2637        public EditorPreferencePage() { 
    2738                super(GRID); 
    28                 setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 
    29                 setDescription("The editing environment (colors, autocomplete, etc.)."); 
    3039        } 
    3140         
     
    3746         */ 
    3847        public void createFieldEditors() { 
    39         addField(new BooleanFieldEditor( 
     48                Composite parent = getFieldEditorParent(); 
     49                 
     50        /*addField(new BooleanFieldEditor( 
    4051                PreferenceConstants.PAIR_EDIT_BRACKETS, 
    4152                "Automatically close '('", 
    42                 getFieldEditorParent())); 
     53                getFieldEditorParent())); */ 
    4354     
    4455        addField(new BooleanFieldEditor( 
    4556                PreferenceConstants.PAIR_SMART_BRACKETS, 
    46                 "If automatically close '('.\nIf next is complete sexp, put closing ')' after it", 
    47                 getFieldEditorParent())); 
     57                "Automatically close '(', enclosing next sexp in '()'", 
     58                parent)); 
    4859     
    4960        addField(new BooleanFieldEditor( 
    5061                PreferenceConstants.PAIR_EDIT_BRACES, 
    51                 "If complete sexp starts at next position, pressing '[' encloses it in '()'", 
    52                 getFieldEditorParent())); 
     62                "'[' encloses next sexp it in '()'", 
     63                parent)); 
    5364     
    5465        addField(new BooleanFieldEditor( 
    5566                PreferenceConstants.PAIR_EDIT_QUOTES, 
    56                 "Automatically close '\"'", 
    57                 getFieldEditorParent())); 
     67                "Automatically close double quotes", 
     68                parent)); 
    5869     
    5970        addField(new BooleanFieldEditor( 
    6071                PreferenceConstants.PAIR_EDIT_COMMENTS, 
    6172                "Automatically close '#|'", 
    62                 getFieldEditorParent())); 
     73                parent)); 
    6374     
    6475        addField(new BooleanFieldEditor( 
    6576                    PreferenceConstants.AUTO_POPUP_COMPLETIONS, 
    66                     "Automatically show content completions and parameter hints", 
    67                     getFieldEditorParent())); 
    68          
     77                    "Automatically show popup with content completions or parameter hints", 
     78                    parent){ 
     79            private boolean installedListener = false; 
     80            protected Button getChangeControl (Composite parent) { 
     81                // not sure how else to get a listener installed on the actual checkbox... 
     82                final Button b = super.getChangeControl(parent); 
     83                if (!installedListener) b.addSelectionListener(new SelectionAdapter () { 
     84                    public void widgetSelected (SelectionEvent e) { 
     85                        for (Control c : autoPopupIndent.getChildren()) { 
     86                            c.setEnabled(b.getSelection()); 
     87                        } 
     88                    } 
     89                }); 
     90                return b; 
     91            }            
     92        }); 
     93 
     94        autoPopupIndent = new Composite(parent, SWT.NONE); 
     95        autoPopupIndent.setLayout(new GridLayout(2, false)); 
    6996        addField(new StringFieldEditor( 
    7097                PreferenceConstants.AUTO_POPUP_COMPLETIONS_DELAY, 
    71                 "Delay before completions are shown and quick doc updated \n(requires Eclipse restart):", 
    72                 getFieldEditorParent())); 
    73         //TODO: actually should listen for change in this variable and perform operation similar to 
    74         // LispConfiguration.java:              ca.setAutoActivationDelay(ps.getInt(PreferenceConstants.AUTO_POPUP_COMPLETIONS_DELAY)); 
    75  
     98                "Delay before popup is shown (ms):", 
     99                autoPopupIndent)); 
     100         
     101        for (Control c : autoPopupIndent.getChildren()) { 
     102            GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1); 
     103            gd.horizontalIndent = 25; 
     104            c.setLayoutData(gd); 
     105        } 
     106        new Label(parent,SWT.NONE); 
    76107         
    77108        addField(new StringFieldEditor( 
    78109                PreferenceConstants.MAX_HINT_LINES, 
    79110                "Maximum number of lines in documentation hints:", 
    80                 getFieldEditorParent())); 
     111                parent)); 
    81112 
    82113        addField(new BooleanFieldEditor( 
    83114                PreferenceConstants.ARGLIST_BELOW, 
    84                 "Show documentation hints below cursor. (Requires restart)", 
    85                 getFieldEditorParent())); 
     115                "Show documentation hints below cursor.", 
     116                parent)); 
    86117         
    87118        addField(new BooleanFieldEditor( 
    88119                PreferenceConstants.AUTO_INSERT_COMPLETIONS, 
    89                 "Automatically insert single content completion option", 
    90                 getFieldEditorParent())); 
     120                "Automatically insert single content completion", 
     121                parent)); 
    91122 
    92123                addField(new StringFieldEditor(PreferenceConstants.AUTO_COMPLETIONS_NLIMIT,  
    93                                 "Max size of completion list. 0 or empty if no limit:", getFieldEditorParent()) ); 
     124                                "Max size of completion list (0 for no limit):", 
     125                                parent)); 
    94126 
    95127        addField(new BooleanFieldEditor( 
    96128                PreferenceConstants.AUTO_FUZZY_COMPLETIONS, 
    97129                "Use fuzzy mode for autocompletions", 
    98                 getFieldEditorParent())); 
     130                parent)); 
    99131 
    100132        addField(new BooleanFieldEditor( 
    101133                PreferenceConstants.DOCS_IN_COMPLETIONS, 
    102134                "Show quick documentation with auto completions list", 
    103                 getFieldEditorParent())); 
     135                parent)); 
    104136        } 
    105137 
     
    108140         */ 
    109141        public void init(IWorkbench workbench) { 
     142                setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 
     143                setDescription("The editing environment (colors, autocomplete, etc.)."); 
    110144        } 
    111145         
  • jasko.tim.lisp/src/jasko/tim/lisp/preferences/ImplementationsPreferencePage.java

    r258 r351  
    22 
    33import org.eclipse.jface.preference.*; 
     4import org.eclipse.swt.SWT; 
     5import org.eclipse.swt.events.SelectionAdapter; 
     6import org.eclipse.swt.events.SelectionEvent; 
     7import org.eclipse.swt.layout.GridData; 
     8import org.eclipse.swt.layout.GridLayout; 
     9import org.eclipse.swt.widgets.Button; 
     10import org.eclipse.swt.widgets.Composite; 
     11import org.eclipse.swt.widgets.Control; 
     12import org.eclipse.swt.widgets.Label; 
    413import org.eclipse.ui.IWorkbenchPreferencePage; 
    514import org.eclipse.ui.IWorkbench; 
     
    2029 */ 
    2130 
    22 public class ImplementationsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { 
     31public class ImplementationsPreferencePage extends FieldEditorPreferencePage 
     32        implements IWorkbenchPreferencePage { 
    2333 
     34    private Composite libManagerIndent; 
     35         
    2436        public ImplementationsPreferencePage() { 
    2537                super(GRID); 
    26                 setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 
    27                 setDescription("Add/remove installed Lisp implementations."); 
    2838        } 
    2939         
     
    3646         */ 
    3747        public void createFieldEditors() { 
    38                 addField( 
    39                                 new BooleanFieldEditor( 
     48                Composite parent = getFieldEditorParent(); 
     49                 
     50                addField(new BooleanFieldEditor( 
    4051                                        PreferenceConstants.USE_SITEWIDE_LISP, 
    4152                                        "Use a lisp &sitewide installation (executable is on the path)", 
    42                                         getFieldEditorParent())); 
     53                                        parent)); 
    4354 
    4455                addField(new FileFieldEditor(PreferenceConstants.LISP_EXE,  
    45                                 "&Lisp Executable:", getFieldEditorParent())); 
     56                                "&Lisp Executable:", parent)); 
    4657 
    4758                addField(new FileFieldEditor(PreferenceConstants.LISP_INI,  
    48                                 "&Initialization File:", getFieldEditorParent())); 
     59                                "&Initialization File:", parent)); 
    4960 
    5061 
     62                RadioGroupFieldEditor compilations = new RadioGroupFieldEditor(PreferenceConstants.BUILD_TYPE, "How to handle compilation:", 1,  
     63                                new String[][] { 
     64                                  { "Compile on Save (recommented)", PreferenceConstants.USE_AUTO_BUILD }, 
     65                                  { "Eclipse Autobuild (not recommended)",  
     66                                          PreferenceConstants.USE_ECLIPSE_BUILD }, 
     67                                  { "Slime Style Build", PreferenceConstants.USE_SLIME_BUILD }  
     68                                },parent); 
     69                compilations.getRadioBoxControl(parent) 
     70                        .setToolTipText("- Comile on save: compiles only expressions changed by recent edits.\n" + 
     71                                        "- Eclipse Autobuild: recompiles whole file on save.\n" + 
     72                                        "- Slime Style Build: manually select which expressions to compile."); 
     73                 
     74                addField(compilations); 
     75 
     76                addField(new BooleanFieldEditor(PreferenceConstants.MANAGE_PACKAGES,  
     77                                "Use Cusp to manage libraries (requires Lisp restart)", parent){ 
     78            private boolean installedListener = false; 
     79            protected Button getChangeControl (Composite parent) { 
     80                // not sure how else to get a listener installed on the actual checkbox... 
     81                final Button b = super.getChangeControl(parent); 
     82                if (!installedListener) b.addSelectionListener(new SelectionAdapter () { 
     83                    public void widgetSelected (SelectionEvent e) { 
     84                        for (Control c : libManagerIndent.getChildren()) { 
     85                            c.setEnabled(b.getSelection()); 
     86                        } 
     87                    } 
     88                }); 
     89                return b; 
     90            }            
     91                }); 
     92 
     93                libManagerIndent = new Composite(parent, SWT.NONE); 
     94                libManagerIndent.setLayout(new GridLayout(2, false)); 
    5195                StringFieldEditor strf = new StringFieldEditor(PreferenceConstants.SYSTEMS_PATH,  
    52                                 "Path to system definitions:", getFieldEditorParent()); 
    53                 String strfTipString = "Top levels. Package manager will search subdirectories.\n Separate directories by ;\n Requires Lisp restart"; 
    54                 strf.getLabelControl(getFieldEditorParent()).setToolTipText(strfTipString); 
    55                 strf.getTextControl(getFieldEditorParent()).setToolTipText(strfTipString);               
     96                                "Path to libraries:", libManagerIndent); 
     97                String strfTipString = "Top levels. Cusp's library manager will search subdirectories.\n" + 
     98                                "Separate directories by ;\nNote: Requires Lisp restart"; 
     99                strf.getLabelControl(libManagerIndent).setToolTipText(strfTipString); 
     100                strf.getTextControl(libManagerIndent).setToolTipText(strfTipString);             
    56101                addField(strf); 
    57102                 
    58                 addField(new RadioGroupFieldEditor(PreferenceConstants.BUILD_TYPE, "How to handle compilation:", 1,  
    59                                 new String[][] { 
    60                                   { "Compile on Save", PreferenceConstants.USE_AUTO_BUILD }, 
    61                                   { "Use Eclipse Autobuild Feature", PreferenceConstants.USE_ECLIPSE_BUILD }, 
    62                                   { "Use only Slime Style Build", PreferenceConstants.USE_SLIME_BUILD }  
    63                                 }, getFieldEditorParent())); 
     103        addField(strf); 
     104         
     105        for (Control c : libManagerIndent.getChildren()) { 
     106            GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1); 
     107            gd.horizontalIndent = 25; 
     108            c.setLayoutData(gd); 
     109        } 
     110        new Label(parent,SWT.NONE); 
     111 
    64112                 
    65                 addField(new BooleanFieldEditor(PreferenceConstants.MANAGE_PACKAGES,  
    66                                 "Use Cusp to Manage Packages (requires Lisp restart)", getFieldEditorParent())); 
    67  
    68113                addField(new BooleanFieldEditor(PreferenceConstants.USE_UNIT_TEST,  
    69                                 "Use LispUnit integrated with Cusp (requires Lisp restart)", getFieldEditorParent())); 
     114                                "Use LispUnit integrated with Cusp (requires Lisp restart)",  
     115                                parent)); 
    70116 
    71117                addField(new BooleanFieldEditor(PreferenceConstants.CONSOLE_COMPILER_LOG,  
    72                                 "Write compiler log to Console", getFieldEditorParent())); 
     118                                "Write compiler log to Console", parent)); 
    73119        } 
    74120 
     
    77123         */ 
    78124        public void init(IWorkbench workbench) { 
     125                setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 
     126                setDescription("Setup local Lisp implementation."); 
    79127        } 
    80128 
  • jasko.tim.lisp/src/jasko/tim/lisp/preferences/REPLPreferencePage.java

    r252 r351  
    1818    public REPLPreferencePage () { 
    1919        super(GRID); 
    20         setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 
    21         setDescription("REPL Interaction and Formatting Options"); 
    2220    } 
    2321 
     
    3129        final Composite parent = getFieldEditorParent(); 
    3230         
    33  
    3431        addField(new BooleanFieldEditor(PreferenceConstants.USE_CTRL_ENTER, 
    35                         "Expression in Repl is sent for eval when Ctrl+Enter is pressed.\nUse it when autobalancing () is on.",  
     32                        "Eval on Ctrl+Enter. Use it when 'Automatically close (' is on.",  
    3633                        parent)); 
    3734 
     
    4037 
    4138        addField(new BooleanFieldEditor(PreferenceConstants.DEBUG_HIDE_SWANK_FRAMES, 
    42                         "Hide swank frames in backtraces, when debugger is active",  
     39                        "Clean up backtraces in debugger: don't show swank frames.",  
    4340                        parent)); 
    4441 
     
    4643                PreferenceConstants.REPL_FONT_SIZE, 
    4744                "REPL font size (Requires restart):", 
    48                 getFieldEditorParent())); 
     45                parent)); 
    4946 
     47        addField(new org.eclipse.jface.preference.ColorFieldEditor( 
     48                PreferenceConstants.REPL_INPUT_FG_COLOR, 
     49                "Foreground text color for user input in REPL history: ", 
     50                parent)); 
     51 
     52        addField(new org.eclipse.jface.preference.ColorFieldEditor( 
     53                PreferenceConstants.REPL_INPUT_BG_COLOR, 
     54                "Background text color for user input in REPL history: ", 
     55                parent));         
     56         
    5057        addField(new BooleanFieldEditor( 
    5158                    PreferenceConstants.DECORATE_REPL_INSPECTABLES, 
     
    6774        }); 
    6875 
    69         addField(new org.eclipse.jface.preference.ColorFieldEditor( 
    70                 PreferenceConstants.REPL_INPUT_FG_COLOR, 
    71                 "Foreground text color for user input in REPL history: ", 
    72                 getFieldEditorParent())); 
    73  
    74         addField(new org.eclipse.jface.preference.ColorFieldEditor( 
    75                 PreferenceConstants.REPL_INPUT_BG_COLOR, 
    76                 "Background text color for user input in REPL history: ", 
    77                 getFieldEditorParent()));         
    78          
    7976        indent = new Composite(parent, 0); 
    8077        indent.setLayout(new GridLayout(2, false)); 
     
    105102     */ 
    106103    public void init(IWorkbench workbench) { 
     104        setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 
     105        setDescription("REPL Interaction and Formatting Options"); 
    107106    } 
    108107