fix accessing the UI thread when updating the total target label

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
Michael Hirsch
2016-02-11 17:07:18 +01:00
parent 5cb1952c80
commit 19fb5332ef

View File

@@ -71,11 +71,11 @@ public class TargetFilterCountMessageLabel extends Label {
@EventBusListenerMethod(scope = EventScope.SESSION)
void onEvent(final CustomFilterUIEvent custFUIEvent) {
if (custFUIEvent == CustomFilterUIEvent.FILTER_TARGET_BY_QUERY
|| custFUIEvent == CustomFilterUIEvent.TARGET_DETAILS_VIEW
if (custFUIEvent == CustomFilterUIEvent.TARGET_DETAILS_VIEW
|| custFUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK
|| custFUIEvent == CustomFilterUIEvent.EXIT_CREATE_OR_UPDATE_FILTRER_VIEW) {
displayTargetFilterMessage();
|| custFUIEvent == CustomFilterUIEvent.EXIT_CREATE_OR_UPDATE_FILTRER_VIEW
|| custFUIEvent == CustomFilterUIEvent.FILTER_TARGET_BY_QUERY) {
this.getUI().access(() -> displayTargetFilterMessage());
}
}
@@ -89,8 +89,8 @@ public class TargetFilterCountMessageLabel extends Label {
long totalTargets = 0;
if (filterManagementUIState.isCreateFilterViewDisplayed() || filterManagementUIState.isEditViewDisplayed()) {
if (null != filterManagementUIState.getFilterQueryValue()) {
totalTargets = targetManagement.countTargetByTargetFilterQuery(filterManagementUIState
.getFilterQueryValue());
totalTargets = targetManagement
.countTargetByTargetFilterQuery(filterManagementUIState.getFilterQueryValue());
}
final StringBuilder targetMessage = new StringBuilder(i18n.get("label.target.filtered.total"));
if (filterManagementUIState.getTargetsTruncated() != null) {