Community
Participate
Working Groups
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
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; }
Thanks Nick. Removed local copy in JDT/UI.