Java Doc for ViewerDropAdapter.java in  » IDE-Eclipse » jface » org » eclipse » jface » viewers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jface » org.eclipse.jface.viewers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.eclipse.jface.viewers.ViewerDropAdapter

ViewerDropAdapter
abstract public class ViewerDropAdapter extends DropTargetAdapter (Code)
This adapter class provides generic drag-and-drop support for a viewer.

Subclasses must implement the following methods:

  • validateDrop - identifies valid drop targets in viewer
  • performDrop - carries out a drop into a viewer
The setFeedbackEnabled method can be called to turn on and off visual insertion feedback (on by default).



Field Summary
final public static  intLOCATION_AFTER
     Constant describing the position of the cursor relative to the target object.
final public static  intLOCATION_BEFORE
     Constant describing the position of the cursor relative to the target object.
final public static  intLOCATION_NONE
     Constant describing the position of the cursor relative to the target object.
final public static  intLOCATION_ON
     Constant describing the position of the cursor relative to the target object.

Constructor Summary
protected  ViewerDropAdapter(Viewer viewer)
     Creates a new drop adapter for the given viewer.

Method Summary
protected  intdetermineLocation(DropTargetEvent event)
     Returns the position of the given event's coordinates relative to its target.
protected  ObjectdetermineTarget(DropTargetEvent event)
     Returns the target item of the given drop event.
public  voiddragEnter(DropTargetEvent event)
    
public  voiddragOperationChanged(DropTargetEvent event)
    
public  voiddragOver(DropTargetEvent event)
    
public  voiddrop(DropTargetEvent event)
    
public  voiddropAccept(DropTargetEvent event)
    
protected  RectanglegetBounds(Item item)
     Returns the bounds of the given SWT tree or table item.
protected  intgetCurrentLocation()
     Returns a constant describing the position of the mouse relative to the target (before, on, or after the target.
protected  intgetCurrentOperation()
     Returns the current operation.
protected  ObjectgetCurrentTarget()
     Returns the target object currently under the mouse.
public  booleangetFeedbackEnabled()
     Returns whether visible insertion feedback should be presented to the user.
protected  ObjectgetSelectedObject()
     Returns the object currently selected by the viewer.
protected  ViewergetViewer()
    
protected  voidhandleException(Throwable exception, DropTargetEvent event)
    
abstract public  booleanperformDrop(Object data)
     Performs any work associated with the drop.
public  voidsetExpandEnabled(boolean value)
     Sets whether auto expanding should be provided during dragging.
public  voidsetFeedbackEnabled(boolean value)
     Sets whether visible insertion feedback should be presented to the user.
public  voidsetScrollEnabled(boolean value)
     Sets whether auto scrolling should be provided during dragging.
public  voidsetScrollExpandEnabled(boolean value)
     Sets whether auto scrolling and expanding should be provided during dragging.
public  voidsetSelectionFeedbackEnabled(boolean value)
     Sets whether selection feedback should be provided during dragging.
abstract public  booleanvalidateDrop(Object target, int operation, TransferData transferType)
     Validates dropping on the given object.

Field Detail
LOCATION_AFTER
final public static int LOCATION_AFTER(Code)
Constant describing the position of the cursor relative to the target object. This means the mouse is positioned slightly after the target.
See Also:   ViewerDropAdapter.getCurrentLocation()



LOCATION_BEFORE
final public static int LOCATION_BEFORE(Code)
Constant describing the position of the cursor relative to the target object. This means the mouse is positioned slightly before the target.
See Also:   ViewerDropAdapter.getCurrentLocation()



LOCATION_NONE
final public static int LOCATION_NONE(Code)
Constant describing the position of the cursor relative to the target object. This means the mouse is not positioned over or near any valid target.
See Also:   ViewerDropAdapter.getCurrentLocation()



LOCATION_ON
final public static int LOCATION_ON(Code)
Constant describing the position of the cursor relative to the target object. This means the mouse is positioned directly on the target.
See Also:   ViewerDropAdapter.getCurrentLocation()




Constructor Detail
ViewerDropAdapter
protected ViewerDropAdapter(Viewer viewer)(Code)
Creates a new drop adapter for the given viewer.
Parameters:
  viewer - the viewer




Method Detail
determineLocation
protected int determineLocation(DropTargetEvent event)(Code)
Returns the position of the given event's coordinates relative to its target. The position is determined to be before, after, or on the item, based on some threshold value.
Parameters:
  event - the event one of the LOCATION_* constants defined in this class



determineTarget
protected Object determineTarget(DropTargetEvent event)(Code)
Returns the target item of the given drop event.
Parameters:
  event - the event The target of the drop, may be null.



dragEnter
public void dragEnter(DropTargetEvent event)(Code)



dragOperationChanged
public void dragOperationChanged(DropTargetEvent event)(Code)



dragOver
public void dragOver(DropTargetEvent event)(Code)



drop
public void drop(DropTargetEvent event)(Code)



dropAccept
public void dropAccept(DropTargetEvent event)(Code)



getBounds
protected Rectangle getBounds(Item item)(Code)
Returns the bounds of the given SWT tree or table item.
Parameters:
  item - the SWT Item the bounds, or null if it is not a known type of item



getCurrentLocation
protected int getCurrentLocation()(Code)
Returns a constant describing the position of the mouse relative to the target (before, on, or after the target. one of the LOCATION_* constants defined in this type



getCurrentOperation
protected int getCurrentOperation()(Code)
Returns the current operation. a DROP_* constant from class DND
See Also:   DND.DROP_COPY
See Also:   DND.DROP_MOVE
See Also:   DND.DROP_LINK
See Also:   DND.DROP_NONE



getCurrentTarget
protected Object getCurrentTarget()(Code)
Returns the target object currently under the mouse. the current target object



getFeedbackEnabled
public boolean getFeedbackEnabled()(Code)
Returns whether visible insertion feedback should be presented to the user.

Typical insertion feedback is the horizontal insertion bars that appear between adjacent items while dragging.

true if visual feedback is desired, and false if not



getSelectedObject
protected Object getSelectedObject()(Code)
Returns the object currently selected by the viewer. the selected object, or null if either no object or multiple objects are selected



getViewer
protected Viewer getViewer()(Code)
the viewer to which this drop support has been added.



handleException
protected void handleException(Throwable exception, DropTargetEvent event)(Code)

Parameters:
  exception - the exception
Parameters:
  event - the event



performDrop
abstract public boolean performDrop(Object data)(Code)
Performs any work associated with the drop.

Subclasses must implement this method to provide drop behavior.


Parameters:
  data - the drop data true if the drop was successful, and false otherwise



setExpandEnabled
public void setExpandEnabled(boolean value)(Code)
Sets whether auto expanding should be provided during dragging.
Parameters:
  value - true if expanding is desired, andfalse if not
since:
   3.4



setFeedbackEnabled
public void setFeedbackEnabled(boolean value)(Code)
Sets whether visible insertion feedback should be presented to the user.

Typical insertion feedback is the horizontal insertion bars that appear between adjacent items while dragging.


Parameters:
  value - true if visual feedback is desired, andfalse if not



setScrollEnabled
public void setScrollEnabled(boolean value)(Code)
Sets whether auto scrolling should be provided during dragging.
Parameters:
  value - true if scrolling is desired, andfalse if not
since:
   3.4



setScrollExpandEnabled
public void setScrollExpandEnabled(boolean value)(Code)
Sets whether auto scrolling and expanding should be provided during dragging.
Parameters:
  value - true if scrolling and expanding is desired, andfalse if not
since:
   2.0



setSelectionFeedbackEnabled
public void setSelectionFeedbackEnabled(boolean value)(Code)
Sets whether selection feedback should be provided during dragging.
Parameters:
  value - true if selection feedback is desired, andfalse if not
since:
   3.2



validateDrop
abstract public boolean validateDrop(Object target, int operation, TransferData transferType)(Code)
Validates dropping on the given object. This method is called whenever some aspect of the drop operation changes.

Subclasses must implement this method to define which drops make sense.


Parameters:
  target - the object that the mouse is currently hovering over, ornull if the mouse is hovering over empty space
Parameters:
  operation - the current drag operation (copy, move, etc.)
Parameters:
  transferType - the current transfer type true if the drop is valid, and falseotherwise



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.