User Tools

Site Tools


Sidebar

Dave Orme muses about data-first development.

My current work emphasizes data engineering and analysis using Kubernetes, Clojure, Scala, Eclipse, and Google Cloud Platform or AWS.


Blog

The Cloud

Scala, Clojure, and FP

Data-First Development

Agile

Older work

Coconut Palm Software home


Donate Bitcoin:

1Ecnr9vtkC8b9FvmQjQaJ9ZsHB127UzVD6

Keywords:

Kubernetes, Docker, Streaming Data, Spark, Scala, Clojure, OSGi, Karaf, GCP, AWS, SQL

Disclaimer:

Everything I say here is my own opinion and not necessarily that of my employer.

blog:eclipse_editors_for_arbitrary_types

Eclipse Editors for Arbitrary Types

Sometimes you can't use an Eclipse view to edit something in an RCP application; there are just times you need to be able to open multiple instances of your editor. Or maybe you need your editable thing to be able to interoperate with Eclipse's resources framework. For example, suppose you're implementing a web browser plug-in for Eclipse. You definitely would like the user to be able to open multiple web browser tabs. But how would you actually code this up?

On EclipsePowered, Paul Moore offers the following suggestion::

    Setting it up

       1. Define an IEditorInput class
          This is used to pass information to the editor about what its supposed
          to be //editing// (a file name, a web page,…)
       2. Define an EditorPart class. This is like a view but the main
          difference is that it has an init method that takes as its second
          param an IEditorInput, this is your #1 object and it tells you what
          you are suppsoed to be editing
       3. Put the editor in the plugin manifest in the
          org.eclipse.ui.editors extension point

    Now to use it

       1. Create an instance of your IEditorInput
       2. Call IWorkBenchPage.openEditor

          Pass in the editor input object you just made and the full id of the
          editor

    Your EditorPart will get created and its init method will be
    called. Then the createPartControl will be run (just like a view).

~~LINKBACK~~ ~~DISCUSSION:closed~~

blog/eclipse_editors_for_arbitrary_types.txt · Last modified: 2014/10/17 22:08 (external edit)