[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: where to store customized palette?

I would save it in the preferences. unless you want each editor view to have its own customized palette.

Preferences store = yourPlugin.getDefault().getPluginPreferences(); //a static method of grabbing your plugin, then getting the preferences from it

Well actually the palette is more bound the resource you create with it.So IÂm thinking more property at the moment.


Bound to the resource or the resource type? Is your pallete more like the outline view in that it presents some data from the Views model?




Bound to the resource. There is only one type that my editor opens. I think i don`t understand the second question... My palette provides tools to generate the views model.


But my question is more: How do i store it? ItÂs an rdf model.

your asking how to store the model or how to store the palette? or both?


Store the palette (the palette-model :-))
Sorry about the misleading terms.
I convert the gef-palette to an RDFModel object which i can read/write to a file.



As far as i understand you normally add string properties to a property page.
It also makes not much sense ATM do be able to edit it in either a property or preferences page. (Or iÂd have to put the whole PaletteCustomizer functionality into the page...)



I had properties before I ever made my property editor page. Gotta start somewhere.



How do you setProperties of a Resource?
I`m a complete newbie to this.
I just added the example extension PropertyPage and looked at it a bit.
As far as i see it without the property page i would do something like this,
where i normally write the palette to a file:


ResourcesPlugin.getWorkspace().getRoot().setPersistentProperty(
    					new QualifiedName("", PALETTE_PROPERTY),
    							someShortStringValue);

Where the value should be representing the palette.

But setPersistentProperty says to store short strings as values.
I want to store an object of the type RDFModel.
I mean i can convert it to a String but it won`t be under 2KB short!


So at the moment I just want to store the rdf model or file somewhere along with the resource, and be able to load it on startup (from Editor.java) and get/set it from the customizerÂs save/revertToSaved methods.


again, im getting mixed up. The rdf is the model, or the palette or is this the same thing? or is the resource the model?



:-) It`s pretty confusing/misleading.
I convert the palette to an rdf-model-object(from jena). So that is what i want to store.
(I want to be able to export it later and can already read in palettes from rdf files.)