Different PropertySheets for different tools [message #1017867] |
Tue, 12 March 2013 17:00 |
jh vdv Messages: 2 Registered: February 2010 |
Junior Member |
|
|
Hi all,
I'm going from GMF to Graphiti, and I am loving every moment. With GMF I need much more lines of code to produce a more difficult to understand result. But being new to the technology, may mean that I am doing something wrong and that's what this post is about.
The editor I want to show is contained of nodes that all share the same class: Block. At run time the contents of a folder on the file system decide what kinds of blocks there are and what properties they have.
Based on the name of the block, I can access its definition (in xml on the file system), and I can create different shapes based on the contents of the xml. The difference mainly is an image and the number of anchors for a node.
This is the simplified code that adds the features:
@Override
public ICreateFeature[] getCreateFeatures() {
return new ICreateFeature[] {
new CreateBlockFeature(this, "b1", "b1 desc"),
new CreateBlockFeature(this, "b2", "b2 desc"),
new CreateBlockFeature(this, "b3", "b3 desc") };
}
My problem is the property sheet. Each block should have its own, but I cannot and don't want to create 100+ GFPropertySections. Because the properties can be different across different blocks. All I know is that a block has a set of properties and (but that can come later) some properties need other widgets (text, combo, multiline, custom). If I follow the tutorial the Section is created only once. The original name of the block (b1, b2, b3 in the code above) and thus the xml is accessible from the section, but createControls has already been called, and no custom property sheet can be shown.
What should I do?
In GMF (eclipse 3.5) I had the property section implement IPropertySourceProvider, but that's not working anymore in Juno. And the code was messy. But that's my own fault.
Any advice is welcome.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03243 seconds