Giter Site home page Giter Site logo

eclipseplugins-ui-extensions's Introduction

[ English ] | [ На руском ]

Eclipse Plugins (UI-Extensions)

In this repository, I collect the sources for the Plug-in Project Eclipse, demonstrating the creation/configuration of various UI extensions for Eclipse. The material is designed primarily for beginners.

Eclipse EE Version: 2018-09 (4.9.0) Java 1.8.0_191

  1. View
  2. Property Page
  3. Common Navigator

1. View

This is an example of the simplest implementation of the org.eclipse.ui.views extension. To open View, click Window> Show View > Other ... > Category Simple View> Simple View

Plugins.xml has <extension point="org.eclipse.ui.views">, which contains the settings for the view. The class field indicates the implementation of this view. It is located in the package org.evilbit.simpleview, it is an elementary class SimpleViewClass extending ViewPart.

Result:

Picture Picture

An example implementation of the org.eclipse.ui.propertyPages extension. Property Pages can be opened in the following way: in ProjectExplorer, for example on a project, call the context menu, select the lowest menu item Properties and there we will see our Sample PropertyPage.

Plugins.xml has a <extension point="org.eclipse.ui.propertyPages"> that contains the settings for the page. In the class field, the implementation for propertyPages is indicated; it is in the package org.evilbit.propertypage.

Result:

Picture Picture

3. Common Navigator

Implementation example Navigator View through the extension org.eclipse.ui.views and org.eclipse.ui.navigator.viewer. To open View, click Window > Show View > Other ...> Category custom plugin views> Project Explorer

All settings for displaying content are in plugins.xml. Content is displayed through View with Id = "org.evilbit.navigator.views.ProjectExplorerId". Settings for displaying content are in the extension <extension point = "org.eclipse.ui.navigator.viewer">.

Source: http://codexe.net/eclipse/create-a-common-navigator.html

Result:

Picture

Add the org.eclipse.ui.navigator.navigatorContent extension. We specify the class NavigatorFilter extending org.eclipse.jface.viewers.ViewerFilter. Set up filtering in the NavigatorFilter class, hide the display of Java projects.

Source: http://codexe.net/eclipse/add-filter-to-common-navigator.html

Result:

Picture

Let's make some settings in org.eclipse.ui.navigator.viewer and org.eclipse.ui.navigator.navigatorContent. The essence of the settings is as follows: Common navigator will display resource objects (what we already have) and our own type PropertiesTreeData. NavigatorContentProvider will create our nodes of type PropertiesTreeData, and NavigatorLabelProvider will create icons and labels.

Source: http://codexe.net/eclipse/add-contents-to-common-navigator.html

Result:

Picture

Let's create our own data structure, the child node will be described in the PropertiesTreeData class, and the parent in the PropertiesTreeParentData class extended from PropertiesTreeData. The data structure will create the PropertiesTreeRootData class. It is also necessary to make small changes to existing classes, such as: NavigatorContentProvider, NavigatorLabelProvider and NavigatorFilter.

Source: http://codexe.net/eclipse/show-custom-data-on-navigator.html

Result:

Picture

In the NavigatorActionProvider class, the context menu is initialized, and in the AddNodeAction class, we determine the conditions for the activity of the menu item and the action that will be performed.

Source: http://codexe.net/eclipse/add-menu-to-common-navigator.html

Result:

Picture

Sorting is implemented in the NavigatorSorter class in the overridden compare method. The method will retrieve numbers from host names and sort them in reverse order. Sorting will happen automatically immediately after receiving the children using the getChildren (Object parentElement) method.

Source: http://codexe.net/eclipse/add-sorter-to-common-navigator.html

Result:

Picture

Source: http://codexe.net/eclipse/create-tabbed-property-view.html

Result:

Picture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.