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 9025861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:22:50+00:00 2026-06-16T06:22:50+00:00

I´m looking for a way to show and hide a working indicator in my

  • 0

I´m looking for a way to show and hide a working indicator in my web application. I use GWT with model view presenter pattern and have places for my different pages and activities, which are my presenter objects.

What I tried so far:

View objects have to implement an

public interface HasWorkingIndicator 

void showWorkingIndicator(boolean show);

Activity objects call the showWorkingIndicator on their view object in a start method.

     @Override
     public void start(final AcceptsOneWidget panel, EventBus eventBus){
         page.showWorkingIndicator(true);
         //more code...
     }

So what is the best way to hide the WorkingIndicatorView? I cant call showWorkingIndicator(false) at the end of the start(), because the page is not set up at that time.
Maybe any patterns to look at?

  • 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-16T06:22:51+00:00Added an answer on June 16, 2026 at 6:22 am

    If you are using activities this becomes a pretty easy task to accomplish.

    I have an AbstractActity that implements Activity, this handles things like my clientfactory and the parent panel.

    The Activity interface implements mayStop(), onStop and onStart etc.

    public class WorkingIndicator extends Composite {
    
        private static WorkingIndicator instance = null;
    
        private WorkingIndicator(){
           initWidget(new Label("Working"));
        }
    
        public static WorkingIndicator getInstance() {
           if (instance == null) {
              instance = new WorkingIndicator();
          }
          return instance;
    
        }
    
        public void show() {
            RootLayoutPanel.get().add(this);
        }
    
        public void hide() {
            RootLayoutPanel.get().remove(this);
        }
    
    }
    

    The activity would look something like this.

    public abstract class AbstractActivity<T extends ApplicationPlace, V extends View> implements Activity {
    
        protected ClientFactory clientFactory;
        protected EventBus eventBus;
        protected AcceptsOneWidget parentPanel;
        protected final T place;
        protected final V display;
    
        protected final List<HandlerRegistration> handlers = new ArrayList<HandlerRegistration>();
    
    
        public AbstractActivity(T place, ClientFactory clientFactory, V display) {
            this.place = place;
            this.clientFactory = clientFactory;
            this.display = display;
        }
    
        protected void setEventBus(EventBus eventBus) {
            this.eventBus = eventBus;
        }
    
        protected EventBus getEventBus() {
            return this.eventBus;
        }
    
        @Override
        public void start(AcceptsOneWidget parentPanel, EventBus eventBus) {
            this.parentPanel = parentPanel;
            this.eventBus = eventBus;
    
            parentPanel.setWidget(display.asWidget());
            bindToView();
            WorkingIndicator.getInstance().hide();
        }
    
        public AcceptsOneWidget getParentPanel() {
            return parentPanel;
        }
    
        public T getPlace() {
            return place;
        }
    
        public V getDisplay() {
            return display;
        }
    
        public ClientFactory getClientFactory() {
            return clientFactory;
        }
    
        /**
         * Shortcut getter for the CSS style in Resources.
         *
         * @return
         */
        public Style style() {
            return clientFactory.getResources().style();
        }
    
        @Override
        public String mayStop() {
            return null;
        }
    
        @Override
        public void onCancel() {
        }
    
        @Override
        public void onStop() {
          cleanup();
          display.reset();
          WorkingIndicator.getInstance().show();
        }
    
      protected void addHandler(HandlerRegistration registration) {
        handlers.add(registration);
      }
    
        public List<HandlerRegistration> getHandlers() {
            return handlers;
        }
    
        protected void cleanup() {
            for (HandlerRegistration handler : handlers) {
                handler.removeHandler();
            }
        }
    
        /**
         * This function will be called immediately after adding the view to the
         * DOM. This function should be used to hook up click handlers, populate
         * HasData handlers and such.
         */
        protected abstract void bindToView();
    
        protected DaoRequestFactory daoRequestFactory() {
            return clientFactory.daoRequestFactory();
        }
    
        protected AnalyticsTaskRequest analyticsTaskRequest() {
            return clientFactory.daoRequestFactory().analyticsTaskRequest();
        }
    
        protected EventBus eventBus() {
            return clientFactory.getEventBus();
        }
    
        protected PersonProxy currentPerson() {
            return clientFactory.getCurrentPerson();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for a way to show my own input view (a UITableView)
I'm looking for a way to show an alert message when the application is
I'm looking for a way to show/hide an arbitrary RichFaces component. In this case,
I'm looking for a way to show and hide the statusbar with an onClickListener
I have a HTML Div (I'm using Twitter Bootstrap to hide-show div2 ) looking
I am looking for a way to Show/ Hide some of the Radio buttons
I am looking for a way to show or hide HTML5 video controls at
I am looking for a way to show in a webapp in front of
I'm looking for way to create list view as like in IOS with pinned
My problem is that I was looking for way to use both storyboard and

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.