|
Re: howto handle double click in commonnavigator view [message #326149 is a reply to message #326059] |
Sat, 08 March 2008 20:20 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Francis Upton IV![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=francisu%40ieee.org) Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
You will need to not use the navigator's default open handler, and then
add a double click listener directly to the viewer associated with the
navigator:
CommonViewer viewer = navigator.getCommonViewer();
viewer.addDoubleClickListener(<your listener>);
For your plugin.xml, do something like this to avoid getting the open
handler (this also does not pick up the new handler as well):
<extension
id="com.oaklandsw.transform.rcpViewer"
point="org.eclipse.ui.navigator.viewer">
<viewerActionBinding
viewerId="com.oaklandsw.gui.navigator">
<includes>
<actionExtension pattern="com.oaklandsw.gui.*" />
<actionExtension pattern="com.oaklandsw.transform.*" />
<!-- we have to name all of these separately, since we don't
want NewActions nor OpenActions -->
<actionExtension
pattern="org.eclipse.ui.navigator.resources.EditActions" />
<actionExtension
pattern="org.eclipse.ui.navigator.resources.RefactorActions " />
<actionExtension
pattern="org.eclipse.ui.navigator.resources.UndoRedoActionProvider " />
<actionExtension
pattern="org.eclipse.ui.navigator.resources.PortingActions" />
<actionExtension
pattern="org.eclipse.ui.navigator.resources.PropertiesActionProvider " />
<actionExtension
pattern=" org.eclipse.ui.navigator.resources.WorkManagementActionProvi der " />
<actionExtension
pattern="org.eclipse.ui.navigator.resources.ResourceMgmtActions " />
<actionExtension
pattern="org.eclipse.ui.navigator.resources.WorkingSetActionProvider " />
</includes>
<excludes>
<!-- exclude everything not specifically included -->
<actionExtension
pattern="org.eclipse.ui.navigator.resources.NewActions" />
<actionExtension
pattern="org.eclipse.ui.navigator.resources.OpenActions" />
</excludes>
</viewerActionBinding>
<viewerContentBinding viewerId="com.oaklandsw.gui.navigator">
<includes>
<contentExtension
pattern="com.oaklandsw.transform.navigatorContent"/>
<contentExtension
pattern="org.eclipse.ui.navigator.resourceContent" />
<contentExtension
pattern="org.eclipse.ui.navigator.resources.filters.*"/>
<contentExtension
pattern="org.eclipse.ui.navigator.resources.linkHelper"/>
<contentExtension
pattern="org.eclipse.ui.navigator.resources.workingSets"/>
</includes>
</viewerContentBinding>
</extension>
Andreas Pakulat wrote:
> Hi,
>
> I've got a CommonNavigator view with my own content provider and I'm
> wondering how I should handle opening files I have in my tree via
> double-clicking? Those files are not IFile instances so it doesn't work out
> of the box and I'm a bit lost how to tell the navigator view to simply open
> an editor for them...
>
> Andreas
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
Powered by
FUDForum. Page generated in 0.02900 seconds