tailieunhanh - Professional Eclipse 3 for Java Developers 2006 phần 5

Về cơ bản, tất cả người xem JFace được chuẩn bị sẵn sàng để hỗ trợ truyền dữ liệu bằng cách kéo và thả. Chức năng này được xây dựng trên đầu trang của các chức năng truyền dữ liệu SWT (xem phần "Chuyển dữ liệu" trong Chương 8). Ví dụ, bạn có thể dễ dàng thêm một DragSourceListener | Chapter 9 Data Transfer Basically all JFace viewers are prepared to support data transfer via drag and drop. This functionality is built on top of the SWT data transfer functionality see the Data Transfer section in Chapter 8 . For example you can easily add a DragSourceListener to a viewer via its addDragSupport method. In this method call you also would define the supported operations and transfer types. Similarly you can add a DropTargetListener via method addDropSupport . Within these listeners drag-and-drop events are processed as already discussed in the Drag-and-Drop section in Chapter 8. However if you want to exchange data with existing viewers you must know which transfer types are supported by these viewers. For example the Eclipse Navigator supports the types FileTransfer and ResourceTransfer. The Tasks View the Problems View and the Bookmarks View support the types MarkerTransfer and TextTransfer. Details about the JFace data transfer are discussed in the Eclipse Corner article by John Arthorne. Text Processing Text processing is another main functional group of JFace. In particular the various Eclipse editors are based on JFace s text processing. However it is possible to use JFace text processing isolated from the Eclipse workbench. The Eclipse text-processing functionality is deployed in two separate plug-ins .text with archive and with archive and consists of the following packages . . Text Processing Base Classes The text processing function group is separated into a data domain layer and a presentation layer. The representation is done by the TextViewer class while the data model is described by the interface IDocument. For the interface IDocument Eclipse provides the standard implementations AbstractDocument and Document. The Document Model Classes that implement the IDocument interface must provide the following services Text .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG