Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Change default file name in the "Save as image dialog"
Change default file name in the "Save as image dialog" [message #163239] Thu, 29 November 2007 11:29 Go to next message
Eclipse UserFriend
Originally posted by: andreas.behnke1.gmx.de

Hello,

I want to change the behavior of the command "Save as Image File" in the
context menu of my diagram in this way: Give the default file name based
on a feature of my diagrams model element. I can not find the extension
point of this context menu, where can I find it? Is this extension part
of the generated code?

Thanks in advance,
Andreas
Re: Change default file name in the "Save as image dialog" [message #163328 is a reply to message #163239] Thu, 29 November 2007 16:53 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Andreas,

The CopyToImageDialog class constructor takes a default filename, but
this class is internal. You can request to make it public if you want.
The CopyToImageAction constructs the dialog. You could remove the
default CopyToImageAction contribution and add your own subclass. You
would accomplish this with the Contribution Item Service.

- Cherie

Andreas Behnke wrote:
> Hello,
>
> I want to change the behavior of the command "Save as Image File" in the
> context menu of my diagram in this way: Give the default file name based
> on a feature of my diagrams model element. I can not find the extension
> point of this context menu, where can I find it? Is this extension part
> of the generated code?
>
> Thanks in advance,
> Andreas
Re: Change default file name in the "Save as image dialog" [message #163336 is a reply to message #163328] Thu, 29 November 2007 17:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andreas.behnke1.gmx.de

Hi Cherie,

I can only find the extension point
" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ".

Is this the correct extension?

> Andreas,
>
> The CopyToImageDialog class constructor takes a default filename, but
> this class is internal. You can request to make it public if you want.
> The CopyToImageAction constructs the dialog. You could remove the
> default CopyToImageAction contribution and add your own subclass. You
> would accomplish this with the Contribution Item Service.
>
> - Cherie
>
> Andreas Behnke wrote:
>> Hello,
>>
>> I want to change the behavior of the command "Save as Image File" in
>> the context menu of my diagram in this way: Give the default file name
>> based
>> on a feature of my diagrams model element. I can not find the
>> extension point of this context menu, where can I find it? Is this
>> extension part
>> of the generated code?
>>
>> Thanks in advance,
>> Andreas
Re: Change default file name in the "Save as image dialog" [message #163469 is a reply to message #163336] Fri, 30 November 2007 13:51 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Andreas,

Yes. You can look at some of the examples code to see how it is used.

- Cherie

Andreas Behnke wrote:
> Hi Cherie,
>
> I can only find the extension point
> " org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ".
>
> Is this the correct extension?
>
>> Andreas,
>>
>> The CopyToImageDialog class constructor takes a default filename, but
>> this class is internal. You can request to make it public if you
>> want. The CopyToImageAction constructs the dialog. You could
>> remove the default CopyToImageAction contribution and add your own
>> subclass. You would accomplish this with the Contribution Item Service.
>>
>> - Cherie
>>
>> Andreas Behnke wrote:
>>> Hello,
>>>
>>> I want to change the behavior of the command "Save as Image File" in
>>> the context menu of my diagram in this way: Give the default file
>>> name based
>>> on a feature of my diagrams model element. I can not find the
>>> extension point of this context menu, where can I find it? Is this
>>> extension part
>>> of the generated code?
>>>
>>> Thanks in advance,
>>> Andreas
Re: Change default file name in the "Save as image dialog" [message #163591 is a reply to message #163469] Sat, 01 December 2007 21:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andreas.behnke1.gmx.de

Hi Cherie,

I could not find any example code which could help for my problem. I
have only one extension point
org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders
in my plugin.xml which makes a popup contribution for a special diagram
element. You wrote I should remove the default "CopyToImageAction"
contribution. The following questions arise when trying to do this:
Where can I find the correct ID of this contribution?
What is the path to this contribution?
Are the default contributions documented in the GMF reference documentation?
Is it possible to start without any default contributions?

Please give me a hint for a good example or documentation.

Andreas


The generated extension point:

[...]
<extension
point=" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ">
<?gmfgen generated="false"?>
<contributionItemProvider

class=" org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContribu tionItemProvider "
checkPluginLoaded="false">
<Priority name="Low"/>
<popupContribution
class=" org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextM enuProvider ">
<popupStructuredContributionCriteria
objectClass=" com.behnke.ebpm.businessusecase.edit.parts.BusinessUseCaseRe latedScenariosEditPart "/>
<popupAction path="/editGroup" id="deleteFromModelAction"/>
<popupPredefinedItem id="deleteFromDiagramAction"
remove="true"/>
</popupContribution>
</contributionItemProvider>
</extension>

[...]

Cherie Revells schrieb:
> Andreas,
>
> Yes. You can look at some of the examples code to see how it is used.
>
> - Cherie
>
> Andreas Behnke wrote:
>> Hi Cherie,
>>
>> I can only find the extension point
>> " org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ".
>>
>> Is this the correct extension?
>>
>>> Andreas,
>>>
>>> The CopyToImageDialog class constructor takes a default filename, but
>>> this class is internal. You can request to make it public if you
>>> want. The CopyToImageAction constructs the dialog. You could
>>> remove the default CopyToImageAction contribution and add your own
>>> subclass. You would accomplish this with the Contribution Item Service.
>>>
>>> - Cherie
>>>
>>> Andreas Behnke wrote:
>>>> Hello,
>>>>
>>>> I want to change the behavior of the command "Save as Image File" in
>>>> the context menu of my diagram in this way: Give the default file
>>>> name based
>>>> on a feature of my diagrams model element. I can not find the
>>>> extension point of this context menu, where can I find it? Is this
>>>> extension part
>>>> of the generated code?
>>>>
>>>> Thanks in advance,
>>>> Andreas
Re: Change default file name in the "Save as image dialog" [message #163732 is a reply to message #163591] Mon, 03 December 2007 14:42 Go to previous messageGo to next message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Andreas,

> Where can I find the correct ID of this contribution?
If you search for references of CopyToImageAction you will find it
contributed by DiagramUIRenderContributionItemProvider with the id
"CopyToImageAction".

> What is the path to this contribution?
In the org.eclipse.gmf.runtime.diagram.ui.render plugin's plugin.xml
file you will see where it is contributed.

> Are the default contributions documented in the GMF reference
> documentation?
Not that I am aware of.

> Is it possible to start without any default contributions?
No, but it has been requested before:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=111221

The Contribution Item Service schema provides documentation on removing
predefined items. See "popupPredefinedItem". I am almost certain you
will find examples of this in some of the generated examples, but I
could be wrong.

Regardless of all this, you are still going to have the problem that the
CopyToImageDialog class is internal.

In my opinion, if you are doing any significant customizations of the
GMF Runtime that are not covered by the examples, it is easiest to learn
by looking at the GMF code itself.

- Cherie

Andreas Behnke wrote:
> Hi Cherie,
>
> I could not find any example code which could help for my problem. I
> have only one extension point
> org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders
> in my plugin.xml which makes a popup contribution for a special diagram
> element. You wrote I should remove the default "CopyToImageAction"
> contribution. The following questions arise when trying to do this:
> Where can I find the correct ID of this contribution?
> What is the path to this contribution?
> Are the default contributions documented in the GMF reference
> documentation?
> Is it possible to start without any default contributions?
>
> Please give me a hint for a good example or documentation.
>
> Andreas
>
>
> The generated extension point:
>
> [...]
> <extension
> point=" org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ">
>
> <?gmfgen generated="false"?>
> <contributionItemProvider
>
> class=" org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContribu tionItemProvider "
>
> checkPluginLoaded="false">
> <Priority name="Low"/>
> <popupContribution
> class=" org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextM enuProvider ">
>
> <popupStructuredContributionCriteria
> objectClass=" com.behnke.ebpm.businessusecase.edit.parts.BusinessUseCaseRe latedScenariosEditPart "/>
>
> <popupAction path="/editGroup" id="deleteFromModelAction"/>
> <popupPredefinedItem id="deleteFromDiagramAction"
> remove="true"/>
> </popupContribution>
> </contributionItemProvider>
> </extension>
>
> [...]
>
> Cherie Revells schrieb:
>> Andreas,
>>
>> Yes. You can look at some of the examples code to see how it is used.
>>
>> - Cherie
>>
>> Andreas Behnke wrote:
>>> Hi Cherie,
>>>
>>> I can only find the extension point
>>> " org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders ".
>>>
>>> Is this the correct extension?
>>>
>>>> Andreas,
>>>>
>>>> The CopyToImageDialog class constructor takes a default filename,
>>>> but this class is internal. You can request to make it public if
>>>> you want. The CopyToImageAction constructs the dialog. You could
>>>> remove the default CopyToImageAction contribution and add your own
>>>> subclass. You would accomplish this with the Contribution Item
>>>> Service.
>>>>
>>>> - Cherie
>>>>
>>>> Andreas Behnke wrote:
>>>>> Hello,
>>>>>
>>>>> I want to change the behavior of the command "Save as Image File"
>>>>> in the context menu of my diagram in this way: Give the default
>>>>> file name based
>>>>> on a feature of my diagrams model element. I can not find the
>>>>> extension point of this context menu, where can I find it? Is this
>>>>> extension part
>>>>> of the generated code?
>>>>>
>>>>> Thanks in advance,
>>>>> Andreas
Re: Change default file name in the "Save as image dialog" [message #164032 is a reply to message #163732] Tue, 04 December 2007 10:12 Go to previous message
Eclipse UserFriend
Originally posted by: andreas.behnke1.gmx.de

Hi Cherie,

> In my opinion, if you are doing any significant customizations of the
> GMF Runtime that are not covered by the examples, it is easiest to learn
> by looking at the GMF code itself.

I will take your advice. At the moment I only managed to add a new
action to the popup menu with the org.eclipse.ui.popupmenus extension
point. Any contributions to
org.eclipse.gmf.runtime.common.ui.services.action.contributi onItemProviders
were without any effect, don't know what I am missing. I will report
back if I have a working solution.

Thanks,
Andreas
Previous Topic:Link cross the nodes
Next Topic:Programatically using a Label
Goto Forum:
  


Current Time: Thu Sep 26 17:47:08 GMT 2024

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

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

Back to the top