Browse Source

Removed unnecessary updateFromUidl calls from containers

tags/7.0.0.alpha2
Artur Signell 12 years ago
parent
commit
8c598ccfad

+ 4
- 3
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java View File

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 "

+ 2
- 8
src/com/vaadin/terminal/gwt/client/ServerConnector.java View File

* @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.

+ 0
- 1
src/com/vaadin/terminal/gwt/client/ui/CustomLayoutConnector.java View File

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
} }

+ 0
- 2
src/com/vaadin/terminal/gwt/client/ui/FormConnector.java View File

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

+ 0
- 2
src/com/vaadin/terminal/gwt/client/ui/RootConnector.java View File

} }
} }


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);

+ 0
- 1
src/com/vaadin/terminal/gwt/client/ui/VAccordion.java View File

} 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

+ 0
- 3
src/com/vaadin/terminal/gwt/client/ui/VCssLayout.java View File

} }
} }


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

+ 0
- 2
src/com/vaadin/terminal/gwt/client/ui/VFormLayout.java View File

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";

+ 0
- 1
src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java View File

} }
} }


childConnector.updateFromUIDL(childUidl, client);
} }
} }



+ 0
- 2
src/com/vaadin/terminal/gwt/client/ui/VPopupView.java View File

popupComponentPaintable = newPopupComponent; popupComponentPaintable = newPopupComponent;
} }


popupComponentPaintable
.updateFromUIDL(uidl.getChildUIDL(0), client);
} }


public void unregisterPaintables() { public void unregisterPaintables() {

+ 0
- 26
src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java View File

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();

+ 0
- 2
src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java View File

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().

+ 0
- 2
src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java View File

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();

Loading…
Cancel
Save