Re: Edit, Cut, Copy [message #484053] |
Fri, 04 September 2009 05:46 |
Neha Messages: 52 Registered: July 2009 |
Member |
|
|
Hi Kevin,
You can create a handler for the command and use a "activewhen" clause for
it.
I did something similar in my application. But one thing dont forget to
register your widget with the focus tracker.
for instance I m using it on a table. Below is a sample code if it can help
you
IFocusService service = (IFocusService) getSite().getService(
IFocusService.class);
service.addFocusTracker(tableLRFields, "LRFieldTable");
<extension
point="org.eclipse.ui.handlers">
<handler
class="com.ibm.safr.we.ui.commands.EditHandler"
commandId="org.eclipse.ui.edit.copy">
<activeWhen>
<with
variable="activeFocusControlId">
<equals
value="LRFieldTable">
</equals>
</with>
</activeWhen>
</handler>
----- Original Message -----
From: "Kevin Pollet" <pollet.kevin@gmail.com>
Newsgroups: eclipse.platform.rcp
Sent: Wednesday, June 17, 2009 6:23 PM
Subject: Edit, Cut, Copy
> Hi,
>
> I have an eclipse application. I want to put the default eclipse command
> in it. For example for the copy menu I have extented the
> org.eclipse.ui.menus anp put a command with id org.eclipse.ui.edit.copy.
>
> My problem is that menu is already active why ?
>
> Best regards,
> Kevin
"Kevin Pollet" <pollet.kevin@gmail.com> wrote in message
news:9b8f79731194bc6a0ea07f98297bd487$1@www.eclipse.org...
> Hi,
>
> First thanks for your response.
>
> I have a question.
>
> It's necessary to register the edit,copy, paste ... action in the
> ActionBarAdvisor with the register action ?
> If i do this all menu are disabled, and i can enable this by creating an
> handler.
>
> It's a wrong way to do add global edit action in an Eclipse RCP
> application.
>
> Best regards,
> Kevin
>
|
|
|
Powered by
FUDForum. Page generated in 0.03593 seconds