diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2021-07-08 12:04:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-08 12:04:58 +0300 |
commit | 3afe45849edc79f0e7b371a7fd3ef209292dce79 (patch) | |
tree | 2934d3ca30286b3480d7c6b4c5d5bfc99aa196db /client | |
parent | 347d36dcbccb07f1dd46f17ea5be6fceecc755cb (diff) | |
download | vaadin-framework-3afe45849edc79f0e7b371a7fd3ef209292dce79.tar.gz vaadin-framework-3afe45849edc79f0e7b371a7fd3ef209292dce79.zip |
Code cleanup (#12333)
- removed unused private methods
- removed unused private variables
- removed unnecessary initializations
- removed unnecessary substring(0)
- removed inner assignments
- renamed private methods that started with upper case
- renamed static final variables to use upper case
- converted to use non-deprecated options
- suppressed unavoidable warnings
- divided long Strings to multiple lines
- added missing types
- added missing JavaDoc parameters
- formatting
- updated comments & JavaDocs
Diffstat (limited to 'client')
10 files changed, 91 insertions, 89 deletions
diff --git a/client/src/main/java/com/vaadin/client/communication/JsonEncoder.java b/client/src/main/java/com/vaadin/client/communication/JsonEncoder.java index 99b34dce9a..7b2135f8a4 100644 --- a/client/src/main/java/com/vaadin/client/communication/JsonEncoder.java +++ b/client/src/main/java/com/vaadin/client/communication/JsonEncoder.java @@ -49,15 +49,25 @@ import elemental.json.JsonValue; */ public class JsonEncoder { + private JsonEncoder() { + // private constructor to prevent initialization + } + /** * Encode a value to a JSON representation for transport from the client to * the server. * * @param value * value to convert + * @param type + * type information, not needed for all encoding tasks, such as + * encoding a String * @param connection + * application connection providing the context, not needed for + * all encoding tasks, such as encoding a String * @return JSON representation of the value */ + @SuppressWarnings("unchecked") public static JsonValue encode(Object value, Type type, ApplicationConnection connection) { if (null == value) { @@ -80,17 +90,17 @@ public class JsonEncoder { } else if (value instanceof Character) { return Json.create(String.valueOf(value)); } else if (value instanceof Object[] && type == null) { - // Non-legacy arrays handed by generated serializer + // Non-legacy arrays handled by generated serializer return encodeLegacyObjectArray((Object[]) value, connection); } else if (value instanceof Enum) { - return encodeEnum((Enum<?>) value, connection); + return encodeEnum((Enum<?>) value); } else if (value instanceof Map) { - return encodeMap((Map) value, type, connection); + return encodeMap((Map<Object, Object>) value, type, connection); } else if (value instanceof Connector) { Connector connector = (Connector) value; return Json.create(connector.getConnectorId()); } else if (value instanceof Collection) { - return encodeCollection((Collection) value, type, connection); + return encodeCollection((Collection<?>) value, type, connection); } else if (value instanceof UidlValue) { return encodeVariableChange((UidlValue) value, connection); } else { @@ -254,8 +264,7 @@ public class JsonEncoder { return jsonMap; } - private static JsonValue encodeEnum(Enum<?> e, - ApplicationConnection connection) { + private static JsonValue encodeEnum(Enum<?> e) { return Json.create(e.toString()); } @@ -270,8 +279,8 @@ public class JsonEncoder { return jsonArray; } - private static JsonArray encodeCollection(Collection collection, Type type, - ApplicationConnection connection) { + private static JsonArray encodeCollection(Collection<?> collection, + Type type, ApplicationConnection connection) { JsonArray jsonArray = Json.createArray(); int idx = 0; for (Object o : collection) { diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/DetailsManagerConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/DetailsManagerConnector.java index b419aef724..de3c1bdee2 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/DetailsManagerConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/DetailsManagerConnector.java @@ -54,11 +54,12 @@ import elemental.json.JsonObject; * @author Vaadin Ltd * @since 8.0 */ +@SuppressWarnings("deprecation") @Connect(DetailsManager.class) public class DetailsManagerConnector extends AbstractExtensionConnector { /* Map for tracking which details are open on which row */ - private TreeMap<Integer, String> indexToDetailConnectorId = new TreeMap<>(); + private Map<Integer, String> indexToDetailConnectorId = new TreeMap<>(); /* For listening data changes that originate from DataSource. */ private Registration dataChangeRegistration; /* For listening spacer index changes that originate from Escalator. */ @@ -266,7 +267,6 @@ public class DetailsManagerConnector extends AbstractExtensionConnector { /** * Height aware details generator for client-side Grid. */ - @SuppressWarnings("deprecation") private class CustomDetailsGenerator implements HeightAwareDetailsGenerator { diff --git a/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java b/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java index 09c2fd2ba6..054ec39f6c 100644 --- a/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java +++ b/client/src/main/java/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java @@ -44,6 +44,7 @@ import com.vaadin.client.ValueMap; * * @since 7.1.4 */ +@SuppressWarnings("deprecation") public class AnalyzeLayoutsPanel extends FlowPanel { private List<SelectConnectorListener> listeners = new ArrayList<>(); @@ -88,19 +89,19 @@ public class AnalyzeLayoutsPanel extends FlowPanel { + "states, but reported here as they might be.</em>")); if (!zeroHeightComponents.isEmpty()) { add(new HTML("<p><strong>Vertically zero size:</strong></p>")); - printClientSideDetectedIssues(zeroHeightComponents, ac); + printClientSideDetectedIssues(zeroHeightComponents); } if (!zeroWidthComponents.isEmpty()) { add(new HTML( "<p><strong>Horizontally zero size:</strong></p>")); - printClientSideDetectedIssues(zeroWidthComponents, ac); + printClientSideDetectedIssues(zeroWidthComponents); } } } private void printClientSideDetectedIssues( - Set<ComponentConnector> zeroSized, ApplicationConnection ac) { + Set<ComponentConnector> zeroSized) { // keep track of already highlighted parents HashSet<String> parents = new HashSet<>(); diff --git a/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java b/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java index 95008e70f8..4fe1ec92aa 100644 --- a/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java +++ b/client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java @@ -456,14 +456,14 @@ public class TouchScrollDelegate implements NativePreviewHandler { } deltaScrollTop = overscroll - origScrollTop; } - quickSetScrollPosition(0, deltaScrollTop); + quickSetScrollPosition(deltaScrollTop); moved = true; event.preventDefault(); event.stopPropagation(); } } - private void quickSetScrollPosition(int deltaX, int deltaY) { + private void quickSetScrollPosition(int deltaY) { deltaScrollPos = deltaY; if (ANDROID_WITH_BROKEN_SCROLL_TOP) { deltaY += origScrollTop; @@ -500,7 +500,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { : Math.abs(origY - lastClientY) >= SIGNIFICANT_MOVE_THRESHOLD; } - private void onTouchEnd(NativeEvent event) { + private void onTouchEnd() { if (!moved) { activeScrollDelegate = null; handlerRegistration.removeHandler(); @@ -532,17 +532,14 @@ public class TouchScrollDelegate implements NativePreviewHandler { if (pixelsPerMs < 0) { pixelsToMove = -pixelsToMove; } - // getLogger().info("pixels to move" + pixelsToMove); finalY = currentY + pixelsToMove; if (finalY > maxFinalY + getMaxOverScroll()) { - // getLogger().info("To max overscroll"); finalY = getMaxFinalY() + getMaxOverScroll(); int fixedPixelsToMove = finalY - currentY; pixelsToMove = fixedPixelsToMove; } else if (finalY < 0 - getMaxOverScroll()) { - // getLogger().info("to min overscroll"); finalY = -getMaxOverScroll(); int fixedPixelsToMove = finalY - currentY; pixelsToMove = fixedPixelsToMove; @@ -552,7 +549,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { } if (duration == -1) { // did not keep in side borders or was outside borders, calculate - // a good enough duration based on pixelsToBeMoved. + // a good enough duration based on pixelsToMove. duration = getAnimationTimeForDistance(pixelsToMove); } if (duration > MAX_DURATION) { @@ -690,7 +687,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { if (moved) { event.cancel(); } - onTouchEnd(event.getNativeEvent()); + onTouchEnd(); } break; case Event.ONMOUSEMOVE: diff --git a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java index 154ce64d90..fa05cc9b1f 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java @@ -97,14 +97,16 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> */ public interface FocusOutListener { /** + * @param event + * dom event * @return true if the calendar panel is not used after focus moves out */ boolean onFocusOut(DomEvent<?> event); } /** - * FocusChangeListener is notified when the panel changes its _focused_ - * value. + * FocusChangeListener is notified when the panel changes its + * {@code focused} value. */ public interface FocusChangeListener { void focusChanged(Date focusedDate); @@ -183,6 +185,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * Represents a click handler for when a user selects a value by using the * mouse */ + @SuppressWarnings("unchecked") private ClickHandler dayClickHandler = event -> { if (!isEnabled() || isReadonly()) { return; @@ -231,6 +234,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * A Date representing the day of month to be focused. Must be * one of the days currently visible. */ + @SuppressWarnings("unchecked") private void focusDay(Date date) { // Only used when calendar body is present if (acceptDayFocus()) { @@ -350,6 +354,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * one of the days currently visible. * */ + @SuppressWarnings("unchecked") private void selectDate(Date date) { if (selectedDay != null) { selectedDay.removeStyleDependentName(CN_SELECTED); @@ -765,7 +770,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> // If dateStrResolution has more year digits than rangeEnd, we need // to pad it in order to be lexicographically compatible String dateStrResolution = dateStrResolution(date, minResolution); - String paddedEnd = rangeEnd.substring(0); + String paddedEnd = rangeEnd; int yearDigits = dateStrResolution.indexOf("-"); if (yearDigits == -1) { yearDigits = dateStrResolution.length(); @@ -777,21 +782,6 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> .compareTo(dateStrResolution) >= 0; } - private static Date clearDateBelowMonth(Date date) { - date.setDate(1); - return clearDateBelowDay(date); - } - - private static Date clearDateBelowDay(Date date) { - date.setHours(0); - date.setMinutes(0); - date.setSeconds(0); - // Clearing milliseconds - long time = date.getTime() / 1000; - date = new Date(time * 1000); - return date; - } - /** * Builds the day and time selectors of the calendar. */ @@ -952,9 +942,12 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> } /** - * Returns the value of initialRenderDone + * Returns the value of initialRenderDone. * * @since 8.7 + * + * @return {@code true} if the initial render has been marked as done, + * {@code false} otherwise */ public boolean isInitialRenderDone() { return initialRenderDone; @@ -1386,7 +1379,8 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * Was the ctrl key pressed? * @param shift * Was the shift key pressed? - * @return + * @return {@code true} if the navigation was handled successfully, + * {@code false} otherwise */ protected boolean handleNavigationMonthMode(int keycode, boolean ctrl, boolean shift) { @@ -1572,7 +1566,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * selection. By default this is backspace but it can be overridden to * change the key to whatever you want. * - * @return + * @return the reset key */ protected int getResetKey() { return KeyCodes.KEY_BACKSPACE; @@ -1583,7 +1577,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * enter key but it can be changed to whatever you like by overriding this * method. * - * @return + * @return the select key */ protected int getSelectKey() { return KeyCodes.KEY_ENTER; @@ -1594,7 +1588,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * Else this does nothing. By default this is the Escape key but you can * change the key to whatever you want by overriding this method. * - * @return + * @return the closing key */ protected int getCloseKey() { return KeyCodes.KEY_ESCAPE; @@ -1605,7 +1599,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * right arrow key but by overriding this method it can be changed to * whatever you like. * - * @return + * @return the forward key */ protected int getForwardKey() { return KeyCodes.KEY_RIGHT; @@ -1616,7 +1610,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * the left arrow key but by overriding this method it can be changed to * whatever you like. * - * @return + * @return the backward key */ protected int getBackwardKey() { return KeyCodes.KEY_LEFT; @@ -1627,7 +1621,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * the down arrow key but by overriding this method it can be changed to * whatever you like. * - * @return + * @return the next week key */ protected int getNextKey() { return KeyCodes.KEY_DOWN; @@ -1638,7 +1632,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * is the up arrow key but by overriding this method it can be changed to * whatever you like. * - * @return + * @return the previous week key */ protected int getPreviousKey() { return KeyCodes.KEY_UP; @@ -1665,6 +1659,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * com.google.gwt.event.dom.client.MouseDownHandler#onMouseDown(com.google * .gwt.event.dom.client.MouseDownEvent) */ + @SuppressWarnings("unchecked") @Override public void onMouseDown(MouseDownEvent event) { // Click-n-hold the left mouse button for fast-forward or fast-rewind. @@ -1721,8 +1716,9 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> } private Date parseRangeString(String dateStr) { - if (dateStr == null || "".equals(dateStr)) + if (dateStr == null || "".equals(dateStr)) { return null; + } int year = Integer.parseInt(dateStr.substring(0, 4)) - 1900; int month = parsePart(dateStr, 5, 2, 1) - 1; int day = parsePart(dateStr, 8, 2, 1); @@ -1735,8 +1731,9 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> private int parsePart(String dateStr, int beginIndex, int length, int defValue) { - if (dateStr.length() < beginIndex + length) + if (dateStr.length() < beginIndex + length) { return defValue; + } return Integer .parseInt(dateStr.substring(beginIndex, beginIndex + length)); } @@ -1807,7 +1804,8 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> value = null; } } else { - focusedDate = displayedMonth = null; + displayedMonth = null; + focusedDate = null; } } else { focusedDate = new FocusedDate(value.getYear(), value.getMonth(), @@ -1854,11 +1852,12 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> } /** - * If true should be returned if the panel will not be used after this - * event. + * True should be returned if the panel will not be used after this event. * * @param event - * @return + * dom event + * @return {@code true} if the panel will not be used after this event, + * {@code false} otherwise */ protected boolean onTabOut(DomEvent<?> event) { if (focusOutListener != null) { @@ -1949,10 +1948,6 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> private static final String SUBPART_NEXT_YEAR = "nexty"; private static final String SUBPART_PREV_YEAR = "prevy"; - private static final String SUBPART_HOUR_SELECT = "h"; - private static final String SUBPART_MINUTE_SELECT = "m"; - private static final String SUBPART_SECS_SELECT = "s"; - private static final String SUBPART_AMPM_SELECT = "ampm"; private static final String SUBPART_DAY = "day"; private static final String SUBPART_MONTH_YEAR_HEADER = "header"; @@ -1999,8 +1994,11 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> * Checks if subElement is inside the widget DOM hierarchy. * * @param w + * the widget to investigate * @param subElement - * @return true if {@code w} is a parent of subElement, false otherwise. + * the element to search for + * @return {@code true} if the given widget is a parent of the given + * element, {@code false} otherwise. */ protected boolean contains(Widget w, Element subElement) { if (w == null || w.getElement() == null) { @@ -2010,6 +2008,7 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> return w.getElement().isOrHasChild(subElement); } + @SuppressWarnings("unchecked") @Override public com.google.gwt.user.client.Element getSubPartElement( String subPart) { @@ -2132,8 +2131,8 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> */ public void setRangeEnd(String newRangeEnd) { if (!SharedUtil.equals(rangeEnd, newRangeEnd)) { - // Dates with year 10000 or more has + prefix, which is not compatible - // with format returned by dateStrResolution method + // Dates with year 10000 or more has + prefix, which is not + // compatible with format returned by dateStrResolution method if (newRangeEnd.startsWith("+")) { rangeEnd = newRangeEnd.substring(1); } else { diff --git a/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 8fc33a7c9c..e6609f79a4 100644 --- a/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -17,7 +17,6 @@ package com.vaadin.client.ui.combobox; import java.util.List; import java.util.Objects; -import java.util.logging.Logger; import com.vaadin.client.Profiler; import com.vaadin.client.annotations.OnStateChange; @@ -487,9 +486,6 @@ public class ComboBoxConnector extends AbstractListingConnector } } - private static final Logger LOGGER = Logger - .getLogger(ComboBoxConnector.class.getName()); - private class PagedDataChangeHandler implements DataChangeHandler { private final DataSource<?> dataSource; diff --git a/client/src/main/java/com/vaadin/client/ui/dd/DragAndDropHandler.java b/client/src/main/java/com/vaadin/client/ui/dd/DragAndDropHandler.java index b50063ed2b..3749af2982 100644 --- a/client/src/main/java/com/vaadin/client/ui/dd/DragAndDropHandler.java +++ b/client/src/main/java/com/vaadin/client/ui/dd/DragAndDropHandler.java @@ -116,11 +116,11 @@ public class DragAndDropHandler { // End drag if ESC is pressed int keyCode = event.getNativeEvent().getKeyCode(); if (keyCode == KeyCodes.KEY_ESCAPE) { - cancelDrag(event); + cancelDrag(); } break; case Event.ONTOUCHCANCEL: - cancelDrag(event); + cancelDrag(); break; case Event.ONTOUCHEND: case Event.ONMOUSEUP: @@ -236,7 +236,7 @@ public class DragAndDropHandler { } } - private void cancelDrag(NativePreviewEvent event) { + private void cancelDrag() { callback.onDragCancel(); callback.onDragEnd(); stopDrag(); diff --git a/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java b/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java index 6f9a1ded5c..b4ccab5d77 100644 --- a/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java +++ b/client/src/main/java/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java @@ -491,6 +491,7 @@ public class VAbstractOrderedLayout extends FlowPanel { * Assigns relative sizes to the children that should expand based on their * expand ratios. */ + @SuppressWarnings("deprecation") public void updateExpandedSizes() { // Ensure the expand wrapper is in place if (expandWrapper == null) { @@ -651,8 +652,7 @@ public class VAbstractOrderedLayout extends FlowPanel { totalSize += size; } } else { - int max = -1; - max = layoutManager.getOuterWidth( + int max = layoutManager.getOuterWidth( slot.getWidget().getElement()); if (slot.hasCaption()) { int max2 = layoutManager.getOuterWidth( diff --git a/client/src/main/java/com/vaadin/client/widgets/Escalator.java b/client/src/main/java/com/vaadin/client/widgets/Escalator.java index 4ea6254b72..8f6d8992bb 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java +++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java @@ -764,13 +764,13 @@ public class Escalator extends Widget /*-{ var vScroll = esc.@com.vaadin.client.widgets.Escalator::verticalScrollbar; var vScrollElem = vScroll.@com.vaadin.client.widget.escalator.ScrollbarBundle::getElement()(); - + var hScroll = esc.@com.vaadin.client.widgets.Escalator::horizontalScrollbar; var hScrollElem = hScroll.@com.vaadin.client.widget.escalator.ScrollbarBundle::getElement()(); - + return $entry(function(e) { var target = e.target; - + // in case the scroll event was native (i.e. scrollbars were dragged, or // the scrollTop/Left was manually modified), the bundles have old cache // values. We need to make sure that the caches are kept up to date. @@ -791,29 +791,29 @@ public class Escalator extends Widget return $entry(function(e) { var deltaX = e.deltaX ? e.deltaX : -0.5*e.wheelDeltaX; var deltaY = e.deltaY ? e.deltaY : -0.5*e.wheelDeltaY; - + // Delta mode 0 is in pixels; we don't need to do anything... - + // A delta mode of 1 means we're scrolling by lines instead of pixels // We need to scale the number of lines by the default line height if (e.deltaMode === 1) { var brc = esc.@com.vaadin.client.widgets.Escalator::body; deltaY *= brc.@com.vaadin.client.widgets.Escalator.AbstractRowContainer::getDefaultRowHeight()(); } - + // Other delta modes aren't supported if ((e.deltaMode !== undefined) && (e.deltaMode >= 2 || e.deltaMode < 0)) { var msg = "Unsupported wheel delta mode \"" + e.deltaMode + "\""; - + // Print warning message esc.@com.vaadin.client.widgets.Escalator::logWarning(*)(msg); } - + // IE8 has only delta y if (isNaN(deltaY)) { deltaY = -0.5*e.wheelDelta; } - + @com.vaadin.client.widgets.Escalator.JsniUtil::moveScrollFromEvent(*)(esc, deltaX, deltaY, e); }); }-*/; diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java index 6e0b9aaf59..3688eb32b1 100755 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -275,8 +275,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, */ public void setText(String text) { detach(); - this.content = text; - this.type = GridStaticCellType.TEXT; + content = text; + type = GridStaticCellType.TEXT; section.requestSectionRefresh(); } @@ -355,8 +355,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, public void setHtml(String html) { detach(); - this.content = html; - this.type = GridStaticCellType.HTML; + content = html; + type = GridStaticCellType.HTML; section.requestSectionRefresh(); } @@ -388,13 +388,13 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, * null). */ public void setWidget(Widget widget) { - if (this.content == widget) { + if (content == widget) { return; } detach(); - this.content = widget; - this.type = GridStaticCellType.WIDGET; + content = widget; + type = GridStaticCellType.WIDGET; section.requestSectionRefresh(); } @@ -7937,9 +7937,9 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, cell = new Cell(rowIndex, colIndex, cellElement); } catch (IllegalStateException exception) { - // IllegalStateException may occur if user has scrolled Grid so - // that Escalator has updated, and row under Editor is no longer - // there + // IllegalStateException may occur if user has scrolled + // Grid so that Escalator has updated, and row under + // Editor is no longer there return; } } else { |