Changeset 654
- Timestamp:
- 05/10/08 07:21:52 (7 months ago)
- Location:
- org.cfeclipse.cfml/trunk
- Files:
-
- 4 added
- 6 modified
-
about.html (added)
-
about.ini (added)
-
build.properties (modified) (2 diffs)
-
plugin.properties (modified) (2 diffs)
-
plugin.xml (modified) (7 diffs)
-
src/org/cfeclipse/cfml/CFMLPlugin.java (modified) (8 diffs)
-
src/org/cfeclipse/cfml/editors/ICFDocument.java (modified) (2 diffs)
-
src/org/cfeclipse/cfml/natures/CFENature.java (modified) (2 diffs)
-
src/org/cfeclipse/cfml/ui/actions/ApplyCFENatureAction.java (added)
-
src/org/cfeclipse/cfml/wizards/NewCFEclipseProject.java (added)
Legend:
- Unmodified
- Added
- Removed
-
org.cfeclipse.cfml/trunk/build.properties
r570 r654 27 27 icons/,\ 28 28 splash.png,\ 29 lib/apache_vfs.jar 29 lib/apache_vfs.jar,\ 30 about.html,\ 31 about.ini 30 32 src.includes = plugin.xml,\ 31 33 dictionary/,\ … … 34 36 License.txt,\ 35 37 lib/,\ 36 src/ 38 src/,\ 39 about.html,\ 40 about.ini 37 41 bin.excludes = lib/Tidy.jar,\ 38 42 lib/ant.jar,\ -
org.cfeclipse.cfml/trunk/plugin.properties
r644 r654 17 17 action.label.55=Expand Matching 18 18 action.label.56=Collapse Matching 19 action.label.57=A pplyCFE Nature19 action.label.57=Add/Remove CFE Nature 20 20 action.label.AddFoldingMarkers=Add folding markers 21 21 action.label.AutoComment=&Auto Comment … … 66 66 action.label.Variable=&Variable 67 67 action.label.WordWrap=Word Wrap 68 action.tooltip.40=Associate dthe project with CFEclipse68 action.tooltip.40=Associate the project with CFEclipse 69 69 action.tooltip.AddFoldingMarkers=Add folding markers and collapse the selected text 70 70 action.tooltip.AutoComment=Insert comment based on section -
org.cfeclipse.cfml/trunk/plugin.xml
r643 r654 135 135 </extension> 136 136 137 <!-- ////////////////////////////////////////////////////////////// --> 137 <extension point="org.eclipse.core.runtime.contentTypes"> 138 <content-type 139 id="cfsource" 140 base-type="org.eclipse.core.runtime.text" 141 name="ColdFusion Source File" 142 file-extensions="cfc,cfm,cfml"> 143 </content-type> 144 </extension> 145 146 <!-- ////////////////////////////////////////////////////////////// --> 138 147 <!-- Editor --> 139 148 <extension … … 146 155 class="org.cfeclipse.cfml.editors.CFMLEditor" 147 156 id="org.cfeclipse.cfml.editors.CFMLEditor"> 157 158 <contentTypeBinding contentTypeId="org.cfeclipse.cfml.cfsource"> 159 </contentTypeBinding> 148 160 </editor> 149 161 … … 819 831 id="org.cfeclipse.cfml.mappings" 820 832 objectClass="org.eclipse.core.resources.IFolder"> 821 <menu833 <!-- <menu 822 834 id="org.cfeclipse.cfml.cfeclipse.menu" 823 835 label="CFEclipse" 824 836 path="cfeclipse_additions"> 825 837 <separator name="separator1"/> 826 </menu> 838 </menu> --> 827 839 <action 828 840 class="org.cfeclipse.cfml.ui.actions.SetMappingAction" … … 832 844 </objectContribution> 833 845 834 <objectContribution 835 objectClass="org.eclipse.core.resources.IProject" 846 <objectContribution 847 adaptable="true" 848 id="org.cfeclipse.cfml.applyNature" 836 849 nameFilter="*" 837 id="org.cfeclipse.cfml.applyNature"838 >839 <action840 enablesFor="1"841 label="%action.label.57"842 class="org.cfeclipse.cfml.ui.actions.ApplyCFENatureAction"843 tooltip="%action.tooltip.40"844 menubarPath="org.cfeclipse.cfml.cfeclipse.menu/separator1"845 id="org.cfeclipse.cfml.ui.actions.ApplyCFENatureAction"846 />847 </objectContribution>850 objectClass="org.eclipse.core.resources.IProject"> 851 <action 852 class="org.cfeclipse.cfml.ui.actions.ApplyCFENatureAction" 853 enablesFor="+" 854 icon="icons/icons/16x16.gif" 855 id="org.cfeclipse.cfml.ui.actions.ApplyCFENatureAction" 856 label="%action.label.57" 857 menubarPath="additions" 858 tooltip="%action.tooltip.40"/> 859 </objectContribution> 860 848 861 <objectContribution 849 862 adaptable="false" … … 1553 1566 <page 1554 1567 class="org.cfeclipse.cfml.properties.ProjectPropertyPage" 1555 icon="icons/icons/cfeclipse_16x16.png"1556 1568 id="org.cfeclipse.cfml.properties.samplePropertyPage" 1557 1569 name="%page.name.10" 1558 1570 nameFilter="*" 1559 1571 objectClass="org.eclipse.core.resources.IProject"> 1572 <filter 1573 name="projectNature" 1574 value="org.cfeclipse.cfml.CFENature"> 1575 </filter> 1576 <enabledWhen> 1577 <instanceof 1578 value="org.eclipse.core.resources.IProject"> 1579 </instanceof> 1580 </enabledWhen> 1560 1581 </page> 1561 1582 <page 1562 1583 class="org.cfeclipse.cfml.properties.MappingsPropertyPage" 1563 icon="icons/icons/cfeclipse_16x16.png"1564 1584 id="org.cfeclipse.cfml.properties.MappingsPropertyPage" 1565 1585 name="CFEMappings" 1566 1586 nameFilter="*" 1567 objectClass="org.eclipse.core.resources.IProject"/> 1587 objectClass="org.eclipse.core.resources.IProject"> 1588 <filter 1589 name="projectNature" 1590 value="org.cfeclipse.cfml.CFENature"> 1591 </filter> 1592 <enabledWhen> 1593 <instanceof 1594 value="org.eclipse.core.resources.IProject"> 1595 </instanceof> 1596 </enabledWhen> 1597 </page> 1568 1598 <!-- 1569 1599 <page … … 1584 1614 id="org.cfeclipse.cfml.category1"> 1585 1615 </category> 1586 <wizard name="%wizard.name.0" 1587 icon="icons/icons/cfeclipse_16x16.png" 1588 1589 class="org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard" 1590 1591 category="org.cfeclipse.cfml.category1" 1592 preferredPerspectives="org.cfeclipse.cfml.perspective.CFML" 1593 project="true" 1594 finalPerspective="org.cfeclipse.cfml.perspective.CFML" 1595 id="org.cfeclipse.cfml.wizards.NewProject"> 1616 <wizard 1617 category="org.cfeclipse.cfml.category1" 1618 class="org.cfeclipse.cfml.wizards.NewCFEclipseProject" 1619 finalPerspective="org.cfeclipse.cfml.perspective.CFML" 1620 icon="icons/icons/cfeclipse_16x16.png" 1621 id="org.cfeclipse.cfml.wizards.NewProject" 1622 name="%wizard.name.0" 1623 preferredPerspectives="org.cfeclipse.cfml.perspective.CFML" 1624 project="true"> 1596 1625 <description>%wizard.description.0</description> 1597 1626 </wizard> … … 1677 1706 <run class="org.cfeclipse.cfml.natures.CFENature"/> 1678 1707 </runtime> 1679 <one-of-nature id="CFEclipse-2.one-of-nature1"/>1680 1708 </extension> 1681 1709 -
org.cfeclipse.cfml/trunk/src/org/cfeclipse/cfml/CFMLPlugin.java
r529 r654 58 58 import org.osgi.framework.BundleContext; 59 59 60 61 60 /** 62 61 * 63 * The CFEclipse plugin itself. 62 * The CFEclipse plugin itself. 64 63 * 65 * Also see 'Simple plug-in example' in the Platform Plug-in Developer Guide 64 * Also see 'Simple plug-in example' in the Platform Plug-in Developer Guide 66 65 * that comes with the SDK version of Eclipse. 67 66 * … … 71 70 public class CFMLPlugin extends AbstractUIPlugin { 72 71 73 72 public static final String PLUGIN_ID = "org.cfeclipse.cfml"; 74 73 75 74 /** Singleton instance so that everything can access the plugin */ 76 75 private static CFMLPlugin plugin; 77 76 78 77 /** The bundle of resources for the plugin */ 79 78 private ResourceBundle resourceBundle; 80 79 81 80 /** The preferences for the plugin. */ 82 private PreferenceStore propertyStore; 83 81 private PreferenceStore propertyStore; 82 84 83 /** Content Assist Manager */ 85 84 private CFEContentAssistManager camInstance; 86 85 87 86 /** Last Encloser Manager */ 88 87 private LastActionManager lastEncMgrInstance; 89 90 /** Unique ID of the CFENature */ 91 public static final String NATURE_ID = "org.cfeclipse.cfml.CFENature"; 92 88 93 89 /** Storage for the Templates */ 94 private static final String CUSTOM_TEMPLATES_KEY = "org.cfeclipse.cfml.customtemplates"; //$NON-NLS-1$90 private static final String CUSTOM_TEMPLATES_KEY = "org.cfeclipse.cfml.customtemplates"; //$NON-NLS-1$ 95 91 private TemplateStore fStore; 96 92 private ContributionContextTypeRegistry fRegistry; 97 93 98 94 /** 99 95 * Returns the global Content Assist Manager. … … 103 99 * 104 100 */ 105 public CFEContentAssistManager getGlobalCAM() 106 { 107 108 if(this.camInstance == null) 109 { 110 throw new IllegalArgumentException("CFMLPlugin::getGlobalCAM() camInstance is null"); 111 } 112 return this.camInstance; 113 } 114 101 public CFEContentAssistManager getGlobalCAM() { 102 103 if (this.camInstance == null) { 104 throw new IllegalArgumentException( 105 "CFMLPlugin::getGlobalCAM() camInstance is null"); 106 } 107 return this.camInstance; 108 } 109 115 110 /** 116 111 * Returns the Last Encloser Manager. … … 120 115 * 121 116 */ 122 public LastActionManager getLastActionManager() 123 { 124 if(this.camInstance == null) 125 { 126 throw new IllegalArgumentException("CFMLPlugin::getGlobalCAM() camInstance is null"); 127 } 128 return this.lastEncMgrInstance; 129 } 130 117 public LastActionManager getLastActionManager() { 118 if (this.camInstance == null) { 119 throw new IllegalArgumentException( 120 "CFMLPlugin::getGlobalCAM() camInstance is null"); 121 } 122 return this.lastEncMgrInstance; 123 } 124 131 125 /** 132 126 * create a new cfml plugin 133 127 */ 134 public CFMLPlugin() 135 { 128 public CFMLPlugin() { 136 129 super(); 137 130 plugin = this; 138 try 139 { 140 this.resourceBundle = ResourceBundle.getBundle("plugin"); 141 } 142 catch (MissingResourceException x) 143 { 131 try { 132 this.resourceBundle = ResourceBundle.getBundle("plugin"); 133 } catch (MissingResourceException x) { 144 134 x.printStackTrace(System.err); 145 135 this.resourceBundle = null; 146 136 } 147 137 } 148 149 /** 150 * This method is called upon plug-in activation. Seems like most startup 138 139 /** 140 * This method is called upon plug-in activation. Seems like most startup 151 141 * stuff should now go here. 152 142 */ 153 143 public void start(BundleContext context) throws Exception { 154 144 super.start(context); 155 156 /*//System.out.println( 157 "Property store file set to " + 158 CFMLPlugin.getDefault().getStateLocation().toString() 159 + "/properties.ini" 160 ); */ 161 162 PropertyConfigurator.configure(CFMLPlugin.getDefault().getBundle().getEntry("/lib/log4j.properties")); 163 this.propertyStore = new PreferenceStore( 164 CFMLPlugin.getDefault().getStateLocation().toString() 165 + "/properties.ini" 166 ); 167 168 String defaultSnippetPath = CFMLPlugin.getDefault().getStateLocation().toString()+"/snippets"; 169 145 146 /* 147 * //System.out.println( "Property store file set to " + 148 * CFMLPlugin.getDefault().getStateLocation().toString() + 149 * "/properties.ini" ); 150 */ 151 152 PropertyConfigurator.configure(CFMLPlugin.getDefault().getBundle() 153 .getEntry("/lib/log4j.properties")); 154 this.propertyStore = new PreferenceStore(CFMLPlugin.getDefault() 155 .getStateLocation().toString() 156 + "/properties.ini"); 157 158 String defaultSnippetPath = CFMLPlugin.getDefault().getStateLocation() 159 .toString() 160 + "/snippets"; 161 170 162 File f = new File(defaultSnippetPath); 171 163 if (!f.exists()) { 172 f.mkdir(); 173 } 174 175 try 176 { 177 //load all the syntax dictionaries 164 f.mkdir(); 165 } 166 167 try { 168 // load all the syntax dictionaries 178 169 DictionaryManager.initDictionaries(); 179 180 // startup the image registry170 171 // startup the image registry 181 172 CFPluginImages.initCFPluginImages(); 182 173 183 174 setupCAM(); 184 175 setupLastEncMgr(); 185 } 186 catch(Exception e) 187 { 188 //lots of bad things can happen... 176 } catch (Exception e) { 177 // lots of bad things can happen... 189 178 e.printStackTrace(System.err); 190 179 } 191 192 180 193 181 EditorPartListener editorListener = new EditorPartListener(); 194 this.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(editorListener); 195 196 197 } 198 199 /** 200 * Setups up the Content Assist Manager 201 * 202 */ 203 public void setupCAM() { 204 this.camInstance = new CFEContentAssistManager(); 205 CFMLTagAssist cfmlAssistor = new CFMLTagAssist(DictionaryManager.getDictionary(DictionaryManager.CFDIC)); 206 HTMLTagAssistContributor htmlAssistor = new HTMLTagAssistContributor(DictionaryManager.getDictionary(DictionaryManager.HTDIC)); 207 208 CFScriptCompletionProcessor cfscp = new CFScriptCompletionProcessor(); 182 this.getWorkbench().getActiveWorkbenchWindow().getPartService() 183 .addPartListener(editorListener); 184 185 } 186 187 /** 188 * Setups up the Content Assist Manager 189 * 190 */ 191 public void setupCAM() { 192 this.camInstance = new CFEContentAssistManager(); 193 CFMLTagAssist cfmlAssistor = new CFMLTagAssist(DictionaryManager 194 .getDictionary(DictionaryManager.CFDIC)); 195 HTMLTagAssistContributor htmlAssistor = new HTMLTagAssistContributor( 196 DictionaryManager.getDictionary(DictionaryManager.HTDIC)); 197 198 CFScriptCompletionProcessor cfscp = new CFScriptCompletionProcessor(); 209 199 cfscp.changeDictionary(DictionaryManager.JSDIC); 210 200 211 201 this.camInstance.registerRootAssist(cfscp); 212 this.camInstance.registerRootAssist(new CFContentAssist()); 213 this.camInstance.registerRootAssist(new CFMLScopeAssist()); 214 this.camInstance.registerRootAssist(new CFMLFunctionAssist()); 215 // this.camInstance.registerRootAssist(new CFMLComponentAssist()); //finds the components in a project, removed as we might use a new CFML Varscope parser 216 this.camInstance.registerRootAssist(new CFMLVariableAssist()); //finds the arguments in a cfc that you are talking about 217 218 this.camInstance.registerTagAssist(cfmlAssistor); 219 this.camInstance.registerAttributeAssist(cfmlAssistor); 220 this.camInstance.registerValueAssist(cfmlAssistor); 221 222 this.camInstance.registerTagAssist(htmlAssistor); 223 this.camInstance.registerAttributeAssist(htmlAssistor); 224 this.camInstance.registerValueAssist(htmlAssistor); 225 226 227 228 this.camInstance.registerTagAssist(new CFMLScopeAssist()); 229 } 230 231 /** 232 * Sets up the Last Encloser Manager 233 * 234 */ 235 private void setupLastEncMgr() { 236 this.lastEncMgrInstance = new LastActionManager(); 237 } 238 239 /** 202 this.camInstance.registerRootAssist(new CFContentAssist()); 203 this.camInstance.registerRootAssist(new CFMLScopeAssist()); 204 this.camInstance.registerRootAssist(new CFMLFunctionAssist()); 205 // this.camInstance.registerRootAssist(new CFMLComponentAssist()); 206 // //finds the components in a project, removed as we might use a new 207 // CFML Varscope parser 208 // finds the arguments in a cfc that you are talking about 209 this.camInstance.registerRootAssist(new CFMLVariableAssist()); 210 211 this.camInstance.registerTagAssist(cfmlAssistor); 212 this.camInstance.registerAttributeAssist(cfmlAssistor); 213 this.camInstance.registerValueAssist(cfmlAssistor); 214 215 this.camInstance.registerTagAssist(htmlAssistor); 216 this.camInstance.registerAttributeAssist(htmlAssistor); 217 this.camInstance.registerValueAssist(htmlAssistor); 218 219 this.camInstance.registerTagAssist(new CFMLScopeAssist()); 220 } 221 222 /** 223 * Sets up the Last Encloser Manager 224 * 225 */ 226 private void setupLastEncMgr() { 227 this.lastEncMgrInstance = new LastActionManager(); 228 } 229 230 /** 240 231 * This method is called when the plug-in is stopped 241 232 */ … … 243 234 super.stop(context); 244 235 } 245 246 protected void initializeDefaultPluginPreferences() 247 { 248 249 //super.initializeDefaultPluginPreferences(); 250 CFMLPreferenceManager preferenceManager = new CFMLPreferenceManager(); 236 237 protected void initializeDefaultPluginPreferences() { 238 239 // super.initializeDefaultPluginPreferences(); 240 CFMLPreferenceManager preferenceManager = new CFMLPreferenceManager(); 251 241 preferenceManager.initializeDefaultValues(); 252 TextEditorPreferenceConstants.initializeDefaultValues(getPreferenceStore()); 242 TextEditorPreferenceConstants 243 .initializeDefaultValues(getPreferenceStore()); 253 244 try { 254 245 CFMLPropertyManager propertyManager = new CFMLPropertyManager(); 255 } 256 catch (Exception e) { 246 } catch (Exception e) { 257 247 // do nothing 258 248 } 259 }260 249 } 250 261 251 /** 262 252 * Returns the shared instance. 263 253 */ 264 public static CFMLPlugin getDefault() 265 { 254 public static CFMLPlugin getDefault() { 266 255 return plugin; 267 256 } 268 257 269 258 public PreferenceStore getPropertyStore() { 270 259 return this.propertyStore; 271 260 } 272 273 261 274 262 /** 275 263 * Returns the workspace instance. 276 264 */ 277 public static IWorkspace getWorkspace() 278 { 265 public static IWorkspace getWorkspace() { 279 266 return ResourcesPlugin.getWorkspace(); 280 267 } 281 268 282 269 /** 283 * Returns the string from the plugin's resource bundle, 284 * or 'key' if not found. 285 */ 286 public static String getResourceString(String key) 287 { 270 * Returns the string from the plugin's resource bundle, or 'key' if not 271 * found. 272 */ 273 public static String getResourceString(String key) { 288 274 ResourceBundle bundle = CFMLPlugin.getDefault().getResourceBundle(); 289 try 290 { 291 return (bundle!=null ? bundle.getString(key) : key); 292 } 293 catch (MissingResourceException e) 294 { 275 try { 276 return (bundle != null ? bundle.getString(key) : key); 277 } catch (MissingResourceException e) { 295 278 return key; 296 279 } … … 300 283 * Returns the plugin's resource bundle, 301 284 */ 302 public ResourceBundle getResourceBundle() 303 { 285 public ResourceBundle getResourceBundle() { 304 286 return this.resourceBundle; 305 287 } … … 307 289 public TemplateStore getTemplateStore() { 308 290 if (fStore == null) { 309 fStore= new ContributionTemplateStore(null, CFMLPlugin.getDefault().getPreferenceStore(), CUSTOM_TEMPLATES_KEY); 291 fStore = new ContributionTemplateStore(null, CFMLPlugin 292 .getDefault().getPreferenceStore(), CUSTOM_TEMPLATES_KEY); 310 293 try { 311 294 fStore.load(); … … 320 303 if (fRegistry == null) { 321 304 // create an configure the contexts available in the template editor 322 fRegistry = new ContributionContextTypeRegistry();305 fRegistry = new ContributionContextTypeRegistry(); 323 306 fRegistry.addContextType(CFMContextType.CFM_CONTEXT_TYPE); 324 307 } -
