Bug 298741 - [RCP][api] Provide the text editor actions for the text viewer
Summary: [RCP][api] Provide the text editor actions for the text viewer
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.4.1   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-04 06:01 EST by Chris Simmons CLA
Modified: 2019-09-06 16:12 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Simmons CLA 2010-01-04 06:01:20 EST
Build Identifier: I20090611-1540

I've got a TextViewer in a ViewPart (note *not* a TextEditor/EditorPart) so I can't use the code in AbstractTextEditor to create the actions.

If I define an action bound to the commands for say cut/copy/paste/delete then they don't work properly (notably delete never works and cut is enabled when read only) because the command falls back on the default widget method.

I was expecting the TextViewer to register command handlers base on the canDoOperation/doOperation methods but no such luck.

I think this has lead to duplication, there's another TextViewerAction in the console plugin which has seemingly solved this problem by copying the actions.  I'm faced with a similar prospect as is anyone else who tries to use a TextViewer outside of an AbstractTextEditor.

Reproducible: Always

Steps to Reproduce:
This is quite simple to reproduce in an RCP app

1) Embed a read only TextViewer in a ViewPart.
2) Contribute an action bound to the cut command.
3) Cut is enabled...

Similar recipe with delete and it will be disabled.
Comment 1 Dani Megert CLA 2010-01-04 06:51:42 EST
Conceptually actions/handlers are bound by the part, that's why they aren't part of JFace (Text). We would have to rework all text editor actions to take a viewer as argument or provide a copy of the existing ones.
Comment 2 Dani Megert CLA 2010-08-04 02:47:22 EDT
>I think this has lead to duplication, there's another TextViewerAction
See bug 321623.
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:12:02 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.