|
Re: Make context buttons API and components accessible to clients. [message #554161 is a reply to message #554136] |
Fri, 20 August 2010 11:08 |
Michael Wenz Messages: 1931 Registered: July 2009 Location: Walldorf, Germany |
Senior Member |
|
|
Actually you can already achieve your use case. You can define a "multi"
connection entry for the palette that opens a menu when the target from the
connection was selected. In your case you would define a generic connection
tool, that contains all the specific ones and the user can then select from
those.
Here's a code snippet that collects all create connection features into such
an entry (to be placed into the ToolBehaviorProvider method
getPaletteCompartments). If you define only icons and no texts for the
create connection features it will still appear as menu but look very
similar to the contect buttons. If you see the need for supporting real
contect buttons there or have other use cases, simply open a Bugzilla with
that request.
ConnectionCreationToolEntry multiTool = null;
if (createConnectionFeatures.length > 1) {
multiTool = new ConnectionCreationToolEntry("Connection", "dynamic
connection", null, null);
connectionsCompartmentEntry.addToolEntry(multiTool);
}
for (ICreateConnectionFeature createConnectionFeature :
createConnectionFeatures) {
ConnectionCreationToolEntry ccTool = new
ConnectionCreationToolEntry(createConnectionFeature.getCreat eName(),
createConnectionFeature.getCreateDescription(),
createConnectionFeature.getCreateImageId(),
createConnectionFeature.getCreateLargeImageId());
ccTool.addCreateConnectionFeature(createConnectionFeature);
if (multiTool != null) {
multiTool.addCreateConnectionFeature(createConnectionFeature );
}
connectionsCompartmentEntry.addToolEntry(ccTool);
}
-Michael
"Ken Wenzel" <kenwenzel@gmx.net> wrote in message
news:i4limf$doc$1@build.eclipse.org...
> Hello,
>
> it would save a lot of work and/or duplicate code if Graphiti would expose
> its context buttons API and implementations to clients.
>
> A use case could be the proposal of appropriate connection types after a
> user created a connection with a generic connection tool.
>
> Best regards,
>
> Ken
|
|
|
Re: Make context buttons API and components accessible to clients. [message #563713 is a reply to message #554136] |
Fri, 20 August 2010 11:08 |
Michael Wenz Messages: 1931 Registered: July 2009 Location: Walldorf, Germany |
Senior Member |
|
|
Actually you can already achieve your use case. You can define a "multi"
connection entry for the palette that opens a menu when the target from the
connection was selected. In your case you would define a generic connection
tool, that contains all the specific ones and the user can then select from
those.
Here's a code snippet that collects all create connection features into such
an entry (to be placed into the ToolBehaviorProvider method
getPaletteCompartments). If you define only icons and no texts for the
create connection features it will still appear as menu but look very
similar to the contect buttons. If you see the need for supporting real
contect buttons there or have other use cases, simply open a Bugzilla with
that request.
ConnectionCreationToolEntry multiTool = null;
if (createConnectionFeatures.length > 1) {
multiTool = new ConnectionCreationToolEntry("Connection", "dynamic
connection", null, null);
connectionsCompartmentEntry.addToolEntry(multiTool);
}
for (ICreateConnectionFeature createConnectionFeature :
createConnectionFeatures) {
ConnectionCreationToolEntry ccTool = new
ConnectionCreationToolEntry(createConnectionFeature.getCreat eName(),
createConnectionFeature.getCreateDescription(),
createConnectionFeature.getCreateImageId(),
createConnectionFeature.getCreateLargeImageId());
ccTool.addCreateConnectionFeature(createConnectionFeature);
if (multiTool != null) {
multiTool.addCreateConnectionFeature(createConnectionFeature );
}
connectionsCompartmentEntry.addToolEntry(ccTool);
}
-Michael
"Ken Wenzel" <kenwenzel@gmx.net> wrote in message
news:i4limf$doc$1@build.eclipse.org...
> Hello,
>
> it would save a lot of work and/or duplicate code if Graphiti would expose
> its context buttons API and implementations to clients.
>
> A use case could be the proposal of appropriate connection types after a
> user created a connection with a generic connection tool.
>
> Best regards,
>
> Ken
|
|
|
Powered by
FUDForum. Page generated in 0.03226 seconds