Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 325943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:15:49+00:00 2026-05-12T09:15:49+00:00

I’m a beginner with Eclipse RCP and I’m trying to build an application for

  • 0

I’m a beginner with Eclipse RCP and I’m trying to build an application for myself to give it a go. I’m confused about how one actually goes about handling model objects. None of the examples I can find deal with the problem I’m having, so I suspect I’m going about it the wrong way.

Say I need to initialise the application with a class that holds authenticated user info. I used my WorkbenchWindowAdvisor (wrong place?) to perform some initialisation (e.g. authentication) to decide what view to show. Once that’s done, a view is shown. Now, that view also needs access to the user info I had earlier retrieved/produced.

The question is, how is that view supposed to get that data? The view is wired up in the plugin.xml. I don’t see any way I can give the data to the view. So I assume the view has to retrieve it somehow. But what’s the proper place for it to retrieve it from? I thought of putting static variables in the IApplication implementation, but that felt wrong. Any advice or pointers much appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:15:49+00:00Added an answer on May 12, 2026 at 9:15 am

    The problem you are facing here is in my opinion not RCP related. Its more an architectural problem. Your view is wired with business logicand!
    The solution can be done by two (common) design-patterns:

    1. Model-View-Controler (MVC)
    2. Model-View-Presenter (MVP)

    You can find plenty information about this in the web. I am going to point a possible solution for your particular problem using MVP.

    You will need to create several projects. One is of course an RCP plugin, lets call it rcp.view. Now you create another one, which doesnt make UI contributions (only org.eclipse.core.runtime to start with) and call it rcp.presenter. To simplify things, this plugin will also be the model for now.

    Next steps:

    1. Add the rcp.presenter to the
      dependencies of rcp.view (its
      important that the presenter has no
      reference to the view)
    2. Export all packages that you are
      going to create in the rcp.presenter
      so they are visible
    3. In rcp.presenter create an interface
      IPerspective that has some methods
      like (showLogiDialog(), showAdministratorViews(User user), showStandardViews(User user))
    4. Create a class PerspectivePresenter that takes IPerspective in the constructor and saves it in an attribute
    5. In rcp.view go to your Perspective, implement your interface IPerspective, and in the constructor create a new reference presenter = new PerspectivePresenter(this)
    6. call presenter.load() and implenent
      this in the presenter maybe like this

    code:

    public void load()
    {
      User user = view.showLoginDialog(); // returns a user with the provided name/pw
      user.login(); // login to system/database
      if(user.isAdministrator())
        view.showAdministratorViews(user);
      else
        view.showStandardViews(user);
    }
    

    As you can see, the view just creates a reference to the presenter, which is responsible for all the business logic, and the presenter tells the view what to display. So in your Perspective you implement those interface functions and in each one you can set up your Perspective in a different way.

    For each View it goes in the same way, you will need a presenter for the view which performs operations and tells the view (using the interface) what to display and passing down the final data. The view doesnt care about the logic. This is also very usefull when using JFace-Databindings (then only bound data is passed to the view).
    For example, the WorkbenchWindowAdisor will just create everything that is needed in the application. Other views, perspectives, then can enable/disable menus and so on depending on the data they got (like when isAdministrator you might want to enable an special adminMenu).

    I know this is quite a heavy approach, but the Eclipse RCP is designed for big (as the name says rich) applications. So you should spend some time in the right architecture. My first RCP app was like you described…I never knew where to store things and how to handle all the references. At my work I learned about MVP (and I am still learning). It takes a while to understand the concept but its worth it.

    You might want to look at my second post at this question to get another idea on how you could structure your plugins.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 206k
  • Answers 206k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One of the beauties of MVC in .NET is that… May 12, 2026 at 9:09 pm
  • Editorial Team
    Editorial Team added an answer iTunes doesn't allow you to do this with AppleScript, but… May 12, 2026 at 9:09 pm
  • Editorial Team
    Editorial Team added an answer It allows websites to force browsers to update their cached… May 12, 2026 at 9:08 pm

Related Questions

In order to apply a triggered animation to all ToolTip s in my app,
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.