Community
Participate
Working Groups
It would be nice if EMF edit supported jface color and font providers. ie ITableColorProvider and ITableFontProvider
That would be cool. We'd need to come up with a declarative way to do that, similar to how the images are just treated as URLs until you need a real image in the GUI, so that EMF.Edit still would not depend on GUI code or Eclipse.
Could you introduce a ColorDescriptor and FontDescriptor? They would be fairly simple: ColorDescriptor int r; int g; int b; FontDescriptor String name; int height; int style;
Created attachment 52983 [details] A prototype design... Here is a partial prototype design for supporting these things. Quite a bit more work is needed. It's particularly frustrating that the most common usage for IFontProvider is to specify a delta on the font already being used by the view yet there is no mechanism to know which view is asking for the font. One design that I was going to experiment with is to use a URI to specify the font, e.g., font://<font-name>/<size>/<style> and then use something like font:///+2 to indicate a font that's two points bigger, or font:////bold to indicate a bold variation of the font. I can imagine that the color issue is similar, i.e., you might want to specify a color that's a greyed/faded versin of the color currently being used so something like color:/*0.5/*0.5/*0.5 might be used for that...
Created attachment 53569 [details] Updated results The support is a bit more complete now. Item providers can contain specializations like this: public Object getFont(Object object) { return URI.createURI("font:///-1/Bold"); } public Object getForeground(Object object) { return URI.createURI("color:/255/0/0"); }
Could this enhancement not also be contained in the 2.4 release (given that a working patch already exists)?
I hope so. :-)
Created attachment 81329 [details] Updated patch for EMF 2.4 This also includes changes for the Ecore editor to make abstract types italic and containment references bold as an example.
Created attachment 86764 [details] Final updates to make it ready for review Dave, This is ready to commit now pending your review. I've added GenModel properties so that support for this is generated automatically based on the properties. The changes to ecore.edit and ecore.editor are just examples and I'll commit those in a separate bugzilla later, so that's just and example. To test it out, just generated a model and at this to the item provider for it: @Override public Object getFont(Object object) { return BOLD_FONT; } @Override public Object getForeground(Object object) { return GRAYED_OUT_COLOR; }
Marcelo, You're review would be helpful too. I'd like to commit this for next week's build...
The changes after Dave's review have been committed to CVS for 2.4. This included adding support for "GenModel.tableProviders".
Fixed in I200801152000.
Move to verified as per bug 206558.