Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » DELEGATE DoubleClick to my class(DELEGATE DoubleClick to my class)
DELEGATE DoubleClick to my class [message #715134] Fri, 12 August 2011 09:38 Go to next message
Eclipse UserFriend
Hi,
I am using Nessi2, an RCP application. It is much like eclipse, projects etc. I want to change the double click listener when it is clicked from the resource navigator in the left side of the application. In this navigator, there are my projects, and for example when one clicks a text file, i want to open an editor with an image embedded in it. But i could not find my way to handle this. is there a way to delegate this open command to my function/class?
Thanks in advance.
Re: DELEGATE DoubleClick to my class [message #715196 is a reply to message #715134] Fri, 12 August 2011 13:11 Go to previous messageGo to next message
Eclipse UserFriend
Are you using the ResourceNavigator or CommonNavigator?
Re: DELEGATE DoubleClick to my class [message #715310 is a reply to message #715196] Sat, 13 August 2011 04:42 Go to previous messageGo to next message
Eclipse UserFriend
Nessi2 is using CommonNavigator, i dont have direct access to this CommonNavigator instance. when i am creating a new view, i am parsing IViewPart instances and find CommonNavigator. At this time, i can attach a doubleclick listener to the CommonNavigator, but it still runs its former action listeners(opening respective editors etc) and my listener too. Can i remove already registered listeners and register mine? and can i do this at the start of the RCP application, not in the creation of a view? I am new to RCP programming, sorry for the misleading statements.

Here is the code i used for registration of doubleclick listener:
IViewPart [] parts = this.getSite().getWorkbenchWindow().getActivePage().getViews();
for(int i=0;i<parts.length;i++)
{
if(parts[i] instanceof CommonNavigator)
{
CommonNavigator navigator = (CommonNavigator)parts[i];
StructuredSelection sel =
(StructuredSelection)navigator.getCommonViewer().getSelection();
IResource resource = (IResource)sel.getFirstElement();
activeProject = resource.getProject();

navigator.getCommonViewer().addDoubleClickListener(new IDoubleClickListener() {

@Override
public void doubleClick(DoubleClickEvent event) {
System.out.println("DoubleClickEvent");

}
});
break;
}
}

Re: DELEGATE DoubleClick to my class [message #715764 is a reply to message #715310] Mon, 15 August 2011 08:51 Go to previous messageGo to next message
Eclipse UserFriend
hi,
does anybody have a opinion about the topic?
thanks in advance.
Re: DELEGATE DoubleClick to my class [message #715815 is a reply to message #715764] Mon, 15 August 2011 11:58 Go to previous messageGo to next message
Eclipse UserFriend
On 15.08.2011 14:51, slayer wrote:
> hi,
> does anybody have a opinion about the topic?
Did you try to register your editor for the files you want to open?

Dani
> thanks in advance.
>
Re: DELEGATE DoubleClick to my class [message #715986 is a reply to message #715815] Tue, 16 August 2011 03:08 Go to previous messageGo to next message
Eclipse UserFriend
no, how can i achieve that?
Re: DELEGATE DoubleClick to my class [message #716383 is a reply to message #715986] Wed, 17 August 2011 04:09 Go to previous message
Eclipse UserFriend
On 16.08.2011 09:08, slayer wrote:
> no, how can i achieve that?
Take a look at the 'org.eclipse.ui.editors' extension point.

Dani
Previous Topic:custom decorator (lightweight or not) overwrites marker in project tree
Next Topic:Using the view/perspective concept separately
Goto Forum:
  


Current Time: Thu Jul 24 16:53:53 EDT 2025

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

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

Back to the top