Popupmenus and Adapters [message #294205] |
Mon, 07 November 2005 04:42  |
Eclipse User |
|
|
|
Originally posted by: news.karsten-becker.de
Hi,
I wrote the following contribution:
<extension
point="org.eclipse.core.runtime.adapters">
<factory
adaptableType="com.siemens.ct.mp3manager.IMp3FileAdapter"
class="com.siemens.ct.mp3manager.IFileAdapter.FileAdapterFactory ">
<adapter type="org.eclipse.core.resources.IResource"/>
</factory>
</extension>
<extension
point="org.eclipse.ui.popupMenus">
<objectContribution
adaptable="true"
id="com.siemens.ct.mp3manager.IFileAdapter.contribution1"
objectClass="org.eclipse.core.resources.IResource">
<menu
id="com.siemens.ct.mp3manager.IFileAdapter.menu1"
label="New Submenu"
path="additions">
<separator name="group1"/>
</menu>
<action
class=" com.siemens.ct.mp3manager.IFileAdapter.popup.actions.NewActi on "
enablesFor="1"
id="com.siemens.ct.mp3manager.IFileAdapter.newAction"
label="New Action"
menubarPath="com.siemens.ct.mp3manager.IFileAdapter.menu1/group1 "/>
</objectContribution>
</extension>
But unfortunately the popupmenu does not get shown when I set
objectClass to IResource, even with this adapter registered. But when I
change IResource to IMp3FileAdapter then it works perfectly... I looked
at the Adapterfactory, and the factory seemed to be registered correctly.
Any hint?
Karsten
|
|
|
|
Re: Popupmenus and Adapters [message #294226 is a reply to message #294218] |
Mon, 07 November 2005 09:42  |
Eclipse User |
|
|
|
Originally posted by: news.karsten-becker.de
Hi Michael,
Thanks for your hint. I'm currently working on a RCP-Project. So I
brought in the RN, and before I activate it the first time, my menu will
not get shown. But after activating it, it does...
So I guess the RN does something that is necessary to do before the
adaptable contributions will get shown.
But there is another oddity. Why am I not becoming the CutCopyPaste
Delete Move contributions?
Any more hints?
Karsten
Michael Valenta wrote:
> Karsten,
>
> I can't see anything obviously wrong with the XML. When you set
> objectClass to IResource, does your menu appear when an IResource is
> selected (i.e. in the Resource Navigator)? Do you have a view that is
> showing your model object? In this view, does the Team menu appear?
>
> Michael
>
> Karsten Becker wrote:
>> Hi,
>> I wrote the following contribution:
>> <extension
>> point="org.eclipse.core.runtime.adapters">
>> <factory
>> adaptableType="com.siemens.ct.mp3manager.IMp3FileAdapter"
>>
>> class="com.siemens.ct.mp3manager.IFileAdapter.FileAdapterFactory ">
>> <adapter type="org.eclipse.core.resources.IResource"/>
>> </factory>
>> </extension>
>> <extension
>> point="org.eclipse.ui.popupMenus">
>> <objectContribution
>> adaptable="true"
>> id="com.siemens.ct.mp3manager.IFileAdapter.contribution1"
>> objectClass="org.eclipse.core.resources.IResource">
>> <menu
>> id="com.siemens.ct.mp3manager.IFileAdapter.menu1"
>> label="New Submenu"
>> path="additions">
>> <separator name="group1"/>
>> </menu>
>> <action
>>
>> class=" com.siemens.ct.mp3manager.IFileAdapter.popup.actions.NewActi on "
>> enablesFor="1"
>> id="com.siemens.ct.mp3manager.IFileAdapter.newAction"
>> label="New Action"
>>
>> menubarPath="com.siemens.ct.mp3manager.IFileAdapter.menu1/group1 "/>
>> </objectContribution>
>> </extension>
>>
>> But unfortunately the popupmenu does not get shown when I set
>> objectClass to IResource, even with this adapter registered. But when
>> I change IResource to IMp3FileAdapter then it works perfectly... I
>> looked at the Adapterfactory, and the factory seemed to be registered
>> correctly.
>>
>> Any hint?
>>
>> Karsten
|
|
|
Powered by
FUDForum. Page generated in 0.05772 seconds