Bug 61410 - [Navigator] LocalSelectionTransfer
Summary: [Navigator] LocalSelectionTransfer
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Nick Edgar CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2004-05-07 11:55 EDT by Dirk Baeumer CLA
Modified: 2004-05-14 11:58 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 Dirk Baeumer CLA 2004-05-07 11:55:24 EDT
I20040505

JDT/UI has still its own LocalSelectionTransfer class. To allow clients to 
fully participate in DnD JDT should convert to this class (best for 3.0). 
However to avoid accidental DnD operations the JDT/UI class manages a time 
stamp to check when the seleciton transfer got created. This is necessary 
since you can drag and drop a method onto a method which can cause unwanted
drop operations in the outliner.

The two methods are:

	/**
	 * Returns the time when the selection operation
	 * this transfer is associated with has started.
	 * 
	 * @return the time when the selection operation has started
	 * 
	 * @see org.eclipse.swt.events.TypedEvent#time
	 */
	public int getSelectionSetTime() {
		return fSelectionSetTime;
	}

	/**
	 * Sets the time when the selection operation this
	 * transfer is associated with has started.
	 * 
	 * @param time the time when the selection operation has started
	 * 
	 * @see org.eclipse.swt.events.TypeddEvent#time
	 */
	public void setSelectionSetTime(int time) {
		fSelectionSetTime= time;
	}

Can the two method be added to LocalSelectionTransfer for 3.0
Comment 1 Nick Edgar CLA 2004-05-08 15:17:29 EDT
I've added this, but made it a long.  Be sure to use event.time & 0xFFFF.
See the Javadoc for TypedEvent.

	/**
	 * Returns the time when the selection operation
	 * this transfer is associated with was started.
	 * 
	 * @return the time when the selection operation has started
	 * 
	 * @see org.eclipse.swt.events.TypedEvent#time
	 */
	public long getSelectionSetTime() {
		return selectionSetTime;
	}

	/**
	 * Sets the time when the selection operation this
	 * transfer is associated with was started.
	 * If assigning this from an SWT event, be sure to use
	 * <code>setSelectionTime(event.time & 0xFFFF)</code>
	 * 
	 * @param time the time when the selection operation was started
	 * 
	 * @see org.eclipse.swt.events.TypeddEvent#time
	 */
	public void setSelectionSetTime(long time) {
		selectionSetTime = time;
	}
Comment 2 Dirk Baeumer CLA 2004-05-14 11:58:37 EDT
Thanks Nick. Removed local copy in JDT/UI.