Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Different PropertySheets for different tools(Each tool is the same class though)
Different PropertySheets for different tools [message #1017867] Tue, 12 March 2013 13:00 Go to next message
jh vdv is currently offline 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.
Re: Different PropertySheets for different tools [message #1034442 is a reply to message #1017867] Fri, 05 April 2013 08:37 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1577
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Dan,

not sure if and how this is possible. Maybe you shoould ask this question in
an Eclipse plugin development forum, there should be the experts for the
tabbed property sheets.

Michael
Previous Topic:Using SVG figures ?
Next Topic:Palette-Items Customize before/at Editor start
Goto Forum:
  


Current Time: Thu Aug 21 10:24:00 EDT 2014

Powered by FUDForum. Page generated in 0.11392 seconds