Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » CNF: Eclipse copy/cut/paste override
CNF: Eclipse copy/cut/paste override [message #336321] Mon, 08 June 2009 12:57
sowmya Mising name is currently offline sowmya Mising nameFriend
Messages: 51
Registered: July 2009
Member
Hi ,
I wanted to override the copy action when right click on a file in
project explorer view. I am trying to override by using the extension
point =org.eclipse.ui.navigator.navigatorContent in my plugin.xml file.And
provide my own 'CopyActionProvider' this extends CommonActionProvider.

My requirement is that whenever I right click on files with for example:
'.txt' extension and select copy then then my copy action should be
executed. This should be from Package Explorer view.


In my plugin file the navigator content extension code is as below. I am
not able to get the control in to my own copy action class . Using
overrides="org.eclipse.ui.navigator.resources.actions.EditActions " also
did not help. Should I override PackageExplorerActionGroup if so how
should that be done as it did not work when used just like EditActionGroup.

In the fillActionBar method of the CopyActionProvider class , copy action
has been set and - myCopyAction is object of my class that extends
'Action' class.



public void fillActionBars(IActionBars actionBars) {

super.fillActionBars(actionBars);

actionBars.setGlobalActionHandler(ActionFactory.COPY.getId() ,
myCopyAction);

}



I have pasted the piece of code from my plugin.xml file, where i am
extending navigator content. can anybody tell me wat s wrong here . below
is the code


-- code --

<extension point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
id="myExample.id.resourceContent"
name="%myCopyActionName" priority="normal"
contentProvider="myExample.myNavigatorContentProvider"
labelProvider="myExample.myNavigatorLabelProvider"
icon="myicon.gif"
activeByDefault="true">
<triggerPoints>
<or>
<and>
<instanceof value="org.eclipse.core.resources.IFile"/>
<test property="org.eclipse.core.resources.extension"
value=".txt"/>
</and>
<instanceof value="myExample.MyAbstractNavigatorItem"/>
</or>
</triggerPoints>
<possibleChildren>
<or>
<instanceof value="MyExample.MyAbstractNavigatorItem"/>
</or>
</possibleChildren>
<actionProvider
id="MyExample.MynavigatorActionProvider"
class="MyExample.MyCopyActionNavigatorActionProvider">
<enablement>
<or>
<instanceof value="MyExample.MyAbstractNavigatorItem"/>
</or>
</enablement>
</actionProvider> </navigatorContent>
</extension>
Previous Topic:Over riding copy paste
Next Topic:getWebBrowser returns null
Goto Forum:
  


Current Time: Fri Apr 19 20:01:00 GMT 2024

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

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

Back to the top