Changeset 351
- Timestamp:
- 09/14/08 10:41:50 (4 months ago)
- Files:
-
- jasko.tim.lisp/plugin.xml (modified) (2 diffs)
- jasko.tim.lisp/src/jasko/tim/lisp/editors/LispConfiguration.java (modified) (2 diffs)
- jasko.tim.lisp/src/jasko/tim/lisp/editors/autoedits/PairAutoEdit.java (modified) (1 diff)
- jasko.tim.lisp/src/jasko/tim/lisp/preferences/ColorsPreferencePage.java (modified) (1 diff)
- jasko.tim.lisp/src/jasko/tim/lisp/preferences/EditorPreferencePage.java (modified) (4 diffs)
- jasko.tim.lisp/src/jasko/tim/lisp/preferences/ImplementationsPreferencePage.java (modified) (4 diffs)
- jasko.tim.lisp/src/jasko/tim/lisp/preferences/REPLPreferencePage.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
jasko.tim.lisp/plugin.xml
r345 r351 1558 1558 <page 1559 1559 category="jasko.tim.lisp.preferences.EditorPreferencePage" 1560 class="jasko.tim.lisp.preferences.REPLPreferencePage"1561 id="jasko.tim.lisp.preferences.REPLPreferencePage"1562 name="REPL"/>1563 <page1564 category="jasko.tim.lisp.preferences.EditorPreferencePage"1565 1560 class="jasko.tim.lisp.preferences.ColorsPreferencePage" 1566 1561 id="jasko.tim.lisp.preferences.ColorsPreferencePage" … … 1571 1566 id="jasko.tim.lisp.preferences.AutoEditsPreferencePage" 1572 1567 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"/> 1573 1573 <page 1574 1574 category="jasko.tim.lisp.preferences.CuspPreferencePage" jasko.tim.lisp/src/jasko/tim/lisp/editors/LispConfiguration.java
r350 r351 52 52 private final IPropertyChangeListener prefsListener = new IPropertyChangeListener () { 53 53 public void propertyChange (PropertyChangeEvent event) { 54 IPreferenceStore ps = LispPlugin.getDefault().getPreferenceStore(); 54 55 String prop = event.getProperty(); 55 56 if (prop.equals(PreferenceConstants.AUTO_POPUP_COMPLETIONS)) { … … 57 58 } else if (prop.equals(PreferenceConstants.AUTO_INSERT_COMPLETIONS)) { 58 59 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 } 59 68 } 60 69 } jasko.tim.lisp/src/jasko/tim/lisp/editors/autoedits/PairAutoEdit.java
r310 r351 25 25 try{ 26 26 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); 28 29 String contentType = d.getContentType(c.offset); 29 30 if(contentType != LispPartitionScanner.LISP_STRING jasko.tim.lisp/src/jasko/tim/lisp/preferences/ColorsPreferencePage.java
r350 r351 95 95 setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 96 96 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)"); 98 101 } 99 102 jasko.tim.lisp/src/jasko/tim/lisp/preferences/EditorPreferencePage.java
r95 r351 2 2 3 3 import org.eclipse.jface.preference.*; 4 import org.eclipse.swt.SWT; 5 import org.eclipse.swt.events.SelectionAdapter; 6 import org.eclipse.swt.events.SelectionEvent; 7 import org.eclipse.swt.layout.GridData; 8 import org.eclipse.swt.layout.GridLayout; 9 import org.eclipse.swt.widgets.Button; 10 import org.eclipse.swt.widgets.Composite; 11 import org.eclipse.swt.widgets.Control; 12 import org.eclipse.swt.widgets.Label; 4 13 import org.eclipse.ui.IWorkbenchPreferencePage; 5 14 import org.eclipse.ui.IWorkbench; … … 24 33 implements IWorkbenchPreferencePage { 25 34 35 private Composite autoPopupIndent; 36 26 37 public EditorPreferencePage() { 27 38 super(GRID); 28 setPreferenceStore(LispPlugin.getDefault().getPreferenceStore());29 setDescription("The editing environment (colors, autocomplete, etc.).");30 39 } 31 40 … … 37 46 */ 38 47 public void createFieldEditors() { 39 addField(new BooleanFieldEditor( 48 Composite parent = getFieldEditorParent(); 49 50 /*addField(new BooleanFieldEditor( 40 51 PreferenceConstants.PAIR_EDIT_BRACKETS, 41 52 "Automatically close '('", 42 getFieldEditorParent())); 53 getFieldEditorParent())); */ 43 54 44 55 addField(new BooleanFieldEditor( 45 56 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)); 48 59 49 60 addField(new BooleanFieldEditor( 50 61 PreferenceConstants.PAIR_EDIT_BRACES, 51 " If complete sexp starts at next position, pressing '[' enclosesit in '()'",52 getFieldEditorParent()));62 "'[' encloses next sexp it in '()'", 63 parent)); 53 64 54 65 addField(new BooleanFieldEditor( 55 66 PreferenceConstants.PAIR_EDIT_QUOTES, 56 "Automatically close '\"'",57 getFieldEditorParent()));67 "Automatically close double quotes", 68 parent)); 58 69 59 70 addField(new BooleanFieldEditor( 60 71 PreferenceConstants.PAIR_EDIT_COMMENTS, 61 72 "Automatically close '#|'", 62 getFieldEditorParent()));73 parent)); 63 74 64 75 addField(new BooleanFieldEditor( 65 76 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)); 69 96 addField(new StringFieldEditor( 70 97 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); 76 107 77 108 addField(new StringFieldEditor( 78 109 PreferenceConstants.MAX_HINT_LINES, 79 110 "Maximum number of lines in documentation hints:", 80 getFieldEditorParent()));111 parent)); 81 112 82 113 addField(new BooleanFieldEditor( 83 114 PreferenceConstants.ARGLIST_BELOW, 84 "Show documentation hints below cursor. (Requires restart)",85 getFieldEditorParent()));115 "Show documentation hints below cursor.", 116 parent)); 86 117 87 118 addField(new BooleanFieldEditor( 88 119 PreferenceConstants.AUTO_INSERT_COMPLETIONS, 89 "Automatically insert single content completion option",90 getFieldEditorParent()));120 "Automatically insert single content completion", 121 parent)); 91 122 92 123 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)); 94 126 95 127 addField(new BooleanFieldEditor( 96 128 PreferenceConstants.AUTO_FUZZY_COMPLETIONS, 97 129 "Use fuzzy mode for autocompletions", 98 getFieldEditorParent()));130 parent)); 99 131 100 132 addField(new BooleanFieldEditor( 101 133 PreferenceConstants.DOCS_IN_COMPLETIONS, 102 134 "Show quick documentation with auto completions list", 103 getFieldEditorParent()));135 parent)); 104 136 } 105 137 … … 108 140 */ 109 141 public void init(IWorkbench workbench) { 142 setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 143 setDescription("The editing environment (colors, autocomplete, etc.)."); 110 144 } 111 145 jasko.tim.lisp/src/jasko/tim/lisp/preferences/ImplementationsPreferencePage.java
r258 r351 2 2 3 3 import org.eclipse.jface.preference.*; 4 import org.eclipse.swt.SWT; 5 import org.eclipse.swt.events.SelectionAdapter; 6 import org.eclipse.swt.events.SelectionEvent; 7 import org.eclipse.swt.layout.GridData; 8 import org.eclipse.swt.layout.GridLayout; 9 import org.eclipse.swt.widgets.Button; 10 import org.eclipse.swt.widgets.Composite; 11 import org.eclipse.swt.widgets.Control; 12 import org.eclipse.swt.widgets.Label; 4 13 import org.eclipse.ui.IWorkbenchPreferencePage; 5 14 import org.eclipse.ui.IWorkbench; … … 20 29 */ 21 30 22 public class ImplementationsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { 31 public class ImplementationsPreferencePage extends FieldEditorPreferencePage 32 implements IWorkbenchPreferencePage { 23 33 34 private Composite libManagerIndent; 35 24 36 public ImplementationsPreferencePage() { 25 37 super(GRID); 26 setPreferenceStore(LispPlugin.getDefault().getPreferenceStore());27 setDescription("Add/remove installed Lisp implementations.");28 38 } 29 39 … … 36 46 */ 37 47 public void createFieldEditors() { 38 addField( 39 new BooleanFieldEditor( 48 Composite parent = getFieldEditorParent(); 49 50 addField(new BooleanFieldEditor( 40 51 PreferenceConstants.USE_SITEWIDE_LISP, 41 52 "Use a lisp &sitewide installation (executable is on the path)", 42 getFieldEditorParent()));53 parent)); 43 54 44 55 addField(new FileFieldEditor(PreferenceConstants.LISP_EXE, 45 "&Lisp Executable:", getFieldEditorParent()));56 "&Lisp Executable:", parent)); 46 57 47 58 addField(new FileFieldEditor(PreferenceConstants.LISP_INI, 48 "&Initialization File:", getFieldEditorParent()));59 "&Initialization File:", parent)); 49 60 50 61 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)); 51 95 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); 56 101 addField(strf); 57 102 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 64 112 65 addField(new BooleanFieldEditor(PreferenceConstants.MANAGE_PACKAGES,66 "Use Cusp to Manage Packages (requires Lisp restart)", getFieldEditorParent()));67 68 113 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)); 70 116 71 117 addField(new BooleanFieldEditor(PreferenceConstants.CONSOLE_COMPILER_LOG, 72 "Write compiler log to Console", getFieldEditorParent()));118 "Write compiler log to Console", parent)); 73 119 } 74 120 … … 77 123 */ 78 124 public void init(IWorkbench workbench) { 125 setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 126 setDescription("Setup local Lisp implementation."); 79 127 } 80 128 jasko.tim.lisp/src/jasko/tim/lisp/preferences/REPLPreferencePage.java
r252 r351 18 18 public REPLPreferencePage () { 19 19 super(GRID); 20 setPreferenceStore(LispPlugin.getDefault().getPreferenceStore());21 setDescription("REPL Interaction and Formatting Options");22 20 } 23 21 … … 31 29 final Composite parent = getFieldEditorParent(); 32 30 33 34 31 addField(new BooleanFieldEditor(PreferenceConstants.USE_CTRL_ENTER, 35 "E xpression 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.", 36 33 parent)); 37 34 … … 40 37 41 38 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.", 43 40 parent)); 44 41 … … 46 43 PreferenceConstants.REPL_FONT_SIZE, 47 44 "REPL font size (Requires restart):", 48 getFieldEditorParent()));45 parent)); 49 46 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 50 57 addField(new BooleanFieldEditor( 51 58 PreferenceConstants.DECORATE_REPL_INSPECTABLES, … … 67 74 }); 68 75 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 79 76 indent = new Composite(parent, 0); 80 77 indent.setLayout(new GridLayout(2, false)); … … 105 102 */ 106 103 public void init(IWorkbench workbench) { 104 setPreferenceStore(LispPlugin.getDefault().getPreferenceStore()); 105 setDescription("REPL Interaction and Formatting Options"); 107 106 } 108 107
