final UIDL uidl = change.getChildUIDL(0); | final UIDL uidl = change.getChildUIDL(0); | ||||
String connectorId = uidl.getId(); | String connectorId = uidl.getId(); | ||||
final ComponentConnector paintable = (ComponentConnector) connectorMap | |||||
final ComponentConnector legacyConnector = (ComponentConnector) connectorMap | |||||
.getConnector(connectorId); | .getConnector(connectorId); | ||||
if (paintable != null) { | |||||
paintable.updateFromUIDL(uidl, | |||||
if (legacyConnector != null | |||||
&& legacyConnector instanceof Paintable) { | |||||
((Paintable) legacyConnector).updateFromUIDL(uidl, | |||||
ApplicationConnection.this); | ApplicationConnection.this); | ||||
} else { | } else { | ||||
VConsole.error("Received update for " | VConsole.error("Received update for " |
* @version @VERSION@ | * @version @VERSION@ | ||||
* @since 7.0.0 | * @since 7.0.0 | ||||
*/ | */ | ||||
public interface ServerConnector extends Connector { | |||||
/** | |||||
* TODO | |||||
* | |||||
* @param uidl | |||||
* @param client | |||||
*/ | |||||
public void updateFromUIDL(UIDL uidl, ApplicationConnection client); | |||||
// TODO Remove "implements Paintable" | |||||
public interface ServerConnector extends Connector, Paintable { | |||||
/** | /** | ||||
* Sets a new state for the connector. | * Sets a new state for the connector. |
Widget childWidget = childPaintable.getWidget(); | Widget childWidget = childPaintable.getWidget(); | ||||
try { | try { | ||||
getWidget().setWidget(childWidget, location); | getWidget().setWidget(childWidget, location); | ||||
childPaintable.updateFromUIDL(childUIDL, client); | |||||
} catch (final IllegalArgumentException e) { | } catch (final IllegalArgumentException e) { | ||||
// If no location is found, this component is not visible | // If no location is found, this component is not visible | ||||
} | } |
getWidget().footerContainer); | getWidget().footerContainer); | ||||
} | } | ||||
getWidget().footer = newFooterWidget; | getWidget().footer = newFooterWidget; | ||||
newFooter.updateFromUIDL(uidl.getChildUIDL(1), client); | |||||
} else { | } else { | ||||
if (getWidget().footer != null) { | if (getWidget().footer != null) { | ||||
getWidget().remove(getWidget().footer); | getWidget().remove(getWidget().footer); | ||||
getWidget().lo = newLayoutWidget; | getWidget().lo = newLayoutWidget; | ||||
getWidget().add(newLayoutWidget, getWidget().fieldContainer); | getWidget().add(newLayoutWidget, getWidget().fieldContainer); | ||||
} | } | ||||
newLayout.updateFromUIDL(layoutUidl, client); | |||||
// also recalculates size of the footer if undefined size form - see | // also recalculates size of the footer if undefined size form - see | ||||
// #3710 | // #3710 |
} | } | ||||
} | } | ||||
getWidget().layout.updateFromUIDL(childUidl, client); | |||||
// Save currently open subwindows to track which will need to be closed | // Save currently open subwindows to track which will need to be closed | ||||
final HashSet<VWindow> removedSubWindows = new HashSet<VWindow>( | final HashSet<VWindow> removedSubWindows = new HashSet<VWindow>( | ||||
getWidget().subWindows); | getWidget().subWindows); |
} else if (getChildWidget() != newWidget) { | } else if (getChildWidget() != newWidget) { | ||||
replaceWidget(newWidget); | replaceWidget(newWidget); | ||||
} | } | ||||
newPntbl.updateFromUIDL(contentUidl, client); | |||||
if (contentUidl.getBooleanAttribute("cached")) { | if (contentUidl.getBooleanAttribute("cached")) { | ||||
/* | /* | ||||
* The size of a cached, relative sized component must be | * The size of a cached, relative sized component must be |
} | } | ||||
} | } | ||||
if (!r.getBooleanAttribute("cached")) { | |||||
child.updateFromUIDL(r, client); | |||||
} | |||||
} | } | ||||
// loop oldWidgetWrappers that where not re-attached and unregister | // loop oldWidgetWrappers that where not re-attached and unregister |
CLASSNAME + "-errorcell"); | CLASSNAME + "-errorcell"); | ||||
setWidget(i, COLUMN_ERRORFLAG, error); | setWidget(i, COLUMN_ERRORFLAG, error); | ||||
childPaintable.updateFromUIDL(childUidl, client); | |||||
String rowstyles = CLASSNAME + "-row"; | String rowstyles = CLASSNAME + "-row"; | ||||
if (i == 0) { | if (i == 0) { | ||||
rowstyles += " " + CLASSNAME + "-firstrow"; | rowstyles += " " + CLASSNAME + "-firstrow"; |
} | } | ||||
} | } | ||||
childConnector.updateFromUIDL(childUidl, client); | |||||
} | } | ||||
} | } | ||||
popupComponentPaintable = newPopupComponent; | popupComponentPaintable = newPopupComponent; | ||||
} | } | ||||
popupComponentPaintable | |||||
.updateFromUIDL(uidl.getChildUIDL(0), client); | |||||
} | } | ||||
public void unregisterPaintables() { | public void unregisterPaintables() { |
protected ArrayList<Widget> childWidgets = new ArrayList<Widget>(); | protected ArrayList<Widget> childWidgets = new ArrayList<Widget>(); | ||||
private boolean selected = false; | private boolean selected = false; | ||||
protected final int rowKey; | protected final int rowKey; | ||||
private List<UIDL> pendingComponentPaints; | |||||
private String[] actionKeys = null; | private String[] actionKeys = null; | ||||
private final TableRowElement rowElement; | private final TableRowElement rowElement; | ||||
addCell(uidl, cellContent.getWidget(), aligns[col++], | addCell(uidl, cellContent.getWidget(), aligns[col++], | ||||
style, sorted); | style, sorted); | ||||
paintComponent(cellContent, (UIDL) cell); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
return index; | return index; | ||||
} | } | ||||
protected void paintComponent(ComponentConnector p, UIDL uidl) { | |||||
if (isAttached()) { | |||||
p.updateFromUIDL(uidl, client); | |||||
} else { | |||||
if (pendingComponentPaints == null) { | |||||
pendingComponentPaints = new LinkedList<UIDL>(); | |||||
} | |||||
pendingComponentPaints.add(uidl); | |||||
} | |||||
} | |||||
@Override | |||||
protected void onAttach() { | |||||
super.onAttach(); | |||||
if (pendingComponentPaints != null) { | |||||
for (UIDL uidl : pendingComponentPaints) { | |||||
ComponentConnector paintable = (ComponentConnector) ConnectorMap | |||||
.get(client).getConnector(uidl.getId()); | |||||
paintable.updateFromUIDL(uidl, client); | |||||
} | |||||
pendingComponentPaints.clear(); | |||||
} | |||||
} | |||||
@Override | @Override | ||||
protected void onDetach() { | protected void onDetach() { | ||||
super.onDetach(); | super.onDetach(); |
if (tp.getWidgetIndex(tabContentWidget) < 0) { | if (tp.getWidgetIndex(tabContentWidget) < 0) { | ||||
tp.insert(tabContentWidget, index); | tp.insert(tabContentWidget, index); | ||||
} | } | ||||
tabContentPaintable.updateFromUIDL(tabContentUIDL, client); | |||||
} else if (tp.getWidgetCount() <= index) { | } else if (tp.getWidgetCount() <= index) { | ||||
tp.add(new PlaceHolder()); | tp.add(new PlaceHolder()); | ||||
} | } | ||||
tp.showWidget(activeTabIndex); | tp.showWidget(activeTabIndex); | ||||
VTabsheet.this.iLayout(); | VTabsheet.this.iLayout(); | ||||
content.updateFromUIDL(contentUIDL, client); | |||||
/* | /* | ||||
* The size of a cached, relative sized component must be updated to | * The size of a cached, relative sized component must be updated to | ||||
* report correct size to updateOpenTabSize(). | * report correct size to updateOpenTabSize(). |
getWidget().layout = lo; | getWidget().layout = lo; | ||||
} | } | ||||
getWidget().layout.updateFromUIDL(childUidl, client); | |||||
// we may have actions and notifications | // we may have actions and notifications | ||||
if (uidl.getChildCount() > 1) { | if (uidl.getChildCount() > 1) { | ||||
final int cnt = uidl.getChildCount(); | final int cnt = uidl.getChildCount(); |