Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 163348 Details for
Bug 155428
Multi-row selection copy-cut/paste does not work in Datapool Editor.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch.
Defect_155428_patch.txt (text/plain), 12.46 KB, created by
Paul Slauenwhite
on 2010-03-29 20:03:42 EDT
(
hide
)
Description:
Patch.
Filename:
MIME Type:
Creator:
Paul Slauenwhite
Created:
2010-03-29 20:03:42 EDT
Size:
12.46 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.test.doc.user >Index: concepts/cdatapooleditor.htm >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.doc.user/concepts/cdatapooleditor.htm,v >retrieving revision 1.6 >diff -u -r1.6 cdatapooleditor.htm >--- concepts/cdatapooleditor.htm 24 Mar 2010 16:18:36 -0000 1.6 >+++ concepts/cdatapooleditor.htm 30 Mar 2010 00:02:10 -0000 >@@ -100,8 +100,15 @@ > <br/> > <p>Individual records can be selected (click the record number in the first column in the datapool table) and cut (right-click the record number in the first column in the datapool table and select <b>Cut</b>, <b>Ctrl+X</b>, or select <b>Edit</b> > <b>Cut</b> from the file menu), > copied (right-click the record number in the first column in the datapool table and select <b>Copy</b>, <b>Ctrl+C</b>, or select <b>Edit</b> > <b>Copy</b> from the file menu), and removed (right-click the record number in the first column in the datapool table and >- select <b>Remove Record</b> or select the record number in the first column in the datapool table and <b>Delete</b>). A copied record can be pasted >- (right-click the record number in the first column in the datapool table and select <b>Paste</b>, <b>Ctrl+V</b>, or select <b>Edit</b> > <b>Paste</b> from the file menu).</p> >+ select <b>Remove Record</b> or select the record number in the first column in the datapool table and <b>Delete</b>). A cut or copied record can be pasted >+ (right-click the record number in the first column in the datapool table and select <b>Paste</b>, <b>Ctrl+V</b>, or select <b>Edit</b> > <b>Paste</b> from the file menu) to any selected row (click the record number in the first column in the datapool table).</p> >+ <br/> >+ <p>Multiple records can be selected >+ (hold <b>Ctrl</b> and click multiple records in the datapool table or select a starting record in the datapool table, hold <b>Shift</b>, >+ and press <b>Up</b>, <b>Down</b>, <b>Home</b>, <b>End</b>, <b>PgUp</b>, <b>PgDn</b>, or click an ending record in the datapool table) and cut (right-click the record number for any selected row in the first column in the datapool table and select <b>Cut</b>, <b>Ctrl+X</b>, or select <b>Edit</b> > <b>Cut</b> from the file menu) and >+ copied (right-click the record number for any selected row in the first column in the datapool table and select <b>Copy</b>, <b>Ctrl+C</b>, or select <b>Edit</b> > <b>Copy</b> from the file menu). Cut or copied records can be pasted >+ (right-click the record number for any selected row in the first column in the datapool table and select <b>Paste</b>, <b>Ctrl+V</b>, or select <b>Edit</b> > <b>Paste</b> from the file menu) to the same number of selected rows (hold <b>Ctrl</b> and click multiple records in the datapool table or select a starting record in the datapool table, hold <b>Shift</b>, >+ and press <b>Up</b>, <b>Down</b>, <b>Home</b>, <b>End</b>, <b>PgUp</b>, <b>PgDn</b>, or click an ending record in the datapool table).</p> > <br/> > </li> > <li> >@@ -110,8 +117,8 @@ > <p>Cells can be edited by double-clicking the cell in the datapool table or selecting the cell in the datapool table and pressing <b>F2</b>.</p> > <br/> > <p>Individual cells can be selected (click the cell in the datapool table) and cut (right-click the cell in the datapool table and select <b>Cut Ctrl+X</b>, <b>Ctrl+X</b>, or select <b>Edit</b> > <b>Cut Ctrl+X</b> from the file menu), >- copied (right-click the cell in the datapool table and select <b>Copy Ctrl+C</b>, <b>Ctrl+C</b>, or select <b>Edit</b> > <b>Copy Ctrl+C</b> from the file menu), and removed (select the cell in the datapool table press <b>Delete</b> or <b>Backspace</b> or <b>Insert</b> or typing or pasting new content). A copied cell or the system clipboard can be pasted >- (right-click the cell in the datapool table and select <b>Paste Ctrl+V</b>, <b>Ctrl+V</b>, or select <b>Edit</b> > <b>Ctrl+V Paste</b> from the file menu).</p> >+ copied (right-click the cell in the datapool table and select <b>Copy Ctrl+C</b>, <b>Ctrl+C</b>, or select <b>Edit</b> > <b>Copy Ctrl+C</b> from the file menu), and removed (select the cell in the datapool table press <b>Delete</b> or <b>Backspace</b> or <b>Insert</b> or typing or pasting new content). A cut or copied cell or the system clipboard can be pasted >+ (right-click the cell in the datapool table and select <b>Paste Ctrl+V</b>, <b>Ctrl+V</b>, or select <b>Edit</b> > <b>Ctrl+V Paste</b> from the file menu) to any selected cell (click the cell in the datapool table).</p> > <br/> > <p>Cells can be searched and replaced (right-click in the datapool table and select <b>Find/Replace... Ctrl+F</b>, <b>Ctrl+F</b>, or select <b>Edit</b> > > <b>Find/Replace... Ctrl+F</b> from the file menu). The scope of the search and replace can be limited to selected records >#P org.eclipse.hyades.test.ui >Index: src/org/eclipse/hyades/test/ui/datapool/internal/control/DatapoolClipboard.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.hyades.test.ui/src/org/eclipse/hyades/test/ui/datapool/internal/control/DatapoolClipboard.java,v >retrieving revision 1.11 >diff -u -r1.11 DatapoolClipboard.java >--- src/org/eclipse/hyades/test/ui/datapool/internal/control/DatapoolClipboard.java 10 Oct 2008 11:39:29 -0000 1.11 >+++ src/org/eclipse/hyades/test/ui/datapool/internal/control/DatapoolClipboard.java 30 Mar 2010 00:02:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2008 IBM Corporation and others. >+ * Copyright (c) 2005, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -21,35 +21,39 @@ > import org.eclipse.swt.dnd.Transfer; > > /** >- * Clipboard for datapools containing cell, record, and string data. >+ * <p>Clipboard for datapools containing cell, record, and string data.</p> > * > * > * @author Peter Sun > * @author Paul Slauenwhite >- * @version October 9, 2008 >+ * @version March 29, 2010 > * @since January 27, 2005 > */ >-public class DatapoolClipboard >-{ >- private static final String SEPERATOR = "\t"; //$NON-NLS-1$ >- private static final String LINEFEED = "\n"; //$NON-NLS-1$ >- private static final String CARRIAGERETURN = "\r"; //$NON-NLS-1$ >- >+public class DatapoolClipboard { >+ > private Vector recordData = null; > private Vector recordStringData = null; > private Object cellData = null; > private Object cellStringData = null; > private Clipboard clipboard = null; > >- private static final DatapoolClipboard instance = new DatapoolClipboard(); >+ private static DatapoolClipboard instance = null; > >- public static DatapoolClipboard getInstance() >- { >+ private static final String SEPERATOR_CHARACTRER = "\t"; //$NON-NLS-1$ >+ private static final String LINE_FEED_CHARACTRER = "\n"; //$NON-NLS-1$ >+ private static final String CARRIAGE_RETURN_CHARACTRER = "\r"; //$NON-NLS-1$ >+ >+ public static DatapoolClipboard getInstance(){ >+ >+ if(instance == null){ >+ instance = new DatapoolClipboard(); >+ } >+ > return instance; > } > >- protected DatapoolClipboard() >- { >+ private DatapoolClipboard(){ >+ > recordData = new Vector(); > recordStringData = new Vector(); > } >@@ -125,17 +129,17 @@ > TextTransfer transfer = TextTransfer.getInstance(); > String data = (String)clipboard.getContents(transfer); > >- StringTokenizer dataTokenizer = new StringTokenizer(data, LINEFEED); >+ StringTokenizer dataTokenizer = new StringTokenizer(data, LINE_FEED_CHARACTRER); > int count = 0; > boolean isDatapoolData = true; > while(dataTokenizer.hasMoreTokens()) > { > String line = dataTokenizer.nextToken(); >- if(line.endsWith(CARRIAGERETURN)) >- line = line.replaceAll(CARRIAGERETURN, new String()); >- line = line.concat(LINEFEED); >- if(!line.equals(constructClipboardData()[count])) >- { >+ if(line.endsWith(CARRIAGE_RETURN_CHARACTRER)) >+ line = line.replaceAll(CARRIAGE_RETURN_CHARACTRER, new String()); >+ line = line.concat(LINE_FEED_CHARACTRER); >+ >+ if(!line.equals(getRecordStringData(count))){ > isDatapoolData = false; > break; > } >@@ -146,29 +150,29 @@ > return recordData.toArray(); > > Vector dataSet = new Vector(); >- StringTokenizer lfTokenizer = new StringTokenizer(data, LINEFEED); >+ StringTokenizer lfTokenizer = new StringTokenizer(data, LINE_FEED_CHARACTRER); > while(lfTokenizer.hasMoreTokens()) > { > String line = lfTokenizer.nextToken(); >- if(line.endsWith(CARRIAGERETURN)) >- line = line.replaceAll(CARRIAGERETURN, new String()); >+ if(line.endsWith(CARRIAGE_RETURN_CHARACTRER)) >+ line = line.replaceAll(CARRIAGE_RETURN_CHARACTRER, new String()); > >- int index = line.indexOf(SEPERATOR); >+ int index = line.indexOf(SEPERATOR_CHARACTRER); > int numTokens = 1; > while(index != -1) > { > numTokens++; >- index = line.indexOf(SEPERATOR, index + 1); >+ index = line.indexOf(SEPERATOR_CHARACTRER, index + 1); > } > > String[] cellContents = new String[numTokens]; > count = 0; >- index = line.indexOf(SEPERATOR); >+ index = line.indexOf(SEPERATOR_CHARACTRER); > while(index != -1) > { > cellContents[count] = line.substring(0, index); > line = line.substring(index + 1); >- index = line.indexOf(SEPERATOR); >+ index = line.indexOf(SEPERATOR_CHARACTRER); > count++; > } > cellContents[count] = line; >@@ -177,25 +181,18 @@ > return dataSet.toArray(); > } > >- public void update() >- { >- TextTransfer transfer = TextTransfer.getInstance(); >- if(recordStringData.size() > 0) >- { >- int recordCount = recordStringData.size(); >- Transfer[] transfers = new Transfer[recordCount]; >- String[] data = constructClipboardData(); >- for(int i = 0; i < recordCount; i++) >- { >- transfers[i] = transfer; >- } >- clipboard.setContents(data, transfers); >+ /** >+ * <p>Update the system clipboard with the datapool clipboard data.</p> >+ * >+ * @see Clipboard#setContents(Object[], Transfer[]) >+ */ >+ public void update(){ >+ >+ if(recordStringData.size() > 0){ >+ clipboard.setContents(new Object[]{getRecordStringData()}, new Transfer[]{TextTransfer.getInstance()}); > } >- else >- { >- Object[] data = {cellStringData}; >- Transfer[] transfers = {transfer}; >- clipboard.setContents(data, transfers); >+ else{ >+ clipboard.setContents(new Object[]{cellStringData}, new Transfer[]{TextTransfer.getInstance()}); > } > } > >@@ -239,35 +236,41 @@ > this.clipboard = clipboard; > } > >- private String[] constructClipboardData() >- { >- if(recordStringData.size() > 0) >- { >- int recordCount = recordStringData.size(); >- String[] data = new String[recordCount]; >- for(int i = 0; i < recordCount; i++) >- { >- Object[] rawRecordData = (Object[])recordStringData.get(i); >- String processedRecordData = new String(); >- for(int j = 0; j < rawRecordData.length; j++) >- { >- if(j == 0) >- processedRecordData = (String)rawRecordData[j]; >- else >- { >- processedRecordData = processedRecordData.concat(SEPERATOR).concat((String)rawRecordData[j]); >- } >- >+ >+ private String getRecordStringData(int recordIndex){ >+ >+ StringBuffer recordStringBuffer = new StringBuffer(); >+ >+ if(recordStringData.size() > 0){ >+ >+ Object[] recordStrings = ((Object[])(recordStringData.get(recordIndex))); >+ >+ for(int counter = 0; counter < recordStrings.length; counter++){ >+ >+ if(recordStringBuffer.length() > 0){ >+ recordStringBuffer.append(SEPERATOR_CHARACTRER); > } >- processedRecordData = processedRecordData.concat(LINEFEED); >- data[i] = processedRecordData; >+ >+ recordStringBuffer.append(recordStrings[counter]); > } >- return data; >+ >+ recordStringBuffer.append(LINE_FEED_CHARACTRER); > } >- else >- { >- String[] data = {new String()}; >- return data; >+ >+ return (recordStringBuffer.toString()); >+ } >+ >+ private String getRecordStringData(){ >+ >+ StringBuffer recordStringBuffer = new StringBuffer(); >+ >+ if(recordStringData.size() > 0){ >+ >+ for(int counter = 0; counter < recordStringData.size(); counter++){ >+ recordStringBuffer.append(getRecordStringData(counter)); >+ } > } >+ >+ return (recordStringBuffer.toString()); > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 155428
: 163348