DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report

Writing an RCP Application Using e4 Modeled UI - Part II

Ankur Sharma user avatar by
Ankur Sharma
·
Jan. 15, 10 · Interview
Like (0)
Save
Tweet
Share
6.59K Views

Join the DZone community and get the full member experience.

Join For Free

In the previous post we wrote a very minimalistic RCP application using e4 modeled UI. Before adding more stuff to it, lets quickly revisit few steps and try to make sense of them.

In Step 1 we unchecked the Generate an activator button. This was because right now we don't want to do anything on bundle start or stop events. We will later add one if we find the need to do so.

In Step 2, we add a dependency to org.eclipse.core.runtime plug-in. This was to bring the extension org.eclipse.core.runtime.products in visible scope. If we don't add this dependency, we will get prompted to add it when we add the extension.

We also gave the value product to the extension id. This was to get the product registered as projectname.product. That is why we created a new product config in Step 5, the product org.example.e4.rcpapp.product was already available to us.

e4 provides an out of the box application which understands the modeled UI. This application is org.eclipse.e4.ui.workbench.swt.E4Application which is why we assigned it to the application property of our product.

The applicationXMI property is what points to the UI model which the E4Application will use to render theĀ  UI. The format for the value is the plugin-name/project-relative-path. The file extension doesn't really matter. But an xmi extension will make it open the Toolkit Model Editor.

In Step 3, we had to manually add and modify the Application.xmi file. The New wizard doesn't have a option for it yet. Bug 284413 shall address the issue.

In Step 4, we gave proper shape to the model.

Application - this node represents the complete application. It will contain all UI elements plus their handlers, etc. Basically everything has to be child of this node.

Window - represents the visible window that will form the RCP application GUI. Whatever Label we give to it, is what we will see in the window title bar. Lets play with it a bit. Change the Label property to give it a new title. Give the X and Y property as 10 each. Save the editor and launch the application. You will see the application now has the new title and it shows up very close to the top-left corner of the screen. The X and Y properties represents the distance from the top-left corner of the screen.

Part Sash Container - is a container for our Part. In e4 both view and editor are treated equally as Part. All the children Parts will share the space among them.

Part Stack - is a collection of sibling Parts. Only one visible as a time - like we deck various views currently.

Part - represents a view or a editor. As usual, the Label property will control the name getting displayed on the view tab. We also added it a property URI and gave it a value platform:/plugin/org.example.e4.rcpapp/org.example.e4.rcpapp.views.MyView. This looks like a class name because it is a class name. We don't really need it as of now, but without it you will get a error and just to suppress it I added it. Getting an error on your first e4 RCP app won't look too elegant ;) In next post we will added this class and use it to create UI in the Part space.

Step 5 created a product configuration to help invoke the application. Nothing new here.

Step 6 created a run configuration using the product created in Step 5.

Step 7 simple launched this run config.Only point to note here would be the Plug-ins tab in Run configuration shall select all the target plug-ins. This is because the Add Required Plug-ins button can not yet cope with the Dependency Injection used by modeled UI. Not doing so will run you into NPE at org.eclipse.e4.workbench.ui.internal.E4Workbench.init(E4Workbench.java:93).

Next
We will add more Parts and render some useful UI in it.

From http://blog.ankursharma.org

Rich client platform application

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Choose the Right Streaming Database
  • gRPC on the Client Side
  • Reliability Is Slowing You Down
  • Monolithic First

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: