Changeset 349

Show
Ignore:
Timestamp:
09/14/08 05:52:40 (4 months ago)
Author:
sergey.kol..@gmail.com
Message:

Sergey Kolos:

  • Working on #50: Autoedit - added help label and property listener - now adding or removing autoedits immidiately applied to all lisp editors.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jasko.tim.lisp/src/jasko/tim/lisp/editors/autoedits/CustomAutoEdit.java

    r274 r349  
    33import java.util.HashMap; 
    44 
     5import jasko.tim.lisp.LispPlugin; 
    56import jasko.tim.lisp.editors.LispPartitionScanner; 
     7import jasko.tim.lisp.preferences.PreferenceConstants; 
    68import jasko.tim.lisp.preferences.PreferenceInitializer; 
    79import org.eclipse.jface.text.BadLocationException; 
     
    911import org.eclipse.jface.text.IAutoEditStrategy; 
    1012import org.eclipse.jface.text.IDocument; 
     13import org.eclipse.jface.util.IPropertyChangeListener; 
     14import org.eclipse.jface.util.PropertyChangeEvent; 
    1115 
    1216/* autoedit snippets, like (let) (progn) etc */ 
     
    145149        public CustomAutoEdit(){ 
    146150                initAutoEditTree(); 
     151                //FIXME: also need to properly dispose listener 
     152                LispPlugin.getDefault().getPreferenceStore() 
     153                 .addPropertyChangeListener(new IPropertyChangeListener(){ 
     154                        public void propertyChange(PropertyChangeEvent event) { 
     155                                if(event.getProperty().equals(PreferenceConstants.CUSTOM_AUTO_EDITS)){ 
     156                                        initAutoEditTree(); 
     157                                } 
     158                        } 
     159                 }); 
    147160        } 
    148161         
  • jasko.tim.lisp/src/jasko/tim/lisp/preferences/AutoEditsPreferencePage.java

    r268 r349  
    8585                data.horizontalSpan = 2; 
    8686                removeButton.setLayoutData(data); 
    87          
     87 
     88                Label helpLbl = new Label(entryTable, SWT.BORDER); 
     89                helpLbl.setText("AutoEdits allows automatic substituion as you type.\n" + 
     90                                "They consist of two parts: trigger and substitution.\n" + 
     91                                "In an AutoEdit specification these parts are seperated by ';'.\n" + 
     92                                "Position of the caret after substitution is specified by '|'.\n" + 
     93                                "\n" + 
     94                                "Example: 'let ;let ((|))'. When you type 'let ' you'll get\n" + 
     95                                "'let (())' with caret placed inside inner brackers.\n" + 
     96                                "\n" + 
     97                                "Note: AutoEdits work only in lisp code and are not triggered\n" + 
     98                                "in comments or strings."); 
     99                data = new GridData(GridData.FILL_BOTH); 
     100                helpLbl.setLayoutData(data); 
     101                 
     102                 
    88103                return entryTable; 
    89104        }