Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » howto handle double click in commonnavigator view
howto handle double click in commonnavigator view [message #326059] Thu, 06 March 2008 15:56 Go to next message
Andreas Pakulat is currently offline Andreas PakulatFriend
Messages: 127
Registered: July 2009
Senior Member
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
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
Francis Upton IV is currently offline Francis Upton IVFriend
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


Previous Topic:Closing editor and focus events
Next Topic:No Products Available in Launcher To Launch a Product
Goto Forum:
  


Current Time: Thu Jul 18 04:26:28 GMT 2024

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

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

Back to the top