Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 323166
Collapse All | Expand All

(-)src/org/eclipse/tm/internal/terminal/textcanvas/TextCanvas.java (-13 / +10 lines)
Lines 12-17 Link Here
12
 * Martin Oberhuber (Wind River) - [294327] After logging in, the remote prompt is hidden
12
 * Martin Oberhuber (Wind River) - [294327] After logging in, the remote prompt is hidden
13
 * Anton Leherbauer (Wind River) - [294468] Fix scroller and text line rendering
13
 * Anton Leherbauer (Wind River) - [294468] Fix scroller and text line rendering
14
 * Uwe Stieber (Wind River) - [205486] Fix ScrollLock always moving to line 1
14
 * Uwe Stieber (Wind River) - [205486] Fix ScrollLock always moving to line 1
15
 * Anton Leherbauer (Wind River) - [219589] Copy an entire line selection
15
 *******************************************************************************/
16
 *******************************************************************************/
16
package org.eclipse.tm.internal.terminal.textcanvas;
17
package org.eclipse.tm.internal.terminal.textcanvas;
17
18
Lines 92-103 Link Here
92
			public void terminalDataChanged() {
93
			public void terminalDataChanged() {
93
				if(isDisposed())
94
				if(isDisposed())
94
					return;
95
					return;
96
				// scroll to end (unless scroll lock is active)
95
				scrollToEnd();
97
				scrollToEnd();
96
				// make sure the scroll area is correct:
97
				if (!fScrollLock) {
98
					scrollY(getVerticalBar());
99
					scrollX(getHorizontalBar());
100
				}
101
			}
98
			}
102
		});
99
		});
103
		// let the cursor blink if the text canvas gets the focus...
100
		// let the cursor blink if the text canvas gets the focus...
Lines 167-173 Link Here
167
		if (fDraggingStart !=null && !p.equals(fDraggingEnd)) {
164
		if (fDraggingStart !=null && !p.equals(fDraggingEnd)) {
168
			fDraggingEnd = p;
165
			fDraggingEnd = p;
169
			if (compare(p, fDraggingStart) < 0) {
166
			if (compare(p, fDraggingStart) < 0) {
170
				fCellCanvasModel.setSelection(p.y, fDraggingStart.y, p.x, fDraggingStart.x);
167
				// bug 219589 - make sure selection start coordinates are non-negative
168
				int startColumn = Math.max(0, p.x);
169
				int startRow = Math.max(p.y, 0);
170
				fCellCanvasModel.setSelection(startRow, fDraggingStart.y, startColumn, fDraggingStart.x);
171
			} else {
171
			} else {
172
				fCellCanvasModel.setSelection(fDraggingStart.y, p.y, fDraggingStart.x, p.x);
172
				fCellCanvasModel.setSelection(fDraggingStart.y, p.y, fDraggingStart.x, p.x);
173
173
Lines 250-263 Link Here
250
		setVirtualExtend(getCols()*getCellWidth(),getRows()*getCellHeight());
250
		setVirtualExtend(getCols()*getCellWidth(),getRows()*getCellHeight());
251
		setRedraw(false);
251
		setRedraw(false);
252
		try {
252
		try {
253
			// scroll to end
253
			// scroll to end (unless scroll lock is active)
254
			scrollToEnd();
254
			scrollToEnd();
255
			// make sure the scroll area is correct:
256
			if (!fScrollLock) {
257
				scrollY(getVerticalBar());
258
				scrollX(getHorizontalBar());
259
			}
260
	
261
			getParent().layout();
255
			getParent().layout();
262
		} finally {
256
		} finally {
263
			setRedraw(true);
257
			setRedraw(true);
Lines 273-278 Link Here
273
			if(v.y!=-y) {
267
			if(v.y!=-y) {
274
				setVirtualOrigin(v.x,y);
268
				setVirtualOrigin(v.x,y);
275
			}
269
			}
270
			// make sure the scroll area is correct:
271
			scrollY(getVerticalBar());
272
			scrollX(getHorizontalBar());
276
		}
273
		}
277
	}
274
	}
278
	/**
275
	/**
(-)src/org/eclipse/tm/internal/terminal/textcanvas/AbstractTextCanvasModel.java (-3 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
2
 * Copyright (c) 2007, 2010 Wind River Systems, Inc. and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 8-13 Link Here
8
 * Contributors:
8
 * Contributors:
9
 * Michael Scharf (Wind River) - initial API and implementation
9
 * Michael Scharf (Wind River) - initial API and implementation
10
 * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1
10
 * Martin Oberhuber (Wind River) - [168197] Fix Terminal for CDC-1.1/Foundation-1.1
11
 * Anton Leherbauer (Wind River) - [219589] Copy an entire line selection
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.eclipse.tm.internal.terminal.textcanvas;
13
package org.eclipse.tm.internal.terminal.textcanvas;
13
14
Lines 281-287 Link Here
281
	 * @return the currently selected text
282
	 * @return the currently selected text
282
	 */
283
	 */
283
	private String extractSelectedText() {
284
	private String extractSelectedText() {
284
		if(fSelectionStartLine<0 || fSelectionStartCoumn<0 || fSelectionEndColumn<0 || fSelectionSnapshot==null)
285
		if(fSelectionStartLine<0 || fSelectionStartCoumn<0 || fSelectionSnapshot==null)
285
			return ""; //$NON-NLS-1$
286
			return ""; //$NON-NLS-1$
286
		StringBuffer buffer=new StringBuffer();
287
		StringBuffer buffer=new StringBuffer();
287
		for (int line = fSelectionStartLine; line <= fSeletionEndLine; line++) {
288
		for (int line = fSelectionStartLine; line <= fSeletionEndLine; line++) {
Lines 289-295 Link Here
289
			char[] chars=fSelectionSnapshot.getChars(line);
290
			char[] chars=fSelectionSnapshot.getChars(line);
290
			if(chars!=null) {
291
			if(chars!=null) {
291
				text=new String(chars);
292
				text=new String(chars);
292
				if(line==fSeletionEndLine)
293
				if(line==fSeletionEndLine && fSelectionEndColumn >= 0)
293
					text=text.substring(0, Math.min(fSelectionEndColumn+1,text.length()));
294
					text=text.substring(0, Math.min(fSelectionEndColumn+1,text.length()));
294
				if(line==fSelectionStartLine)
295
				if(line==fSelectionStartLine)
295
					text=text.substring(Math.min(fSelectionStartCoumn,text.length()));
296
					text=text.substring(Math.min(fSelectionStartCoumn,text.length()));

Return to bug 323166