Changeset 3d0622cd77233477dd222f1c00c4f35afeb67815
- Timestamp:
- 06/28/09 23:36:50 (14 months ago)
- Children:
- 49cbb509af4876ed4a2ccd7942c17372373a5ae2
- Parents:
- 80657c560c55a46e8bdb3bcc2aef994a475d2511
- git-author:
- mb0 <mb0@…> (06/10/09 03:01:59)
- git-committer:
- mb0 <mb0@…> (06/28/09 23:36:50)
- Location:
- org.axdt.as3
- Files:
-
- 2 added
- 7 modified
-
plugin.xml (modified) (2 diffs)
-
src/org/axdt/as3/imp/autoEdit/AS3AutoEditStrategy.java (modified) (2 diffs)
-
src/org/axdt/as3/imp/builders/AS3Builder.java (modified) (5 diffs)
-
src/org/axdt/as3/imp/foldingUpdater/AS3FoldingUpdater.java (modified) (3 diffs)
-
src/org/axdt/as3/imp/services/AS3EditorService.java (added)
-
src/org/axdt/as3/preferences/AS3EditorPreferencePage.java (modified) (1 diff)
-
src/org/axdt/as3/preferences/AS3EditorPreferences.java (added)
-
src/org/axdt/as3/preferences/AS3Preferences.java (modified) (2 diffs)
-
src/org/axdt/as3/templates/AS3TemplateContext.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
org.axdt.as3/plugin.xml
r69d1ca8 r3d0622c 65 65 language="AS3"> 66 66 </proposer> 67 </extension> 68 <extension 69 point="org.eclipse.imp.runtime.editorService"> 70 <editorService 71 class="org.axdt.as3.imp.services.AS3EditorService" 72 language="AS3"> 73 </editorService> 67 74 </extension> 68 75 <extension … … 240 247 class="org.axdt.as3.preferences.AS3Preferences"> 241 248 </initializer> 249 <initializer 250 class="org.axdt.as3.preferences.AS3EditorPreferences"> 251 </initializer> 242 252 </extension> 243 253 <extension -
org.axdt.as3/src/org/axdt/as3/imp/autoEdit/AS3AutoEditStrategy.java
r79b60b9 r3d0622c 2 2 3 3 import org.axdt.as3.AS3Plugin; 4 import org.axdt.as3.preferences.AS3 Preferences;4 import org.axdt.as3.preferences.AS3EditorPreferences; 5 5 import org.axdt.util.AxdtTextHelper; 6 6 import org.eclipse.imp.services.IAutoEditStrategy; … … 25 25 26 26 public AS3AutoEditStrategy() { 27 IPreferenceStore store = AS3 Preferences.getInstance().getStore();28 ftab2Space = store.getBoolean(AS3 Preferences.TAB_TO_SPACE);29 fTabRatio = store.getInt(AS3 Preferences.TAB_WIDTH);30 fCloseString = store.getBoolean(AS3 Preferences.CLOSE_STRINGS);31 fCloseBrackets = store.getBoolean(AS3 Preferences.CLOSE_BRACKETS);32 fCloseBraces = store.getBoolean(AS3 Preferences.CLOSE_BRACES);33 fDeletePair = store.getBoolean(AS3 Preferences.DELETE_PAIR);27 IPreferenceStore store = AS3EditorPreferences.getInstance().getStore(); 28 ftab2Space = store.getBoolean(AS3EditorPreferences.TAB_TO_SPACE); 29 fTabRatio = store.getInt(AS3EditorPreferences.TAB_WIDTH); 30 fCloseString = store.getBoolean(AS3EditorPreferences.CLOSE_STRINGS); 31 fCloseBrackets = store.getBoolean(AS3EditorPreferences.CLOSE_BRACKETS); 32 fCloseBraces = store.getBoolean(AS3EditorPreferences.CLOSE_BRACES); 33 fDeletePair = store.getBoolean(AS3EditorPreferences.DELETE_PAIR); 34 34 } 35 35 -
org.axdt.as3/src/org/axdt/as3/imp/builders/AS3Builder.java
r69d1ca8 r3d0622c 5 5 import org.axdt.as3.AS3Plugin; 6 6 import org.axdt.as3.imp.parser.AS3ParseController; 7 import org.axdt.as3.imp.services.AS3EditorService; 7 8 import org.axdt.as3.preferences.AS3Preferences; 8 9 import org.axdt.as3.util.AS3Util; … … 22 23 import org.eclipse.imp.model.ModelFactory.ModelException; 23 24 import org.eclipse.imp.runtime.PluginBase; 24 import org.eclipse.jface.preference.IPreferenceStore;25 25 26 26 /** … … 66 66 protected boolean isSourceFile(IFile file) { 67 67 IPath path = file.getRawLocation(); 68 if (path == null) return false; 68 if (path == null || !LANGUAGE.hasExtension(path.getFileExtension())) 69 return false; 69 70 IContainer sourceFolder = AS3Util.getSourceFolder(file); 70 71 if (sourceFolder == null) return false; 72 73 return LANGUAGE.hasExtension(path.getFileExtension()); 71 return sourceFolder != null; 74 72 } 75 73 … … 100 98 */ 101 99 protected boolean isOutputFolder(IResource resource) { 102 IPreferenceStore store = AS3Preferences.getInstance().getProjectStore(resource); 103 String deployPart = store.getString(AS3Preferences.DEPLOY_PATH); 104 IPath fullPath = resource.getFullPath(); 105 return fullPath.toPortableString().endsWith(deployPart); 100 if (resource == null || !(resource instanceof IContainer)) return false; 101 IContainer deployContainer = AS3Preferences.getDeployPath(resource); 102 return resource.equals(deployContainer); 106 103 } 107 104 … … 112 109 protected void compile(final IFile file, IProgressMonitor monitor) { 113 110 try { 114 111 if (AS3EditorService.isOpen(file.getFullPath())) { 112 // skip if editor is open. the parser scheduler will handle things 113 AS3Plugin.getDefault().debug("skip build for opened file."); 114 } 115 115 AS3ParseController parse = getParseController(file); 116 116 -
org.axdt.as3/src/org/axdt/as3/imp/foldingUpdater/AS3FoldingUpdater.java
r1d13b65 r3d0622c 5 5 import java.util.List; 6 6 7 import lpg.runtime.Adjunct; 8 import lpg.runtime.ILexStream; 9 import lpg.runtime.IPrsStream; 10 import lpg.runtime.IToken; 11 12 import org.axdt.as3.imp.parser.Ast.ASTNode; 13 import org.axdt.as3.imp.parser.Ast.AbstractVisitor; 14 import org.axdt.as3.imp.parser.Ast.Block; 15 import org.axdt.as3.imp.parser.Ast.FunctionDefinition; 16 import org.axdt.as3.imp.parser.Ast.ImportDirectiveList; 17 import org.axdt.as3.imp.parser.Ast.InterfaceBlock; 18 import org.axdt.as3.imp.parser.Ast.PackageDefinition; 19 import org.axdt.as3.preferences.AS3EditorPreferences; 7 20 import org.eclipse.imp.parser.IParseController; 8 21 import org.eclipse.imp.parser.ISourcePositionLocator; … … 13 26 import org.eclipse.jface.text.source.projection.ProjectionAnnotation; 14 27 import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; 15 16 import org.axdt.as3.imp.parser.Ast.*;17 import org.axdt.as3.preferences.AS3Preferences;18 19 import lpg.runtime.*;20 28 21 29 /** … … 30 38 31 39 public AS3FoldingUpdater() { 32 IPreferenceStore store = AS3 Preferences.getInstance().getStore();33 useFolding = store.getBoolean(AS3 Preferences.USE_FOLDING);34 foldComments = store.getBoolean(AS3 Preferences.FOLD_COMMENTS);35 foldHeaders = store.getBoolean(AS3 Preferences.FOLD_HEADERS);36 foldImports = store.getBoolean(AS3 Preferences.FOLD_IMPORTS);37 foldMembers = store.getBoolean(AS3 Preferences.FOLD_MEMBERS);40 IPreferenceStore store = AS3EditorPreferences.getInstance().getStore(); 41 useFolding = store.getBoolean(AS3EditorPreferences.USE_FOLDING); 42 foldComments = store.getBoolean(AS3EditorPreferences.FOLD_COMMENTS); 43 foldHeaders = store.getBoolean(AS3EditorPreferences.FOLD_HEADERS); 44 foldImports = store.getBoolean(AS3EditorPreferences.FOLD_IMPORTS); 45 foldMembers = store.getBoolean(AS3EditorPreferences.FOLD_MEMBERS); 38 46 autoFolds = new ArrayList<Annotation>(); 39 47 } -
org.axdt.as3/src/org/axdt/as3/preferences/AS3EditorPreferencePage.java
rfc56e42 r3d0622c 2 2 3 3 import org.axdt.preferences.AbstractPreferencePage; 4 import org.eclipse.swt.SWT;5 import org.eclipse.swt.widgets.Composite;6 import org.eclipse.swt.widgets.Control;7 import org.eclipse.ui.dialogs.PreferenceLinkArea;8 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;9 4 10 5 public class AS3EditorPreferencePage extends AbstractPreferencePage { 11 private static final String IMP_PREF_PAGE = "org.eclipse.imp.runtime.preferencePage";12 6 13 7 public AS3EditorPreferencePage() { 14 super(AS3 Preferences.getInstance(), AS3Preferences.PAGE_EDITOR);8 super(AS3EditorPreferences.getInstance()); 15 9 } 16 10 17 @Override18 protected Control createContents(Composite parent) {19 parent = (Composite) super.createContents(parent);20 new PreferenceLinkArea(parent, SWT.NONE, IMP_PREF_PAGE,21 "See <a>IMP Preference</a> for tab width and font preference",22 (IWorkbenchPreferenceContainer)getContainer(), null);23 return parent;24 }25 11 } -
org.axdt.as3/src/org/axdt/as3/preferences/AS3Preferences.java
r87f02d1 r3d0622c 10 10 public class AS3Preferences extends AbstractPreferences { 11 11 12 public final static String PAGE_EDITOR = "PAGE_EDITOR";13 14 12 public final static String SOURCE_PATHS = "SOURCE_PATHS"; 15 13 public final static String LIBRARY_PATHS = "LIBRARY_PATHS"; 16 14 public final static String DEPLOY_PATH = "DEPLOY_PATH"; 17 15 public final static String CONFIG_PATH = "CONFIG_PATH"; 18 public final static String TAB_TO_SPACE = "TAB_TO_SPACE";19 public final static String TAB_WIDTH = "TAB_WIDTH";20 public final static String CLOSE_STRINGS = "CLOSE_STRINGS";21 public final static String CLOSE_BRACKETS = "CLOSE_BRACKETS";22 public final static String CLOSE_BRACES = "CLOSE_BRACES";23 public final static String DELETE_PAIR = "DELETE_PAIR";24 public final static String USE_FOLDING = "USE_FOLDING";25 public final static String FOLD_COMMENTS = "FOLD_COMMENTS";26 public final static String FOLD_HEADERS = "FOLD_HEADERS";27 public final static String FOLD_IMPORTS = "FOLD_IMPORTS";28 public final static String FOLD_MEMBERS = "FOLD_MEMBERS";29 16 30 17 private static AS3Preferences instance; … … 51 38 add(CONFIG_PATH, "&Config path", "config"); 52 39 add(LIBRARY_PATHS, "&Library &paths", "lib"); 53 addPage(PAGE_EDITOR, "");54 addGroup(null, false);55 add(TAB_TO_SPACE, "Convert &tabs", false);56 add(TAB_WIDTH, "to number of spa&ces", 4);57 add(USE_FOLDING, "Enable &folding", true);58 addGroup("Initially fold these elements:", true);59 add(FOLD_COMMENTS, "&Comments", false);60 add(FOLD_HEADERS, "&Header comments", true);61 add(FOLD_MEMBERS, "&Members", false);62 add(FOLD_IMPORTS, "&Imports", true);63 addGroup("Automatically close", true);64 add(CLOSE_STRINGS, "\"&Strings\"", true);65 add(CLOSE_BRACKETS, "(Parentheses) and [Brac&kets]", true);66 add(CLOSE_BRACES, "{&Braces} on newline", true);67 endGroup();68 add(DELETE_PAIR, "Delete right matching pair (if direct neighbor)", true);69 40 } 70 41 -
org.axdt.as3/src/org/axdt/as3/templates/AS3TemplateContext.java
r888e2ac r3d0622c 6 6 import java.util.StringTokenizer; 7 7 8 import org.axdt.as3.preferences.AS3 Preferences;8 import org.axdt.as3.preferences.AS3EditorPreferences; 9 9 import org.eclipse.jface.preference.IPreferenceStore; 10 10 import org.eclipse.jface.text.BadLocationException; … … 32 32 String pattern = template.getPattern(); 33 33 String delim = d.getLegalLineDelimiters()[0]; 34 IPreferenceStore store = AS3 Preferences.getInstance().getStore();35 boolean tab2Space = store.getBoolean(AS3 Preferences.TAB_TO_SPACE);36 int tabWidth = store.getInt(AS3 Preferences.TAB_WIDTH);34 IPreferenceStore store = AS3EditorPreferences.getInstance().getStore(); 35 boolean tab2Space = store.getBoolean(AS3EditorPreferences.TAB_TO_SPACE); 36 int tabWidth = store.getInt(AS3EditorPreferences.TAB_WIDTH); 37 37 StringBuffer buf = new StringBuffer(); 38 38 for (int i = 0; i < tabWidth; i++)
