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); }
public void focusUpdate() { for (int i = 0; i < getComponentCount(); i++) { Component c = getComponent(i); if (BasePanel.class.isInstance(c)) { ((BasePanel) c).focusChange(); } } focusChange(); }
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); } } }
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; }
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); } } }
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); } } }
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); } }
public void setFocus() { focusState = FOCUS_REQUEST; if (hostingPanel != null) { hostingPanel.focusUpdate(); } }