Changeset 933


Ignore:
Timestamp:
09/20/11 09:20:51 (14 years ago)
Author:
lgiessmann
Message:

gdl-frontend: Widgets: make the classes LoadSchemaCallback? and GdlWebPage? using LoadScreenPanel? to signal the user that the system is busy

Location:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java

    r932 r933  
    66import com.google.gwt.core.client.EntryPoint;
    77import com.google.gwt.user.client.Timer;
    8 import com.google.gwt.user.client.Window;
    98import com.google.gwt.user.client.ui.HorizontalPanel;
    109import com.google.gwt.user.client.ui.RootPanel;
     
    2423                        public void run() {
    2524                                lsp.removeFromParent();
    26                                 Window.alert("timer fired event!");
    2725                        }
    2826                };
  • TabularUnified branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java

    r930 r933  
    3838        private PsiContainer psiContainer = null;
    3939        private GdlPanel gdlPanel = null;
     40        private LoadScreenPanel loadScreenPanel = null;
    4041        private final String GDL_PANEL_STYLE_NAME = "gdl_panel";
    4142        private final String CREATE_NEW_BUTTON_STYLE_NAME = "create_new_button";
     
    7475       
    7576        public void resetPage() {
     77                this.removeLoadScreenPanel();
    7678                if(gdlPanel != null) this.gdlPanel.removeFromParent();
    7779                if(this.psiContainer != null) this.psiContainer.removeFromParent();
     
    8587                        Window.alert("could not create web page, becuase: (" + e.getClass() + ") " + e.getMessage());
    8688                }
     89        }
     90       
     91       
     92        public void removeLoadScreenPanel(){
     93                if(this.loadScreenPanel != null) this.loadScreenPanel.removeFromParent();
     94        }
     95       
     96       
     97        public void createLoadScreenPanel(String title, String message){
     98                this.removeLoadScreenPanel();
     99                this.loadScreenPanel = new LoadScreenPanel(title, message);
     100                RootPanel.get().add(this.loadScreenPanel);
    87101        }
    88102       
     
    111125                RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url);
    112126                try{
     127                        this.createLoadScreenPanel("Wating for data", "Requesting all PSIs of instances of " + GdlWebPage.this.topicTypePsi + " from " + url);
    113128                        builder.sendRequest(postData, new PsiRequest());
    114129                }catch(RequestException e){
     
    130145                                GdlWebPage.this.mainPanel.add(gdlPanel);
    131146                                gdlPanel.setTmEngine(new JtmsTmEngine());
    132                                 gdlPanel.setLoadSchemaCallback(new LoadSchemaCallback());
     147                                gdlPanel.setLoadSchemaCallback(new LoadSchemaCallback(GdlWebPage.this));
    133148                                gdlPanel.setCommitCallback(new CommitCallback());
    134149                                gdlPanel.setDeleteCallback(new DeleteCallback());
     
    155170                                        GdlWebPage.this.mainPanel.add(gdlPanel);
    156171                                        gdlPanel.setTmEngine(new JtmsTmEngine());
    157                                         gdlPanel.setLoadSchemaCallback(new LoadSchemaCallback());
     172                                        gdlPanel.setLoadSchemaCallback(new LoadSchemaCallback(GdlWebPage.this));
    158173                                        gdlPanel.setCommitCallback(new CommitCallback());
    159174                                        gdlPanel.setDeleteCallback(new DeleteCallback());
     
    217232                                Window.alert("could not request existing instances of " + GdlWebPage.this.topicTypePsi + ", because(" + response.getStatusCode() + "): " + response.getStatusText());
    218233                        }
     234                        GdlWebPage.this.removeLoadScreenPanel();
    219235                }
    220236               
  • TabularUnified branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/LoadSchemaCallback.java

    r857 r933  
    2626        private Pair<String, TopicIdentifierTypes> requestedTopicToEdit = null;
    2727        private RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, isidorusUrl);
     28        private GdlWebPage gdlWebPage = null;
     29       
     30        @SuppressWarnings("unused")
     31        private LoadSchemaCallback(){}
    2832       
    2933       
    30         public LoadSchemaCallback(){}
     34        public LoadSchemaCallback(GdlWebPage gdlWebPage){
     35                this.gdlWebPage = gdlWebPage;
     36        }
    3137       
    3238       
     
    3642                this.requestedTopicsToCreate = requestedTopicsToCreate;
    3743                this.requestedTopicToEdit = requestedTopicToEdit;
     44                this.gdlWebPage.createLoadScreenPanel("Requesting and Processing GDL data", "requesting a GDL-Schema from " + IsidorusConstants.GET_SCHEMA_REQUEST_URL + " and creating the corresponding UI-fragment");
    3845                requestBuilder.sendRequest(null, new RequestCallbackImpl(panel));
    3946        }
     
    9097                                dialog.center();
    9198                        }
     99                        LoadSchemaCallback.this.gdlWebPage.removeLoadScreenPanel();
    92100                }
    93101               
     
    116124                       
    117125                        dialog.center();
     126                        LoadSchemaCallback.this.gdlWebPage.removeLoadScreenPanel();
    118127                }
    119128        }
Note: See TracChangeset for help on using the changeset viewer.