Browse Source

Code formatting (#11278)

tags/8.7.0.alpha1
Sun Zhe 5 years ago
parent
commit
b20a9a8318

+ 19
- 15
client/src/main/java/com/vaadin/client/connectors/grid/ComponentRendererConnector.java View File

@@ -61,12 +61,12 @@ public class ComponentRendererConnector

@Override
public void render(RendererCellReference cell, String connectorId,
SimplePanel widget) {
SimplePanel widget) {
createConnectorHierarchyChangeHandler();
Widget connectorWidget = null;
if (connectorId != null) {
ComponentConnector connector = (ComponentConnector) ConnectorMap
.get(getConnection()).getConnector(connectorId);
.get(getConnection()).getConnector(connectorId);
if (connector != null) {
connectorWidget = connector.getWidget();
knownConnectors.add(connectorId);
@@ -95,22 +95,26 @@ public class ComponentRendererConnector

/**
* Adds a listener for grid hierarchy changes to find detached connectors
* previously handled by this renderer in order to detach from DOM their widgets
* before {@link AbstractComponentConnector#onUnregister()} is invoked
* otherwise an error message is logged.
* previously handled by this renderer in order to detach from DOM their
* widgets before {@link AbstractComponentConnector#onUnregister()} is
* invoked otherwise an error message is logged.
*/
private void createConnectorHierarchyChangeHandler() {
if (handlerRegistration == null) {
handlerRegistration = getGridConnector().addConnectorHierarchyChangeHandler(event -> {
Iterator<String> iterator = knownConnectors.iterator();
while (iterator.hasNext()) {
ComponentConnector connector = (ComponentConnector) ConnectorMap.get(getConnection()).getConnector(iterator.next());
if (connector != null && connector.getParent() == null) {
connector.getWidget().removeFromParent();
iterator.remove();
}
}
});
handlerRegistration = getGridConnector()
.addConnectorHierarchyChangeHandler(event -> {
Iterator<String> iterator = knownConnectors.iterator();
while (iterator.hasNext()) {
ComponentConnector connector = (ComponentConnector) ConnectorMap
.get(getConnection())
.getConnector(iterator.next());
if (connector != null
&& connector.getParent() == null) {
connector.getWidget().removeFromParent();
iterator.remove();
}
}
});
}
}


+ 0
- 1
client/src/main/java/com/vaadin/client/widgets/Grid.java View File

@@ -9147,7 +9147,6 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
recalculateColumnWidths();
}


if (getEscalatorInnerHeight() != autoColumnWidthsRecalculator.lastCalculatedInnerHeight) {
Scheduler.get().scheduleFinally(() -> {
// Trigger re-calculation of all row positions.

+ 2
- 2
server/src/main/java/com/vaadin/ui/Grid.java View File

@@ -3314,8 +3314,8 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents,
* in this grid. Returning null from the generator results in no custom
* style name being set.
*
* Note: The style generator is applied only to the body cells, not to
* the Editor.
* Note: The style generator is applied only to the body cells, not to the
* Editor.
*
* @see StyleGenerator
*

+ 1
- 1
server/src/main/java/com/vaadin/ui/components/grid/GridMultiSelect.java View File

@@ -84,7 +84,7 @@ public class GridMultiSelect<T> implements MultiSelect<T> {
/**
* Selects the given item. If another item was already selected, that item
* is deselected.
*
*
* @param item
* the item to select
*/

+ 1
- 1
server/src/main/java/com/vaadin/ui/components/grid/GridSingleSelect.java View File

@@ -211,7 +211,7 @@ public class GridSingleSelect<T> implements SingleSelect<T> {
/**
* Selects the given item. If another item was already selected, that item
* is deselected.
*
*
* @param item
* the item to select
*/

Loading…
Cancel
Save