Drag and Drop Eclipse Workbench label

Source: Internet
Author: User

In this article, we'll learn a technique for customizing the drag-and-drop behavior of editors and view labels in Eclipse. We used an example to show this technique, which associates an editor with a transfer type Org.eclipse.ui.part.EditorInputTransfer. You can support the drag-and-drop behavior of the editor by implementing support for this type of transfer. We also provide a similar display for view labels. This article assumes that you are familiar with SWT's drag-and-drop technology.

What does customization mean?

The Editor and View tabs in the Eclipse Workbench can support the default drag-and-drop behavior, and the default drag release is supported:

Move and dock The view inside the Workbench the order in which the view or editor is rearranged within a tagged notepad create a quick view to view the source side-by-part, display several editors side-by-side in the editor area

Although this is a very exciting list of features, I still need more features in a project I worked on last year. Users need to be able to drag and drop the editor and View tabs and put them on a special view. When the user does so, what we do is intercept the Editor-id and input of the drag and drop editor, and the View-id of the dragged view, and then display the same content in a special view. Figure 1 and Figure 2 below will show this functionality.

Figure 1 shows an editor titled. Project, which is dragged and dropped into a special view titled Drop Window. Once you drop it in the position shown in Figure 2, this particular view displays the Editor-id and input of the drag and drop editor.

Figure 1. Editor label that is being dragged and dropped into a special view

Figure 2. Editor label dragged onto a special view

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.