Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Over riding copy paste
Over riding copy paste [message #336128] Mon, 25 May 2009 08:47 Go to next message
Vikas Goyal is currently offline Vikas GoyalFriend
Messages: 34
Registered: July 2009
Member
Hi ,

I want to override the eclipse file copy/paste operation. My exact
requirnment is I want to copy one additional file (which is not selected
for copy)when I perform copy operation on a file. During paste I want to
paste both the file to be pasted (the one which I selected and the other
one which I copied by overridng copy operation). Can some one please
suggest me how I can achieve this.

Thanks in Advance

Best Regards,
Vikas
Re: Over riding copy paste [message #336170 is a reply to message #336128] Wed, 27 May 2009 19:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Vikas Goyal wrote:
> Hi ,
>
> I want to override the eclipse file copy/paste operation.

Are you using the Common Navigator Framework? If so, there are some
tutorials/examples available at
http://wiki.eclipse.org/index.php/Common_Navigator_Framework

The gist is that you can use the
org.eclipse.ui.navigator.navigatorContent extension point, specifying an
actionProvider that overrides
org.eclipse.ui.navigator.resources.actions.EditActions.

If you're not using CNF, then maybe these articles can get you started:
http://www.eclipse.org/resources/?category=Actions

Hope this helps,
Eric
Re: Over riding copy paste [message #336319 is a reply to message #336170] Mon, 08 June 2009 10:23 Go to previous message
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 should i override PackageExplorerActionGroup if so how shud tat
be done as it did not work when used just like EditActionGroup.

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:How to tailor the Conext menu of text editor?
Next Topic:CNF: Eclipse copy/cut/paste override
Goto Forum:
  


Current Time: Thu Apr 25 00:07:46 GMT 2024

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

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

Back to the top