DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Cut, Copy Paste actions not working in my TextEditor
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2009
Question Cut, Copy Paste actions not working in my TextEditor - 06-18-2009, 08:20 AM

Hi,
I have implemented my own text editor by extending TextEditor class and implementing IEditorPart. But if i open any file from outside the workspace, the cut, copy, paste actions seems to be enabled in the context menu, but are not working. But for files within workspace, these actions are working fine.

Can anyone please tell me what is to be done for cut, copy, paste actions to work for outside workspace files.

Thanks & regards,
Loganathan. S.
Reply With Quote
  (#2 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 06-22-2009, 03:46 AM

Hi, loganathans

Did you set up DocumentProvider for your Editor? If no, then you should set it up. I used ForwardingDocumentProvider,Cut, Copy Paste actions are useful when you open the external files.


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jan 2009
Smile 06-22-2009, 04:17 AM

Hi oxygold,
Thanks for ur reply..
I actually used a document provider using FileDocumentProvider. I solved the problem. What was the actual problem is, while cut copy paste delete actions, the document provider's isReadOnly() method has been called. I didn't overridden the method. The super class method did not actually handle this method for files outside the workspace(FileStoreEditorInput) and hence always returning 'true' to the 'isReadOnly()' call which inturn disabled those actions. I have overridden this method in my document provider properly to handle the FileStoreEditorInput, and hence its working fine now.

Regards,
Loganathan S.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LTK Refactoring for Copy/Paste dvilaverde Eclipse 0 03-07-2009 10:19 PM
Keyboard shortcut to Cut/Copy/Paste current line in editor? mkjackson Eclipse 0 11-07-2008 07:43 PM
Eclipse TextEditor Bracematch lolita Eclipse 0 08-13-2008 12:13 AM
GMF: to extend the copy/paste function carmine2581 Eclipse 0 05-27-2008 05:20 AM
Actions for IExecutionListener dertl Eclipse 0 04-28-2008 01:08 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com