So the full documentation for Flex Builder extensibility is finally online.
This also means the JavaDoc for Code Model is online as well. Code Model is the engine that drives the language-aware features in Flex Builder and Flash Catalyst. We’ve tried to make sure the published APIs stay well documented, and I’m constantly moving more functionality into the public APIs as well.
Thanks to the docs team for making this happen!
And yes, the “dz” and “david” author tags in the JavaDoc refer to me…I should have taken those out…


[...] > Marking Occurrences » Flex Builder extensibility documentation online! [...]
Hi,
I read the documentation to get access to the MXMLModel of the MXML file. I tried to compile the FlexBuilderModelAccess.java ecample class. I replaced “zorn” by “com.adobe.flexbuilder” like stated in your slides, but this only fixed the import for “CMFactory”.
import com.adobe.flexbuilder.editors.mxml.MXMLEditor;
import com.adobe.flexbuilder.editors.mxml.views.MXMLEditorActivationListener;
import com.adobe.flexbuilder.mxmlmodel.IMXMLModel;
can be resolved. I Added all com.adobe.flexbuilder.* bundels to the dependencies in the maifest file, so the packages and classes should be available to my plugin. Do you have any idea what can possibly go wrong?
Regards
Thomas
Unfortunately I don’t…I’m more of the code model guy. I’ll check with a few people around here and see what I can dig up
Do you see the bugs on jira? I was expecting the bug http://bugs.adobe.com/jira/browse/FB-16629 to go to you but it went to someone else. It seems that everything i try to get out of the CMFactory comes back null. I assume I am using ti wrong but I don’t see what is wrong
Hi Patrick-
So you need to make sure that you’ve registered the project with code model:
if (project.isAccessible()) { if(!CMFactory.getRegistrar().isProjectRegistered(project)) {
CMFactory.getRegistrar().registerProject(project, null);
}
}
thanks, i missed that, since i copied the getAllDefinitionsInScope example method from the introduction that didn’t have the register code it in.
I am trying to develop a plug-in that can search a flex project and flag (or change) any occurrences when the developer has created an instance of a certain class (or made a reference to it). I have been looking through your code model javadoc (specifically the search and tree packages) and I am having trouble determining if I can do this at all or how I can do this if it is possible.
Do you know of any way I can do this? Is there any more documentation coming?
Thanks, Pat
The search packages are part of what you would use, but be sure to look at com.adobe.flexbuilder.codemodel.indices.ISearchIndex.
Let me know if you need more pointers.
-david
Oh, and yes, you can totally do this with code model
That is what I have been looking at and your example search plug-in from max2008. The problem i am hitting is that the only way you seem to be able to create the SearchIndex is with an ASOffsetInformation instance which would require that I have an offset in a current file that has the thing I am looking for.
What I didn’t explain before is that I am searching for any of a list of classes that I will most likely be reading from a text file. So the search process makes sense to me if I could create an instance of IDefinitionProvider in a different way.
Pat