Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Ddding extended figures to GMF generated diagram and palette from other plugins
Ddding extended figures to GMF generated diagram and palette from other plugins [message #106628] Sat, 24 February 2007 13:18 Go to next message
Eclipse UserFriend
Hello,

im an average eclipse and GEF user which is now seeking to learn GMF. I
think this project is really awesome, although i have a question about how
to perform what i need.

My goal is to create an abstract figure/editpart that can be extended to
create a large quantity of figures that share the same look while still
contributing some UI variations. For example, i could create a base figure
called BaseFigure (in the ECore model), and from there create figures A
and B that would extend this figure and be visible in the palette as Tool
A and Tool B.

My question is: how can i make it so that other plugins could contribute
their own extended figures (i.e. figure C in another plugin, adding the
tool 'Create C' to the palette) to the diagram and make them dynamically
added to the palette? from what i see, the GMF generated diagram code
seems to hardcode the palette content from the models. But in my case, the
number of tools and figures that derive from this abstract figure is
unknown and added at runtime (application start).

I also took a look at the elementTypes extension point, but it does not
seem to be taken into account by the diagram code generated from the GMF.
Am i missing something?

I greatly thank you for the help!! This GMF project is truly amazing!
Re: Ddding extended figures to GMF generated diagram and palette from other plugins [message #106807 is a reply to message #106628] Mon, 26 February 2007 07:49 Go to previous messageGo to next message
Eclipse UserFriend
Hello Jean-Denis Boudreault,

> make them dynamically added to the palette? from what i see, the GMF
> generated diagram code seems to hardcode the palette content from the
> models. But in my case, the number of tools and figures that derive
> from this abstract figure is unknown and added at runtime (application
> start).
Generated ???DiagramEditor.createPaletteRoot() first calls super.createPaletteRoot(existingPaletteRoot)
to load dynamic extensions to the palette.

> I also took a look at the elementTypes extension point, but it does
> not seem to be taken into account by the diagram code generated from
> the GMF. Am i missing something?
What do you mean by "not seem to be taken into account"?

-----------------
Alex Shatalin
Re: Ddding extended figures to GMF generated diagram and palette from other plug [message #106881 is a reply to message #106807] Mon, 26 February 2007 10:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex, thanks for your reply.


I did some more investigations during the last days and i can now refine
my question. I managed to add tools to the palette via the PaletteProvider
extension point. I may be getting something wrong, but it seams that i can
only contribute to the palette via this extension point, is that true?
and if so, how can i add tools to the palette from other plugins, since
from what i have seen, i can not extend this extension point from multiple
plugins? (if i do, the extension form the contributing plugin seems to
override the contribution of the diagram plugin)

as for the elementTypes, i had it all wrong, i initially thought the
palette loaded the tools from there, but i now know it is not the case.
Lots of things to master to understand EMF/GEF/GMF ;)


thanks for your help!
Re: Ddding extended figures to GMF generated diagram and palette from other plug [message #106908 is a reply to message #106881] Mon, 26 February 2007 11:06 Go to previous messageGo to next message
Eclipse UserFriend
Hello Jean-Denis Boudreault,

> PaletteProvider extension point. I may be getting something wrong, but
> it seams that i can only contribute to the palette via this extension
> point, is that true? and if so, how can i add tools to the palette
AFAIK see from the PaletteService code, all registered providers will be
executed in reversed sequence:

public static final ExecutionStrategy REVERSE =
new ExecutionStrategy("Reverse") { //$NON-NLS-1$

private static final long serialVersionUID = 1L;

public List execute(Service service, IOperation operation) {
List results = new ArrayList();

for (int i = PRIORITIES.length; --i >= 0;) {
List providers = service.getProviders(this, PRIORITIES[i], operation);

for (int j = providers.size(); --j >= 0;) {
results.add(operation.execute((IProvider) providers.get(j)));
}
}

return results;
}
};

-----------------
Alex Shatalin
Re: Ddding extended figures to GMF generated diagram and palette from other plug [message #106937 is a reply to message #106908] Mon, 26 February 2007 11:18 Go to previous message
Eclipse UserFriend
ahh! now i understand the use of the priorities on the providers.


thanks for your help Alex, helps me a great deal!



N.B.: i come from the C#/visual studio .net world and i must say, eclipse
(and all affiliated projects) rocks!! please keep it up.
Previous Topic:ShapeNodeEditPart and AbstractBorderedShapeEditPart
Next Topic:Multi Page Editor??
Goto Forum:
  


Current Time: Wed Apr 30 16:49:47 EDT 2025

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

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

Back to the top