Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Enabling and Disabling Paste Icons(Enabling and Disabling Paste Icons based on Clipboard contents)
Enabling and Disabling Paste Icons [message #510268] Wed, 27 January 2010 01:24 Go to next message
Dhinesh is currently offline DhineshFriend
Messages: 10
Registered: January 2010
Junior Member

Hello Folks,

I have developed a plug-in for doing copy-Paste feature to copy and paste a particular Object. It is a seperate plug-in. Both Copy and Paste are associated with a View that is contributed by a different plug-in.

So, in short to mention the Plug-in details.

Copy/Paste contributed by com.a.b --> Seperate.
View is provided by com.c.d ->> Seperate

I have used Eclipse copy/paste actions..i.e org.eclipse.ui.copyaction and org.eclipse.ui.pasteaction. I have contributed a pop-up menu Extensions mentioning the action IDs.
Basically Copy/paste works fine,but I want to enable and disable the actions based on the Clipboard contents.

I have written the code in selectionChanged() event of the action class. It's getting fired only when this plug-in is loaded. Until then, the paste action is enabled eventhough there is no relevant data to be pasted.

Now I want to disable it when the Eclipse is launced.

Could anyone of you pls help me with this problem.

Thanks in Advance,
Dhinesh.M
Re: Enabling and Disabling Paste Icons [message #510470 is a reply to message #510268] Wed, 27 January 2010 15:19 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Dhinesh wrote:
> I have written the code in selectionChanged() event of the action class.
> It's getting fired only when this plug-in is loaded. Until then, the
> paste action is enabled eventhough there is no relevant data to be pasted.
>
> Now I want to disable it when the Eclipse is launced.
>
> Could anyone of you pls help me with this problem.

There's no easy answer to this problem. The eclipse general policy is
1) load it later on a user action and 2) not loaded == enabled (most cases).

Because of #1 you need #2 (or your user could never try the action to
load it :-)

The first time it is executed it must call selection changed before it
will run, so if you set it to disabled does the action still run?

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/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:Event or function called when user switches to other editor in same editor area.
Next Topic:Removing Keybinding Schemes and bindings
Goto Forum:
  


Current Time: Sat Apr 20 00:08:53 GMT 2024

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

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

Back to the top