Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318559 - Alignment of columns when doing copy/paste is hardcoded
Summary: Alignment of columns when doing copy/paste is hardcoded
Status: RESOLVED FIXED
Alias: None
Product: MAT
Classification: Tools
Component: GUI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-01 04:35 EDT by Krum Tsvetkov CLA
Modified: 2010-09-10 08:31 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 Krum Tsvetkov CLA 2010-07-01 04:35:19 EDT
While trying to improve the Copy functionality I found some problem - the alignment for the columns is hardcoded - the first column is left justified, and all the rest right justified. This works fine with all "standard" views in MAT, but if I use OQL to select  the address of an object and its value (say for Strings) then the strings are right justified. This however would need a bit more thinking and therefore I opened a separate message for it.

How to reproduce:
1) open the OQL view
2) execute 
SELECT s.@objectAddress, toString(s) FROM java.lang.String s 
3) copy some lines from the result content and paste to a text file

The functionality is implemented in org.eclipse.mat.ui.util.Copy
Comment 1 Andrew Johnson CLA 2010-08-15 17:27:22 EDT
I've got some code to fix this, and to follow reordering of columns in the GUI, 
and to get the dashed line the right length if the alignment of columns is not 
the default.

I'll add it shortly.
Comment 2 Andrew Johnson CLA 2010-08-16 05:57:48 EDT
I'll commit my changes. 
Should the line separator be CR/LF or line.separator ?

Should export as CSV or HTML follow the reordering of table/tree columns? At the moment they do not.

Krum, please try this and see if it does what you want.
Comment 3 Andrew Johnson CLA 2010-09-10 08:31:54 EDT
Before:

s.@objectAddress|                                              toString(s) 
----------------------------------------------------------------------------
649,759,280     |                                           returnOpenType 
649,759,128     | javax.management.openmbean.OpenMBeanOperationInfoSupport 
649,757,024     | javax.management.openmbean.OpenMBeanParameterInfoSupport 
649,712,528     |                                          Non-heap memory 
649,712,472     |                                                 NON_HEAP 
649,712,408     |                                              Heap memory 
649,712,360     |                                                     HEAP 
----------------------------------------------------------------------------

With the fix:

 s.@objectAddress |toString(s)
---------------------------------------------------------------------------
      649,759,280 |returnOpenType
      649,759,128 |javax.management.openmbean.OpenMBeanOperationInfoSupport
      649,757,024 |javax.management.openmbean.OpenMBeanParameterInfoSupport
      649,712,528 |Non-heap memory
      649,712,472 |NON_HEAP
      649,712,408 |Heap memory
---------------------------------------------------------------------------