improve code quality
Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
@@ -26,8 +26,6 @@ import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
|
|||||||
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
|
||||||
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
import org.eclipse.hawkbit.ui.utils.TableColumn;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.vaadin.spring.events.EventBus;
|
import org.vaadin.spring.events.EventBus;
|
||||||
|
|
||||||
@@ -49,9 +47,9 @@ import com.vaadin.ui.themes.ValoTheme;
|
|||||||
*/
|
*/
|
||||||
public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4856562746502217630L;
|
private static final float DEFAULT_COLUMN_NAME_MIN_SIZE = 0.8F;
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(AbstractTable.class);
|
private static final long serialVersionUID = 4856562746502217630L;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected transient EventBus.SessionEventBus eventBus;
|
protected transient EventBus.SessionEventBus eventBus;
|
||||||
@@ -89,6 +87,13 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
|||||||
eventBus.unsubscribe(this);
|
eventBus.unsubscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the selected item id or in multiselect mode a set of selected ids.
|
||||||
|
*
|
||||||
|
* @param table
|
||||||
|
* the table to retrieve the selected ID(s)
|
||||||
|
* @return the ID(s) which are selected in the table
|
||||||
|
*/
|
||||||
public static <T> Set<T> getTableValue(final Table table) {
|
public static <T> Set<T> getTableValue(final Table table) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Set<T> values = (Set<T>) table.getValue();
|
Set<T> values = (Set<T>) table.getValue();
|
||||||
@@ -351,7 +356,7 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected float getColumnNameMinimizedSize() {
|
protected float getColumnNameMinimizedSize() {
|
||||||
return 0.8F;
|
return DEFAULT_COLUMN_NAME_MIN_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -899,6 +899,7 @@ public class TargetTable extends AbstractTable<Target, TargetIdName> {
|
|||||||
/**
|
/**
|
||||||
* Select all rows in the table.
|
* Select all rows in the table.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void selectAll() {
|
public void selectAll() {
|
||||||
|
|
||||||
// As Vaadin Table only returns the current ItemIds which are visible
|
// As Vaadin Table only returns the current ItemIds which are visible
|
||||||
|
|||||||
Reference in New Issue
Block a user