Пример #1
0
 public void setPanelEnabled(boolean state) {
   Component[] components = getComponents();
   for (int i = 0; i < components.length; i++) {
     Component c = components[i];
     c.setEnabled(state);
     if (BasePanel.class.isInstance(c)) {
       BasePanel cc = (BasePanel) c;
       cc.setPanelEnabled(state);
     }
   }
   setEnabled(state);
 }
Пример #2
0
 public void focusUpdate() {
   for (int i = 0; i < getComponentCount(); i++) {
     Component c = getComponent(i);
     if (BasePanel.class.isInstance(c)) {
       ((BasePanel) c).focusChange();
     }
   }
   focusChange();
 }
Пример #3
0
 protected void init(Message msg) {
   initMessage = msg;
   for (int i = 0; i < getComponentCount(); i++) {
     Component c = getComponent(i);
     if (BasePanel.class.isInstance(c)) {
       ((BasePanel) c).init(msg);
     }
   }
 }
Пример #4
0
 public boolean hasExceptions() {
   if (hasExceptions) {
     return true;
   }
   for (int i = 0; i < getComponentCount(); i++) {
     Component c = getComponent(i);
     if (BasePanel.class.isInstance(c)) {
       BasePanel handler = (BasePanel) c;
       // System.err.println("Checking: " + c.getClass() + ", errors: "
       // + handler.hasConditionErrors());
       if (handler.hasExceptions()) {
         // System.err.println("HasConditionErrors");
         return true;
       }
     }
   }
   return false;
 }
Пример #5
0
 public void setStateRecursive(int state) {
   panelState = state;
   for (int i = 0; i < getComponentCount(); i++) {
     Component current = getComponent(i);
     if (BasePanel.class.isInstance(current)) {
       ((BasePanel) current).setStateRecursive(state);
     }
   }
 }
Пример #6
0
 protected void load(Message msg) {
   loadMessage = msg;
   for (int i = 0; i < getComponentCount(); i++) {
     Component c = getComponent(i);
     if (BasePanel.class.isInstance(c)) {
       // System.err.println("Loading BasePanel");
       ((BasePanel) c).load(msg);
     }
   }
 }
Пример #7
0
 public void commit() {
   hasExceptions = false;
   switch (panelState) {
     case INITIALIZED:
       System.err.println("Store: Discarding initialized panel");
       break;
     case INSERTED:
       insert();
       break;
     case LOADED:
       System.err.println("Ignoring unchanged panel");
       break;
     case NO_STATE:
       System.err.println("Warning: Updating panel without state");
       break;
     case UPDATED:
       store();
       break;
     case DELETED:
       delete();
       break;
   }
   ArrayList<Component> al = getAllPanels();
   if (al.size() > 0) {
     // System.err.println("End of commit panel. Now committing subpanels.");
     for (int i = 0; i < al.size(); i++) {
       BasePanel aw = (BasePanel) al.get(i);
       aw.commit();
     }
     // System.err.println("Committed subpanels.");
   }
   if (!hasExceptions()) {
     setPanelState(LOADED);
   } else {
     System.err.println("This panel had errors: " + this);
   }
 }
Пример #8
0
 public void setFocus() {
   focusState = FOCUS_REQUEST;
   if (hostingPanel != null) {
     hostingPanel.focusUpdate();
   }
 }