format sources with correct formatter.
Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
@@ -461,10 +461,10 @@ public final class RSQLUtility {
|
||||
singleList.add(cb.lessThanOrEqualTo(pathOfString(fieldPath), value));
|
||||
break;
|
||||
case "=in=":
|
||||
singleList.add(getInPredicate(transformedValues,fieldPath));
|
||||
singleList.add(getInPredicate(transformedValues, fieldPath));
|
||||
break;
|
||||
case "=out=":
|
||||
singleList.add(getOutPredicate(transformedValues,fieldPath));
|
||||
singleList.add(getOutPredicate(transformedValues, fieldPath));
|
||||
break;
|
||||
default:
|
||||
LOGGER.info("operator symbol {} is either not supported or not implemented");
|
||||
@@ -472,8 +472,8 @@ public final class RSQLUtility {
|
||||
}
|
||||
|
||||
private Predicate getInPredicate(final List<Object> transformedValues, final Path<Object> fieldPath) {
|
||||
List<String> inParams = new ArrayList<>();
|
||||
for (Object param : transformedValues) {
|
||||
final List<String> inParams = new ArrayList<>();
|
||||
for (final Object param : transformedValues) {
|
||||
if (param instanceof String) {
|
||||
inParams.add(((String) param).toUpperCase());
|
||||
}
|
||||
@@ -487,8 +487,8 @@ public final class RSQLUtility {
|
||||
}
|
||||
|
||||
private Predicate getOutPredicate(final List<Object> transformedValues, final Path<Object> fieldPath) {
|
||||
List<String> outParams = new ArrayList<>();
|
||||
for (Object param : transformedValues) {
|
||||
final List<String> outParams = new ArrayList<>();
|
||||
for (final Object param : transformedValues) {
|
||||
if (param instanceof String) {
|
||||
outParams.add(((String) param).toUpperCase());
|
||||
}
|
||||
@@ -517,8 +517,9 @@ public final class RSQLUtility {
|
||||
final String[] graph = node.getSelector().split("\\" + FieldNameProvider.SUB_ATTRIBUTE_SEPERATOR);
|
||||
final String keyValue = graph[graph.length - 1];
|
||||
if (fieldPath instanceof MapJoin) {
|
||||
//Currently we support only string key .So below cast is safe.
|
||||
return cb.equal(cb.upper((Expression<String>) (((MapJoin<?, ?, ?>) fieldPath).key())), keyValue.toUpperCase());
|
||||
// Currently we support only string key .So below cast is safe.
|
||||
return cb.equal(cb.upper((Expression<String>) (((MapJoin<?, ?, ?>) fieldPath).key())),
|
||||
keyValue.toUpperCase());
|
||||
}
|
||||
|
||||
return cb.equal(cb.upper(fieldPath.get(enumField.getKeyFieldName())), keyValue.toUpperCase());
|
||||
@@ -532,9 +533,6 @@ public final class RSQLUtility {
|
||||
return cb.equal(fieldPath, transformedValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private Predicate getNotEqualToPredicate(final Object transformedValue, final Path<Object> fieldPath) {
|
||||
if (transformedValue instanceof String) {
|
||||
final String preFormattedValue = escapeValueToSQL((String) transformedValue);
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.filtermanagement;
|
||||
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
@@ -160,8 +159,6 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void populateComponents() {
|
||||
if (filterManagementUIState.getTfQuery().isPresent()) {
|
||||
queryTextField.setValue(filterManagementUIState.getTfQuery().get().getQuery());
|
||||
@@ -220,7 +217,6 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
closeIcon = createSearchResetIcon();
|
||||
}
|
||||
|
||||
|
||||
private TextField createNameTextField() {
|
||||
final TextField nameField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null,
|
||||
i18n.get("textfield.customfiltername"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
|
||||
@@ -337,10 +333,12 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
}
|
||||
|
||||
class StatusCircledAsync implements Runnable {
|
||||
private UI current;
|
||||
public StatusCircledAsync(UI current) {
|
||||
private final UI current;
|
||||
|
||||
public StatusCircledAsync(final UI current) {
|
||||
this.current = current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
UI.setCurrent(current);
|
||||
@@ -372,9 +370,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
}
|
||||
|
||||
private void enableDisableSaveButton(final boolean validationFailed, final String query) {
|
||||
if (validationFailed
|
||||
|| (isNameAndQueryEmpty(nameTextField.getValue(), query) || (query.equals(oldFilterQuery) && nameTextField
|
||||
.getValue().equals(oldFilterName)))) {
|
||||
if (validationFailed || (isNameAndQueryEmpty(nameTextField.getValue(), query)
|
||||
|| (query.equals(oldFilterQuery) && nameTextField.getValue().equals(oldFilterName)))) {
|
||||
saveButton.setEnabled(false);
|
||||
} else {
|
||||
if (hasSavePermission()) {
|
||||
@@ -390,7 +387,6 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private void showValidationSuccesIcon() {
|
||||
validationIcon.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
|
||||
validationIcon.setStyleName(SPUIStyleDefinitions.SUCCESS_ICON);
|
||||
@@ -474,8 +470,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
|
||||
targetFilterQuery.setName(nameTextField.getValue());
|
||||
targetFilterQuery.setQuery(queryTextField.getValue());
|
||||
targetFilterQueryManagement.createTargetFilterQuery(targetFilterQuery);
|
||||
notification.displaySuccess(i18n.get("message.create.filter.success",
|
||||
new Object[] { targetFilterQuery.getName() }));
|
||||
notification.displaySuccess(
|
||||
i18n.get("message.create.filter.success", new Object[] { targetFilterQuery.getName() }));
|
||||
eventBus.publish(this, CustomFilterUIEvent.CREATE_TARGET_FILTER_QUERY);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,14 +104,12 @@ public class CreateOrUpdateFilterTable extends Table {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void restoreOnLoad() {
|
||||
if (filterManagementUIState.isCreateFilterViewDisplayed()) {
|
||||
filterManagementUIState.setFilterQueryValue(null);
|
||||
} else {
|
||||
filterManagementUIState.getTfQuery().ifPresent(
|
||||
value -> filterManagementUIState.setFilterQueryValue(value.getQuery()));
|
||||
filterManagementUIState.getTfQuery()
|
||||
.ifPresent(value -> filterManagementUIState.setFilterQueryValue(value.getQuery()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,8 +125,9 @@ public class CreateOrUpdateFilterTable extends Table {
|
||||
targetQF.setQueryConfiguration(queryConfig);
|
||||
|
||||
// create lazy query container with lazy defination and query
|
||||
final LazyQueryContainer targetTableContainer = new LazyQueryContainer(new LazyQueryDefinition(true,
|
||||
SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_CONT_ID_NAME), targetQF);
|
||||
final LazyQueryContainer targetTableContainer = new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_CONT_ID_NAME),
|
||||
targetQF);
|
||||
targetTableContainer.getQueryView().getQueryDefinition().setMaxNestedPropertyDepth(PROPERTY_DEPT);
|
||||
|
||||
return targetTableContainer;
|
||||
@@ -181,16 +180,16 @@ public class CreateOrUpdateFilterTable extends Table {
|
||||
|
||||
private List<TableColumn> getVisbleColumns() {
|
||||
final List<TableColumn> columnList = new ArrayList<>();
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.get("header.name"),0.15f));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.get("header.name"), 0.15f));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.get("header.createdBy"), 0.1f));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"),
|
||||
0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER, i18n
|
||||
.get("header.assigned.ds"), 0.125F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER, i18n
|
||||
.get("header.installed.ds"), 0.125F));
|
||||
columnList.add(
|
||||
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER,
|
||||
i18n.get("header.assigned.ds"), 0.125F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER,
|
||||
i18n.get("header.installed.ds"), 0.125F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.get("header.description"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.STATUS_ICON, i18n.get("header.status"), 0.1F));
|
||||
return columnList;
|
||||
@@ -198,8 +197,8 @@ public class CreateOrUpdateFilterTable extends Table {
|
||||
|
||||
private Component getStatusIcon(final Object itemId) {
|
||||
final Item row1 = getItem(itemId);
|
||||
final TargetUpdateStatus targetStatus = (TargetUpdateStatus) row1.getItemProperty(
|
||||
SPUILabelDefinitions.VAR_TARGET_STATUS).getValue();
|
||||
final TargetUpdateStatus targetStatus = (TargetUpdateStatus) row1
|
||||
.getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue();
|
||||
final Label label = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_LABEL_SIMPLE);
|
||||
label.setContentMode(ContentMode.HTML);
|
||||
if (targetStatus == TargetUpdateStatus.PENDING) {
|
||||
|
||||
@@ -32,8 +32,8 @@ import org.vaadin.addons.lazyquerycontainer.QueryDefinition;
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
/**
|
||||
* Simple implementation of generics bean query which dynamically loads {@link ProxyTarget} batch
|
||||
* of beans.
|
||||
* Simple implementation of generics bean query which dynamically loads
|
||||
* {@link ProxyTarget} batch of beans.
|
||||
*
|
||||
*/
|
||||
public class CustomTargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
|
||||
@@ -163,7 +163,7 @@ public class CustomTargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
|
||||
*/
|
||||
@Override
|
||||
public int size() {
|
||||
long size=0;
|
||||
long size = 0;
|
||||
if (!Strings.isNullOrEmpty(filterQuery)) {
|
||||
size = getTargetManagement().countTargetByTargetFilterQuery(filterQuery);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class TargetFilterCountMessageLabel extends Label {
|
||||
if (custFUIEvent == CustomFilterUIEvent.TARGET_DETAILS_VIEW
|
||||
|| custFUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK
|
||||
|| custFUIEvent == CustomFilterUIEvent.EXIT_CREATE_OR_UPDATE_FILTRER_VIEW
|
||||
||custFUIEvent == CustomFilterUIEvent.UPDATE_TARGET_FILTER_SEARCH_ICON) {
|
||||
|| custFUIEvent == CustomFilterUIEvent.UPDATE_TARGET_FILTER_SEARCH_ICON) {
|
||||
UI.getCurrent().access(() -> displayTargetFilterMessage());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user