This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 206183 - Rectangular selection works bad with paste action
Summary: Rectangular selection works bad with paste action
Status: RESOLVED DUPLICATE of bug 218915
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.2.1
Hardware: PC Linux
: P3 normal with 2 votes (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-09 10:08 UTC by Martin Fousek
Modified: 2012-12-04 12:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fousek 2011-12-09 10:08:26 UTC
Product Version: NetBeans IDE 7.1 RC1 (Build 201111242103)
Java: 1.6.0_29; Java HotSpot(TM) 64-Bit Server VM 20.4-b02
System: Linux version 3.0.0-13-generic running on amd64; UTF-8; en_US (nb)

I have following code where I would like to use rectangular selection...
additionalCPTable.setColumnSelectionAllowed(false);
additionalCPTable.setRowSelectionAllowed(true);
additionalCPTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
additionalCPTable.setTableHeader(null);

I selected additionalCPTable and I already had "this" string in the clipboard. When I pasted the text this happened...
this.setTableHeader(null);

So all lines except the last one were deleted and string was replaced just there. One would expect that paste action will behave here similarly to writing text action.
Comment 1 jirka_x1 2012-06-01 17:15:36 UTC
I agree, but there are two cases:
1) Single line paste should paste the string repeatedly to all lines, 

So pasting "this" when additionalCPTable are selected:

additionalCPTable.setColumnSelectionAllowed(false);
additionalCPTable.setRowSelectionAllowed(true);
additionalCPTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
additionalCPTable.setTableHeader(null);

one should get

this.setColumnSelectionAllowed(false);
this.setRowSelectionAllowed(true);
this.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
this.setTableHeader(null);

2) if the pasted string has multiple lines, they should be entered as they are (padding the number of lines by empty strings).

So pasting

aa
bb
cc

in the same case as above, should produce

aa.setColumnSelectionAllowed(false);
bb.setRowSelectionAllowed(true);
cc.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
.setTableHeader(null);
Comment 2 almson 2012-12-01 11:30:46 UTC
I second this. Rectangular selection is supposed to support this feature.

I've never tried multi-line paste as jirka_x1 is suggesting in any editor, but single-line paste is a must.
Comment 3 Miloslav Metelka 2012-12-04 12:59:34 UTC
Should be resolved by issue #218915.

*** This bug has been marked as a duplicate of bug 218915 ***