Bug 361123 - [patch] Feature editor won't allow copy and paste for license
Summary: [patch] Feature editor won't allow copy and paste for license
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: 4.5 M3   Edit
Assignee: Himanshu Mishra CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2011-10-17 08:03 EDT by Christian Pontesegger CLA
Modified: 2014-10-04 07:47 EDT (History)
7 users (show)

See Also:


Attachments
Proposed Patch for Bug 361123 (7.53 KB, patch)
2014-09-11 08:04 EDT, Himanshu Mishra CLA
no flags Details | Diff
Updated Patch for Bug 361123 (8.81 KB, patch)
2014-09-23 07:20 EDT, Himanshu Mishra CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Pontesegger CLA 2011-10-17 08:03:12 EDT
Build Identifier: 20110916-0149

The feature editor shows strange behavior when editing texts.On the description, copyright and license agreement tabs from [Information] copy and paste as long as select all (ctrl-a) do not work as expected.

It is not possible to c&p anything to the license text. Even when looking at the edit menu "paste" is disabled. Yet there is text in the clipboard as I am able to paste to any other file in eclipse.

Copyright and feature description tabs behave similary. There I am sometimes able to paste something, sometimes nothing happens. In the latter case it is still possible to copy some selected text from the already available description and re-paste that code.

Select all (Ctrl-A) does not work on any of the mentioned tabs.

As seen in the description - I'm on linux, maybe that's an issue.

Reproducible: Always

Steps to Reproduce:
1.have some text copied to your clipboard
2.create a new feature
3.go to information tab
4.go to license agreement 
5.mark license dummy text
6. try to paste code from clipboard
-> nothing happens
Comment 1 Christian Pontesegger CLA 2011-10-18 07:10:23 EDT
(In reply to comment #0)
> As seen in the description - I'm on linux, maybe that's an issue.

It's the same on windows7, just checked
Comment 2 Udo Walker CLA 2013-10-07 08:48:22 EDT
It's also not working in Eclipse 4.3.1
Comment 3 Himanshu Mishra CLA 2014-09-11 08:04:08 EDT
Created attachment 246955 [details]
Proposed Patch for Bug 361123

I tried adding the select all operation in the doGlobalActions function in InfoSection and doGlobalActions function with select all operation in LicenseFeatureSection. I added the Select All option in the ContextMenu of PDEFormEditor.

I tested locally it provides the Select All and Copy and Paste function for the Information tab  

Thanks
Comment 4 Himanshu Mishra CLA 2014-09-16 00:45:09 EDT
Can someone please review the patch so that the bug can be closed??
Comment 5 Vikas Chandra CLA 2014-09-16 01:24:34 EDT
Hi Himanshu, this will be taken up for 4.5M3. I will review before 4.5M3
Comment 6 Himanshu Mishra CLA 2014-09-16 03:53:43 EDT
Sure Vikas...
(In reply to Vikas Chandra from comment #5)
> Hi Himanshu, this will be taken up for 4.5M3. I will review before 4.5M3
Comment 7 David Williams CLA 2014-09-21 11:46:20 EDT
I found this marked for "4.4 M3", but sounds like "4.5 M3" was intended.
Comment 8 Vikas Chandra CLA 2014-09-22 02:46:55 EDT
Yes 4.5M3
Comment 9 Vikas Chandra CLA 2014-09-23 04:54:34 EDT
Himanshu,

1) You need to sign CLA agreement to contribute.

2) The copy paste works fine on 2nd attempt without your fix. Is it a initialization issue? If yes, then the fix should be simpler. Also why does it work for other tabs like "Feature description" etc. How were those copy paste different?

I had done a quick review.  The fix seems to work fine but I am looking if a simpler fix is possible. Hence question 2).
Comment 10 Himanshu Mishra CLA 2014-09-23 07:20:59 EDT
Created attachment 247293 [details]
Updated Patch for Bug 361123

Actually, the patch mainly implements the Select All feature which was not there. Then about Copy Paste. The right click in License Feature Section was not enabling the Cut Copy Option,irrespective of selected text, because there was no selection listener added. It will enable in case you go to Feature Description Section and Right Click First, but in case you directly go to License Feature Section and Right Click. It will be disabled, although you have selected some text. Paste was not working properly because canPaste was not implemented in LicenseFeatureSection. Now with this patch, the editing part works fine.
Comment 11 Vikas Chandra CLA 2014-09-24 08:43:49 EDT
Updated Patch for Bug 361123 looks good to me. ( the select all option is a bonus)
PDEUIMessages probably requires copyright year but it can be added while committing.

I think copy paste should be enabled for License section.

Even if it is the license section, I don't see a good reason to leave copy-paste disabled here.

Curtis - any thoughts?
Comment 12 Curtis Windatt CLA 2014-09-24 09:38:55 EDT
(In reply to Vikas Chandra from comment #11)
> Updated Patch for Bug 361123 looks good to me. ( the select all option is a
> bonus)
> PDEUIMessages probably requires copyright year but it can be added while
> committing.
> 
> I think copy paste should be enabled for License section.
> 
> Even if it is the license section, I don't see a good reason to leave
> copy-paste disabled here.
> 
> Curtis - any thoughts?

Copy/paste should be available in the license section.  No one wants to enter license text by hand :)
Comment 13 Vikas Chandra CLA 2014-10-01 09:02:24 EDT
I was exploring a GlobalActionEnabledPDESection ( having fSourceViewer) extending PDESection with doGlobalAction & canPaste and InfoSection/LicenseFeatureSection extending this new class but given lots of other major differences and a new API class addition confusion, I think " Updated Patch for Bug 361123" is the best way for this.
Comment 14 Vikas Chandra CLA 2014-10-01 09:32:34 EDT
Thanks Himanshu,

Committed to masters ( 4.5 ) via 

http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=c58d74124333a31c440be7cad13859b47a3149c7
Comment 15 Vikas Chandra CLA 2014-10-01 09:33:29 EDT
Resolved via commit in previous comment
Comment 16 Vikas Chandra CLA 2014-10-04 07:47:11 EDT
Verified in 

Version: Mars (4.5)
Build id: N20141003-2000