Undocumented Flex Builder: changing the syntax coloring
Naturally, Flex Builder does syntax coloring when displaying your .mxml, .as, and .css files. As of this first release, we don’t have a way for you to change the colors that are used. But if you don’t like them, you can change them — just please be aware that this technique is entirely undocumented and unsupported. (Doesn’t that just give you a thrill? Funny how learning about anything which is undocumented — even something as trivial as this — makes you feel like you’re stickin’ it to the man.)
Anyway, inside your Flex Builder directory, look for a folder called
plugins\com.adobe.flexbuilder.editors.common_2.0.xxx
where xxx is a version number — for example, 340 for Beta 3.
Inside that directory is a file called common.jar. Open this file with WinZip or any other zip software. (In case you didn’t know, Java .jar files are actually the sample file format as .zip files. Probably the easiest way to open the file is to copy common.jar to common.zip, and then just double-click it.)
In there, you will see Colors.xml. That’s your baby. Oh, the excitement, we’ve found the top secret undocumented stuff! The format of the file is pretty obvious: an XML file with three sections — one for ActionScript, one for MXML, and one for CSS. Just modify the following attributes of any tag:
text="rrggbb"— foreground color (standard red/green/blue format)bold="true"or"false"italic="true"or"false"
Then when you’re done, save your modified Colors.xml back into common.jar (after first making a backup of common.jar, of course.)
In case it wasn’t obvious: This whole thing is undocumented and unsupported. You do this AT YOUR OWN RISK. And, of course, it may change in future versions of Flex Builder. In fact, it probably will change, when we eventually add support for customizing your colors.
[...] In the next few weeks, I’m going to start talking more and more about extending Flex Builder 2, hopefully dropping some code samples along the way. In the mean time, Mike Morearty (a fellow Flex Builder 2 engineer) has written a great post about changing the defaults for syntax coloring for the MXML, CSS and ActionScript editors. [...]
Bingo! Thanks alot for writing about this stuff!
Very good news! I’ve changed my Flex Color Scheme to my favorite pink on green already :):):)
Seriously, are this feature scheduled to be implemented in preferences of release version of Flex Builder 2.0? Or you intimate Eclipse Plugin developers to do it their self?
No, Rostislav, there won’t be a preference for this in Flex Builder 2.0. I suspect that it will be a feature of some future version, not because anyone has told me so but simply because it seems like an obvious thing to do.
Unfortunately I don’t think this would be a very good candidate for a third-party plugin, because it requires modifying one of the JAR files which make up Flex Builder itself. If Flex Builder is already running, can you yank a JAR out from under it and modify it? I don’t know — sounds like a recipe for a crash to me. But I suppose it would be nice if someone wrote a separate standalone utility (not a plugin) which made these changes and then rewrote the JAR. It’s a bummer to have to do it in a non-integrated way, but so it goes. I suppose you could *try* writing a plugin which modified the JAR on the fly — if it worked, that sure would be cool — but don’t be surprised if it causes problems.
Don’t like the code hinting colors in FlexBuilder 2.0? change th
Mike Morearty blogs about how to tweak the xml configuration files for FlexBuilder 2.0 to customize the code hinting colors any way you want.
Is there a way to change specific items like Event.CONSTANTS?
I am trying to staty away from new Event(”magicString”) but the CONSTANT code is hard to find even in CAPS
No jvc, sorry, I don’t think there is any way to change specific items like that.
look at this: http://www.bezier.ru/ei/
I’m waiting for your requests :)
also you can see result here:
http://www.sharedfont.com/ei/
Has anyone had their syntax highlighting fail altogether with the Flex builder plugin in Eclipse 3.2.1 - or appear sporadically (like when I expand a code block) only to disappear again.
[...] Morearty of Adobe wrote in his blog how to change the syntax colors in Flex Builder 2.0. This is useful stuff since I loathe the default blue and green colors of Flex’s syntax [...]
[...] 2 doesn’t have any means in the preferences to change the colors comfortably so far. But like Mike Morearty explained before on his blog, it’s very easy to hack into the jar file and change the values [...]
[...] Morearty of Adobe wrote in his blog how to change the syntax colors in Flex Builder 2.0. This is useful stuff since I loathe the default blue and green colors of Flex’s syntax [...]
[...] 2 doesn’t have any means in the preferences to change the colors comfortably so far. But like Mike Morearty explained before on his blog, it’s very easy to hack into the jar file and change the values [...]
[...] comma, numbers, and possibly other tokens. If anyone knows how to change these colors, possibly by editing files in jars as in FlexBuilder 2 please let me know. If you don’t please vote for the bug he opened [...]
<strong>Eclipse Information…</strong>
General There are three major flavors of Eclipse at this point. Eclipse 3.1.x Eclipse 3.2.x Eclipse 3.3.x If you have installed Flex Builder as a standalone application, then you are using Eclipse 3.1.x (3.1.2)…….