aboutsummaryrefslogtreecommitdiffstats
path: root/compatibility-client/src/main
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-09-21 10:51:51 +0200
committerHenri Sara <henri.sara@gmail.com>2017-09-21 11:51:51 +0300
commit867006d2f81aa813c36f614fc6f1b98a5937c5f3 (patch)
treefb2c34b1b58db8b3610a4a47010196069e90c436 /compatibility-client/src/main
parent719b12e44afc8b62458b1e29d1503e28544acc24 (diff)
downloadvaadin-framework-867006d2f81aa813c36f614fc6f1b98a5937c5f3.tar.gz
vaadin-framework-867006d2f81aa813c36f614fc6f1b98a5937c5f3.zip
Use String.isEmpty() (#10045)
Diffstat (limited to 'compatibility-client/src/main')
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java8
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java4
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java4
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/VUpload.java2
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java2
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java2
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeeklyLongEvents.java2
7 files changed, 12 insertions, 12 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java
index 64cc713e20..b78ad3928b 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VFilterSelect.java
@@ -1339,7 +1339,7 @@ public class VFilterSelect extends Composite
String height = getElement().getStyle().getHeight();
String preferredHeight = getPreferredHeight(pageLength);
- return !(height == null || height.length() == 0
+ return !(height == null || height.isEmpty()
|| height.equals(preferredHeight));
}
@@ -1916,7 +1916,7 @@ public class VFilterSelect extends Composite
*/
public void setSelectedItemIcon(String iconUri) {
- if (iconUri == null || iconUri.length() == 0) {
+ if (iconUri == null || iconUri.isEmpty()) {
if (selectedItemIcon != null) {
panel.remove(selectedItemIcon);
selectedItemIcon = null;
@@ -2302,7 +2302,7 @@ public class VFilterSelect extends Composite
for (FilterSelectSuggestion suggestion : currentSuggestions) {
// Collect captions so we can calculate minimum width for
// textarea
- if (captions.length() > 0) {
+ if (!captions.isEmpty()) {
captions += "|";
}
captions += WidgetUtil
@@ -2549,7 +2549,7 @@ public class VFilterSelect extends Composite
@Override
public void setWidth(String width) {
super.setWidth(width);
- if (width.length() != 0) {
+ if (!width.isEmpty()) {
tb.setWidth("100%");
}
}
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java
index ee9048d4c2..2140610559 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java
@@ -143,7 +143,7 @@ public class VOptionGroup extends VOptionGroupBase
}
String iconUrl = opUidl.getStringAttribute("icon");
- if (iconUrl != null && iconUrl.length() != 0) {
+ if (iconUrl != null && !iconUrl.isEmpty()) {
Icon icon = client.getIcon(iconUrl);
itemHtml = icon.getElement().getString() + itemHtml;
}
@@ -162,7 +162,7 @@ public class VOptionGroup extends VOptionGroupBase
op = new RadioButton(paintableId);
op.setStyleName("v-radiobutton");
}
- if (iconUrl != null && iconUrl.length() != 0) {
+ if (iconUrl != null && !iconUrl.isEmpty()) {
WidgetUtil.sinkOnloadForImages(op.getElement());
op.addHandler(iconLoadHandler, LoadEvent.getType());
}
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
index 2e20abe4a0..cf8d53d42a 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
@@ -7256,8 +7256,8 @@ public class VScrollTable extends FlowPanel
@Override
public void setHeight(String height) {
- if (height.length() == 0
- && getElement().getStyle().getHeight().length() != 0) {
+ if (height.isEmpty()
+ && !getElement().getStyle().getHeight().isEmpty()) {
/*
* Changing from defined to undefined size -> should do a size init
* to take page length into account again
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VUpload.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VUpload.java
index 4969f19933..1a93e04e1e 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VUpload.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VUpload.java
@@ -314,7 +314,7 @@ public class VUpload extends SimplePanel {
VConsole.log("Submit cancelled (disabled or already submitted)");
return;
}
- if (fu.getFilename().length() == 0) {
+ if (fu.getFilename().isEmpty()) {
VConsole.log("Submitting empty selection (no file)");
}
// flush possibly pending variable changes, so they will be handled
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java
index 5695365db8..65b49b8434 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java
@@ -91,7 +91,7 @@ public class DateCellDayEvent extends FocusableHTML
weekGrid = parent;
Style s = getElement().getStyle();
- if (event.getStyleName().length() > 0) {
+ if (!event.getStyleName().isEmpty()) {
addStyleDependentName(event.getStyleName());
}
s.setPosition(Position.ABSOLUTE);
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java
index f671d7c21d..df0d74d3b5 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java
@@ -283,7 +283,7 @@ public class SimpleDayCell extends FocusableFlowPanel implements MouseUpHandler,
eventDiv.setTimeSpecificEvent(false);
Date from = e.getStart();
Date to = e.getEnd();
- if (e.getStyleName().length() > 0) {
+ if (!e.getStyleName().isEmpty()) {
eventDiv.addStyleName("month-event " + e.getStyleName());
} else {
eventDiv.addStyleName("month-event");
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeeklyLongEvents.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeeklyLongEvents.java
index 4ed86b0b68..bc5bb9c4a4 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeeklyLongEvents.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeeklyLongEvents.java
@@ -98,7 +98,7 @@ public class WeeklyLongEvents extends HorizontalPanel implements HasTooltipKey {
eventLabel.addStyleDependentName("continued-to");
}
final String extraStyle = calendarEvent.getStyleName();
- if (extraStyle != null && extraStyle.length() > 0) {
+ if (extraStyle != null && !extraStyle.isEmpty()) {
eventLabel.addStyleDependentName(extraStyle + "-all-day");
}
if (!started) {