Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Disable copy option
Disable copy option [message #336528] Fri, 19 June 2009 08:38 Go to next message
Vikas Goyal is currently offline Vikas Goyal
Messages: 34
Registered: July 2009
Member
Hi ,

I want to disable copy option in my plugin for file with some particular
extension. Even copy functionality (CTRL+C) should not work for those
file. Could someone please suggest how I can achieve this?

Thanks in advance.

Best Regards,
Vikas
Re: Disable copy option [message #336530 is a reply to message #336528] Fri, 19 June 2009 09:50 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6850
Registered: July 2009
Location: Ottawa
Senior Member

The copy handler has a default (widget copy) but the pattern is each
view or editor contributes their own copy handler.

To prevent copying while in your view, simply provide a copy handler
that doesn't do anything.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Disable copy option [message #336841 is a reply to message #336530] Tue, 07 July 2009 06:18 Go to previous messageGo to next message
Vikas Goyal is currently offline Vikas Goyal
Messages: 34
Registered: July 2009
Member
Hi ,
Thanks for your reply. How I can disable copy in package explorer view.

Best Regards,
Vikas
Re: Disable copy option [message #336860 is a reply to message #336841] Wed, 08 July 2009 08:22 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6850
Registered: July 2009
Location: Ottawa
Senior Member

Vikas Goyal wrote:
> Hi , Thanks for your reply. How I can disable copy in package explorer
> view.

You can't, it's not your view.

What are you trying to do, exactly? What usecase do you have that
requires copy to suddenly stop working in the Package Explorer?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Disable copy option [message #337012 is a reply to message #336860] Tue, 21 July 2009 00:55 Go to previous messageGo to next message
Vikas Goyal is currently offline Vikas Goyal
Messages: 34
Registered: July 2009
Member
Hi ,
My exact requirnment is I select one file to copy, one more file which
is not selected by the me should also get copied along with the selected
file and during paste both of these file should get pasted . The selected
file has a dependency on the other file which I want to copy
automatically. I want this operation in package explorer view. I saw many
examples for this , but for me I am not able to get the control of
copyAction. Can you please help me on this? If I can't do this than I need
to disable the copy operation.

If there is any example for such case , that would be really nice .

Best Regards,
Vikas
Re: Disable copy option [message #337015 is a reply to message #337012] Tue, 21 July 2009 06:23 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.
Messages: 621
Registered: July 2009
Senior Member
Vikas Goyal wrote:
> Hi ,
> My exact requirnment is I select one file to copy, one more file
> which is not selected by the me should also get copied along with the
> selected file and during paste both of these file should get pasted .
> The selected file has a dependency on the other file which I want to
> copy automatically. I want this operation in package explorer view. I
> saw many examples for this , but for me I am not able to get the control
> of copyAction. Can you please help me on this? If I can't do this than I
> need to disable the copy operation.

Say I'm your user. I copy a file in Package Explorer and paste it in
another location. Instead of one file getting pasted, I get two
different files getting pasted. Won't this be confusing to me?

- Prakash

---
http://blog.eclipse-tips.com
Re: Disable copy option [message #337026 is a reply to message #337015] Tue, 21 July 2009 23:31 Go to previous message
Vikas Goyal is currently offline Vikas Goyal
Messages: 34
Registered: July 2009
Member
Hi,
My another file is hidden from the user. This exact requirnment is with
respect to GMF, where we have separate model and diagram file. My model
file is hidden with a filter. but if user copy only diagram file this will
not work. So I want when user copy diagram file it should automatically
copy model file as well . So that my diagram file work properly.

Best Regards,
Vikas
Previous Topic:How to filter context menu action according to Build Automatically setting
Next Topic:mirror ganymede fails with 404 Not Found
Goto Forum:
  


Current Time: Thu Apr 17 20:53:35 EDT 2014

Powered by FUDForum. Page generated in 0.04567 seconds