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

We agree on model, and view as well. But palette, and tool I am not understanding. a palette is just a set of tools, but yours is more than that?

Each different file you open (which is an rdf-file) will open a palette as well. And that palette is setup to match the schema type of that particular rdf-file?

If this is correct then you can either store data in your file which will tell your editor which palette to associate with it, or you can store meta-data on your file in the IFile which represents your file in the workspace, and use that meta-data to tell your editor which palette to open, or how to populate it.

For instance, when you open a project, it has natures attached to it that tell eclipse what tools should be associated with it among other things.


Frank Dyck wrote:
It is the palette-tools that i want to store. But mine have parameters.

In my editor there are only two model classes GenericNode and GenericConnection,
which represent rdf Resources. Different rdf-properties are passed as parameters to the Generic modelÂs contructors.


So accordingly there are also only two generic ToolEntry types which also have to store parameters to pass to the generic model that they create.

The palette represents an rdf schema, the diagram in the editor pane represents an rdf-file that is built from that schema.

So i haven`t got many diffrent toolentry classes but only two with lots of parameters to store.



I am beginning to think that when you say palette you just mean model. When we say palette here we mean a set of tools that are displayed in a specific view. Such as, line draw tool, selection tool, text tool, etc. When these are all put together in a sort of tool bar, we call it a pallette.

If you mean the storable class that gets written to and read from a file, or some other storage medium, we call that the model.

Is that consistent with what you are thinking?


Frank Dyck wrote:


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.)






--
Respectfully,


CL Gilbert

"Verily, verily, I say unto you, He that entereth not by the door() into the sheepfold{}, but climbeth up some other *way, the same is a thief and a robber."

GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD  19AE 55B2 4CD7 80D2 0A2D

For a free Java interface to Freechess.org see http://www.rigidsoftware.com/Chess/chess.html