Bug 160498 - Need the Tracker class to accept empty Rectangle lists
Summary: Need the Tracker class to accept empty Rectangle lists
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-11 11:45 EDT by Eric Moffatt CLA
Modified: 2006-10-12 09:39 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Moffatt CLA 2006-10-11 11:45:36 EDT
Steve, here's a more specific defect than bug 155680. Please allow me me to remove the hack that I'm currently using in my trim dragging code (i.e. to set the rectange to (100000,0,0,0) by allowing me to do a setRectangles to an empty array without getting IndexOutOfBounds exceptions.

Here's the test code yo sent me...
	
public static void main (String [] args) {
	Display display = new Display ();
	final Shell shell = new Shell (display);
	shell.addListener (SWT.MouseDown, new Listener (){
		public void handleEvent (Event event) {
			Tracker tracker = new Tracker (shell, SWT.NULL);
			System.out.println("Rectangles=" + tracker.getRectangles());
			tracker.setRectangles(new Rectangle [0]);
			System.out.println("Result=" + tracker.open ());
		}
	});
	shell.open ();
	while (!shell.isDisposed ()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
Comment 1 Steve Northover CLA 2006-10-11 13:42:14 EDT
... or not to set the rectangle at all.  This didn't work should.
Comment 2 Steve Northover CLA 2006-10-11 13:48:34 EDT
Fixed > 2006101
Comment 3 Eric Moffatt CLA 2006-10-12 09:39:09 EDT
Thanks Steve...I'll check it out soon.