Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » No Cut/Copy/Paste actions in swt.custom.StyledText
No Cut/Copy/Paste actions in swt.custom.StyledText [message #457543] Mon, 27 June 2005 19:04 Go to next message
Ravi is currently offline RaviFriend
Messages: 19
Registered: July 2009
Junior Member
Hi,

I have a couple of questions.

1. When i create a simple SWT Text control, and then right click on the text
control, i see about 6 actions: cut, copy, paste, selectall, delete and
undo. Where does those actions get added and their enabled state controlled?

2. When i use a StyledText control, and right click within the control, i do
not see any of the actions which we see for the Text control. Why is that
and is there a way for us to add that?

3. In our application, we use SWT widgets within a GEF canvas. When i am
within a Text or Styled Text control, i want to enable the menu actions
based the content of the clipboard. But, the workbench action's isEnabled()
method gets called only when the editorpart is activated.. Is there a way
for me to explicitly enable and disable these actions, when i am within the
Text or StyledText control? What i mean is when i copy something within the
StyledText (using CTRL->C), i want the paste action to get enabled as long i
am within the text control.. Seems like these actions only get
enabled/disabled only when the editorpart is activated

thanks,
-Ravi
Re: No Cut/Copy/Paste actions in swt.custom.StyledText [message #457837 is a reply to message #457543] Tue, 05 July 2005 19:21 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
I can only answer 1 and 2.

1. This menu is provided by the operating system. The menu is different on
each platform and the operating system controls the enabled state. You can
remove this menu but setting it to null (ie. text.setMenu(null)).

2. Since StyledText is not a native control. It doesn't have the menu.


"Ravi" <rshankark@hotmail.com> wrote in message
news:d9pijc$2po$1@news.eclipse.org...
> Hi,
>
> I have a couple of questions.
>
> 1. When i create a simple SWT Text control, and then right click on the
text
> control, i see about 6 actions: cut, copy, paste, selectall, delete and
> undo. Where does those actions get added and their enabled state
controlled?
>
> 2. When i use a StyledText control, and right click within the control, i
do
> not see any of the actions which we see for the Text control. Why is that
> and is there a way for us to add that?
>
> 3. In our application, we use SWT widgets within a GEF canvas. When i am
> within a Text or Styled Text control, i want to enable the menu actions
> based the content of the clipboard. But, the workbench action's
isEnabled()
> method gets called only when the editorpart is activated.. Is there a way
> for me to explicitly enable and disable these actions, when i am within
the
> Text or StyledText control? What i mean is when i copy something within
the
> StyledText (using CTRL->C), i want the paste action to get enabled as long
i
> am within the text control.. Seems like these actions only get
> enabled/disabled only when the editorpart is activated
>
> thanks,
> -Ravi
>
>
>
Previous Topic:findProgram
Next Topic:SWT Scrollbar drag properties
Goto Forum:
  


Current Time: Thu Apr 25 06:58:32 GMT 2024

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

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

Back to the top