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

  • SEARCH
  • Home
  • 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 7828153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:13:44+00:00 2026-06-02T10:13:44+00:00

Using GWT 2.4 with MVP, I have a presenter where the top portion can

  • 0

Using GWT 2.4 with MVP, I have a presenter where the top portion can swap between a read-only presenter of a set of data or an editor for that data, depending on how you arrived at the page.

Without using GWTP, how can I swap between those two presenters and the underlying views?

Currently, the classes looks like this:

public class MainPagePresenter implements Presenter, MainPageView.Presenter, ParentPresenter {

    private MainPageViewview;
    private final ClientFactory clientFactory;
    private StaticDataPresenter staticPresenter;
    private SomeOtherPresenter otherPresenter;


}

I’d like for StaticDataPresenter to become some structure that can either hold a StaticDataPresenter or a DynamicDataPresenter that lets you edit.

Thanks for your input.

  • 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-06-02T10:13:50+00:00Added an answer on June 2, 2026 at 10:13 am
    public interface DataPresenter {
      void handleEdit();
    }
    
    public class StaticDataPresenter implements DataPresenter {
      @Override
      public void handleEdit() {
        // Do nothing.
      }
    }
    
    public class DynamicDataPresenter implements DataPresenter {
      @Override
      public void handleEdit() {
        // Do something.
      }
    }
    
    public class MainPagePresenter implements Presenter, MainPageView.Presenter, ParentPresenter {
    
      private MainPageView view;
      private final ClientFactory clientFactory;
      private DataPresenter dataPresenter;
      private SomeOtherPresenter otherPresenter;
    
      ...
    
      public void switchDataPresenter(DataPresenter dataPresenter) {
        this.dataPresenter = dataPresenter;
        DataPresenterView dataPresenterView = view.dataPresenterView();
        dataPresenterView.setPresenter(dataPresenter);
      }    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning GWT and i have read at multiple places that using MVP
Using GWT with the MVP pattern , I'd like to have a place that
I have some doubts, i m developing a web application in GWT using MVP
I have a GWT MVP application using Activities and Places. This is inspired by
I have a GWT App and I am using GWT MVP with Places /
I have a GWT 2.4 app using MVP, clientFactory, activities, places, and uiBinder. I
I am using gwt with google maps api and i have a set of
I've been using GWT for quite some time now and have only used the
I'm programming using GWT, which includes Jetty. I have defined my own servlet and
I am using GWT 2.03 and am have an image that I want to

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.