Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » IPictogramElementDelegate & AdvancedPropertySection
IPictogramElementDelegate & AdvancedPropertySection [message #657999] Fri, 04 March 2011 21:37 Go to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
I'd like to add an AdvancedPropertySection tab to my property sheet, but my initial examination of the code leads me to believe that the object that gets selected (maybe an IPictogramElementDelegate?) implements IAdapaptable. So, I can't bind an IAdapterFactory to pass back the IPropertySource implementation. Even if I could, it's not obvious that I could get back to my PictogramElements or my domain model using public interfaces from there. Is there some mechanism for supplying an IPropertySource for a PictogramElement? Or do I have to implement my own version of AdvancedPropertySection that gets its data through the mechanism outlined in the Graphiti user's guide?

Thanks for you help. I continue to be impressed by the flexibility of your framework and the helpfulness of your forum.
Re: IPictogramElementDelegate & AdvancedPropertySection [message #662487 is a reply to message #657999] Wed, 30 March 2011 19:28 Go to previous messageGo to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
So, the answer to my question is that the AdapterFactory must convert between a 'org.eclipse.graphiti.ui.internal.parts.ContainerShapeEditPa rt' and IPropertySource. This is unfortunate since ContainerShapeEditPart is an internal class.

Since exposing the internal class probably isn't the best recourse, Graphiti could supply a service that registers an AdapterFactory on behalf of the user. Or perhaps provide an extension point that does it declaratively.

--Rhett
Re: IPictogramElementDelegate & AdvancedPropertySection [message #663309 is a reply to message #657999] Mon, 04 April 2011 14:47 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Did you have a look into the tutorial? There is an example how to add a
tabbed property sheet for a Diagram element.

Michael


"Rhett Hudson" wrote in message news:ikrlm1$330$1@news.eclipse.org...

I'd like to add an AdvancedPropertySection tab to my property sheet, but my
initial examination of the code leads me to believe that the object that
gets selected (maybe an IPictogramElementDelegate?) implements IAdapaptable.
So, I can't bind an IAdapterFactory to pass back the IPropertySource
implementation. Even if I could, it's not obvious that I could get back to
my PictogramElements or my domain model using public interfaces from there.
Is there some mechanism for supplying an IPropertySource for a
PictogramElement? Or do I have to implement my own version of
AdvancedPropertySection that gets its data through the mechanism outlined in
the Graphiti user's guide?

Thanks for you help. I continue to be impressed by the flexibility of your
framework and the helpfulness of your forum.
Re: IPictogramElementDelegate & AdvancedPropertySection [message #663324 is a reply to message #663309] Mon, 04 April 2011 15:40 Go to previous messageGo to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
Michael,

Yes. I have several tabbed property sheets working. One tabbed property section that the Eclipse framework provides for reuse is an interface to the old tabular property sheet interface. I use this to augment my other tabs. The only trick is to be able to feed it data. My previous post outlined what is required to do that. It all works, the only issue is the reference to an internal Graphiti class. Even that works, it just comes at the cost of a warning.

--Rhett
Re: IPictogramElementDelegate & AdvancedPropertySection [message #663446 is a reply to message #663324] Tue, 05 April 2011 07:04 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Ah, I see. So, it's about the "normal" property sheet...

Would you file an enhancement bugzilla for this?

Michael


"Rhett Hudson" wrote in message news:incob3$nuu$1@news.eclipse.org...

Michael,

Yes. I have several tabbed property sheets working. One tabbed property
section that the Eclipse framework provides for reuse is an interface to the
old tabular property sheet interface. I use this to augment my other tabs.
The only trick is to be able to feed it data. My previous post outlined what
is required to do that. It all works, the only issue is the reference to an
internal Graphiti class. Even that works, it just comes at the cost of a
warning.

--Rhett
Re: IPictogramElementDelegate & AdvancedPropertySection [message #663512 is a reply to message #663446] Tue, 05 April 2011 13:10 Go to previous messageGo to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
Done. It is Bug 341898.
Re: IPictogramElementDelegate & AdvancedPropertySection [message #761522 is a reply to message #663512] Tue, 06 December 2011 15:27 Go to previous messageGo to next message
Jakob  is currently offline Jakob Friend
Messages: 6
Registered: November 2011
Junior Member
Hi Rhett,

I would like to do exactly what you described in your post: using an "old style" property sheet. I have adapted the ContainerShapeEditPart to an IPropertySource by registering an adapter factory with the platform adapter manager. The adapter factory I created serves a PropertySource for my model objects. Problem is I can not get this to work - the property view gets notified of selection changes in the graph, but never asks for the IPropertySource interface, so my adapter factory is never called. I have checked that a SelectionProvider is already registered with the DiagramEditor (selection provider is a org.eclipse.graphiti.ui.internal.editor.GraphitiScrollingGraphicalViewer).

Do you possibly have some source code (or comments) you could send that shows how you got this to work?

Jakob

Re: IPictogramElementDelegate & AdvancedPropertySection [message #761532 is a reply to message #761522] Tue, 06 December 2011 15:53 Go to previous messageGo to next message
Rhett Hudson is currently offline Rhett HudsonFriend
Messages: 43
Registered: September 2010
Member
That all sounds right. The only thing I can suggest off-hand is that one of the type filters for determining whether your factory is the factory that should be asked for an adapter is setup to filter the wrong type. Sometimes when I suspect that, I turn off all the type filtering and watch the object that gets passed in the debugger or a log message to make sure I understand what type it really is.
Re: IPictogramElementDelegate & AdvancedPropertySection [message #762168 is a reply to message #761532] Wed, 07 December 2011 16:35 Go to previous message
Jakob  is currently offline Jakob Friend
Messages: 6
Registered: November 2011
Junior Member
Hi,

I can't get it to work that way - in the end I had to overload the getAdapter() method in DiagramEditorInternal and on request to adapt IPropertySheetPage.class I return an old style PropertySheetPage rather than the TabbedPropertySheetPage returned by default. By doing that the EditPart getAdapter() will finally receive requests to adapt IPropertySource.

Jakob
Previous Topic:Saving domain & pictogram models in my own format
Next Topic:Overlapping Connections
Goto Forum:
  


Current Time: Tue Apr 23 18:01:59 GMT 2024

Powered by FUDForum. Page generated in 0.04322 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top