Fix diamond operator
Remove unused override comments Remove unused javadoc on private methode Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -208,14 +208,13 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
||||
}
|
||||
|
||||
private Container createArtifactLazyQueryContainer() {
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
||||
return getArtifactLazyQueryContainer(queryConfiguration);
|
||||
}
|
||||
|
||||
private LazyQueryContainer getArtifactLazyQueryContainer(final Map<String, Object> queryConfig) {
|
||||
|
||||
final BeanQueryFactory<ArtifactBeanQuery> artifactQF = new BeanQueryFactory<ArtifactBeanQuery>(
|
||||
ArtifactBeanQuery.class);
|
||||
final BeanQueryFactory<ArtifactBeanQuery> artifactQF = new BeanQueryFactory<>(ArtifactBeanQuery.class);
|
||||
artifactQF.setQueryConfiguration(queryConfig);
|
||||
final LazyQueryContainer artifactCont = new LazyQueryContainer(new LazyQueryDefinition(true, 10, "id"),
|
||||
artifactQF);
|
||||
@@ -431,7 +430,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
||||
titleOfArtifactDetails.setContentMode(ContentMode.HTML);
|
||||
}
|
||||
}
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
||||
if (baseSwModuleId != null) {
|
||||
queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId);
|
||||
}
|
||||
|
||||
@@ -47,12 +47,6 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
@Autowired
|
||||
private transient EventBus.SessionEventBus eventBus;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.AbstractAcceptCriteria#analyseDragComponent
|
||||
* (com.vaadin.event .dd.DragAndDropEvent, com.vaadin.ui.Component)
|
||||
*/
|
||||
@Override
|
||||
protected void analyseDragComponent(final Component compsource) {
|
||||
final String sourceID = getComponentId(compsource);
|
||||
@@ -60,24 +54,11 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
eventBus.publish(this, event);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#hideDropHints
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
protected void hideDropHints() {
|
||||
eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#invalidDrop()
|
||||
*/
|
||||
@Override
|
||||
protected void invalidDrop() {
|
||||
uiNotification.displayValidationError(SPUILabelDefinitions.ACTION_NOT_ALLOWED);
|
||||
@@ -92,41 +73,23 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
return id;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
|
||||
* getDropHintConfigurations()
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, Object> getDropHintConfigurations() {
|
||||
return DROP_HINTS_CONFIGS;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
|
||||
* publishDragStartEvent(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void publishDragStartEvent(final Object event) {
|
||||
eventBus.publish(this, event);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
|
||||
* getDropConfigurations()
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, List<String>> getDropConfigurations() {
|
||||
return DROP_CONFIGS;
|
||||
}
|
||||
|
||||
private static Map<String, List<String>> createDropConfigurations() {
|
||||
final Map<String, List<String>> config = new HashMap<String, List<String>>();
|
||||
final Map<String, List<String>> config = new HashMap<>();
|
||||
// Delete drop area droppable components
|
||||
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID, Arrays.asList(
|
||||
SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX));
|
||||
@@ -135,7 +98,7 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
}
|
||||
|
||||
private static Map<String, Object> createDropHintConfigurations() {
|
||||
final Map<String, Object> config = new HashMap<String, Object>();
|
||||
final Map<String, Object> config = new HashMap<>();
|
||||
config.put(SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX, UploadArtifactUIEvent.SOFTWARE_TYPE_DRAG_START);
|
||||
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, UploadArtifactUIEvent.SOFTWARE_DRAG_START);
|
||||
return config;
|
||||
|
||||
@@ -32,10 +32,6 @@ import com.google.common.base.Strings;
|
||||
* Simple implementation of generics bean query which dynamically loads a batch
|
||||
* of beans.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class BaseSwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSoftwareModuleItem> {
|
||||
private static final long serialVersionUID = 4362142538539335466L;
|
||||
@@ -76,7 +72,7 @@ public class BaseSwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSoftwareMo
|
||||
@Override
|
||||
protected List<ProxyBaseSoftwareModuleItem> loadBeans(final int startIndex, final int count) {
|
||||
final Slice<SoftwareModule> swModuleBeans;
|
||||
final List<ProxyBaseSoftwareModuleItem> proxyBeans = new ArrayList<ProxyBaseSoftwareModuleItem>();
|
||||
final List<ProxyBaseSoftwareModuleItem> proxyBeans = new ArrayList<>();
|
||||
|
||||
if (type == null && Strings.isNullOrEmpty(searchText)) {
|
||||
swModuleBeans = getSoftwareManagementService()
|
||||
|
||||
@@ -55,8 +55,6 @@ import com.vaadin.ui.UI;
|
||||
/**
|
||||
* Header of Software module table.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@ViewScope
|
||||
@@ -78,11 +76,11 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
|
||||
@Autowired
|
||||
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the filter layout.
|
||||
*/
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -111,36 +109,23 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.SPTable#getTableId()
|
||||
*/
|
||||
@Override
|
||||
protected String getTableId() {
|
||||
return SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.SPTable#createContainer()
|
||||
*/
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||
|
||||
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<BaseSwModuleBeanQuery>(
|
||||
BaseSwModuleBeanQuery.class);
|
||||
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<>(BaseSwModuleBeanQuery.class);
|
||||
swQF.setQueryConfiguration(queryConfiguration);
|
||||
|
||||
final LazyQueryContainer container = new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
return container;
|
||||
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
}
|
||||
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
final Map<String, Object> queryConfig = new HashMap<>();
|
||||
artifactUploadState.getSoftwareModuleFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
@@ -149,8 +134,6 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void addContainerProperties(final Container container) {
|
||||
@@ -274,16 +257,9 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
select(swModule.getId());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.table.SPTable#getTableVisibleColumns
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
protected List<TableColumn> getTableVisibleColumns() {
|
||||
final List<TableColumn> columnList = new ArrayList<TableColumn>();
|
||||
final List<TableColumn> columnList = new ArrayList<>();
|
||||
if (isMaximized()) {
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.1F));
|
||||
|
||||
@@ -193,7 +193,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
|
||||
getPreviewButtonColor(DEFAULT_COLOR);
|
||||
tagColorPreviewBtn.setStyleName(TAG_DYNAMIC_STYLE);
|
||||
|
||||
selectors = new HashSet<ColorSelector>();
|
||||
selectors = new HashSet<>();
|
||||
selectedColor = new Color(44, 151, 32);
|
||||
selPreview = new SpColorPickerPreview(selectedColor);
|
||||
|
||||
@@ -741,38 +741,17 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.vaadin.ui.components.colorpicker.HasColorChangeListener#
|
||||
* addColorChangeListener(com.vaadin
|
||||
* .ui.components.colorpicker.ColorChangeListener)
|
||||
*/
|
||||
@Override
|
||||
public void addColorChangeListener(final ColorChangeListener listener) {
|
||||
LOG.debug("inside addColorChangeListener");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.vaadin.ui.components.colorpicker.HasColorChangeListener#
|
||||
* removeColorChangeListener(com.
|
||||
* vaadin.ui.components.colorpicker.ColorChangeListener)
|
||||
*/
|
||||
@Override
|
||||
public void removeColorChangeListener(final ColorChangeListener listener) {
|
||||
LOG.debug("inside removeColorChangeListener");
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.vaadin.ui.components.colorpicker.ColorSelector#setColor(com.vaadin.
|
||||
* shared.ui.colorpicker .Color)
|
||||
*/
|
||||
@Override
|
||||
public void setColor(final Color color) {
|
||||
if (color == null) {
|
||||
@@ -788,23 +767,11 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.vaadin.ui.components.colorpicker.ColorSelector#getColor()
|
||||
*/
|
||||
@Override
|
||||
public Color getColor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.vaadin.ui.components.colorpicker.ColorChangeListener#colorChanged(com
|
||||
* .vaadin.ui.components .colorpicker.ColorChangeEvent)
|
||||
*/
|
||||
@Override
|
||||
public void colorChanged(final ColorChangeEvent event) {
|
||||
setColor(event.getColor());
|
||||
|
||||
@@ -56,11 +56,7 @@ import com.vaadin.ui.themes.ValoTheme;
|
||||
|
||||
/**
|
||||
* Artifact upload confirmation popup.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class UploadConfirmationwindow implements Button.ClickListener {
|
||||
|
||||
@@ -106,7 +102,7 @@ public class UploadConfirmationwindow implements Button.ClickListener {
|
||||
|
||||
private IndexedContainer tabelContainer;
|
||||
|
||||
private final List<UploadStatus> uploadResultList = new ArrayList<UploadStatus>();
|
||||
private final List<UploadStatus> uploadResultList = new ArrayList<>();
|
||||
|
||||
private VerticalLayout uploadArtifactDetails;
|
||||
|
||||
|
||||
@@ -69,8 +69,6 @@ import com.vaadin.ui.VerticalLayout;
|
||||
|
||||
/**
|
||||
* Upload files layout.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ViewScope
|
||||
@SpringComponent
|
||||
@@ -102,7 +100,7 @@ public class UploadLayout extends VerticalLayout {
|
||||
|
||||
private final AtomicInteger numberOfFilesActuallyUpload = new AtomicInteger();
|
||||
|
||||
private final List<String> duplicateFileNamesList = new ArrayList<String>();
|
||||
private final List<String> duplicateFileNamesList = new ArrayList<>();
|
||||
|
||||
private Button processBtn;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class UploadResultWindow implements Button.ClickListener {
|
||||
|
||||
private static final long serialVersionUID = 5205927189362269027L;
|
||||
|
||||
private List<UploadStatus> uploadResultList = new ArrayList<UploadStatus>();
|
||||
private List<UploadStatus> uploadResultList = new ArrayList<>();
|
||||
|
||||
private Button closeBtn;
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class DistributionSetTypeBeanQuery extends AbstractBeanQuery<Distribution
|
||||
@Override
|
||||
protected List<DistributionSetType> loadBeans(final int startIndex, final int count) {
|
||||
Page<DistributionSetType> typeBeans;
|
||||
final List<DistributionSetType> distSetTypeList = new ArrayList<DistributionSetType>();
|
||||
final List<DistributionSetType> distSetTypeList = new ArrayList<>();
|
||||
if (startIndex == 0 && firstPageDistSetType != null) {
|
||||
typeBeans = firstPageDistSetType;
|
||||
} else {
|
||||
|
||||
@@ -45,8 +45,6 @@ import com.vaadin.ui.UI;
|
||||
|
||||
/**
|
||||
* Implementation of target/ds tag token layout.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@@ -80,6 +78,7 @@ public class DistributionTagToken extends AbstractTagToken {
|
||||
// To Be Done : have to set this value based on view???
|
||||
private static final Boolean NOTAGS_SELECTED = Boolean.FALSE;
|
||||
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -129,7 +128,7 @@ public class DistributionTagToken extends AbstractTagToken {
|
||||
}
|
||||
|
||||
private DistributionSetTagAssigmentResult toggleAssignment(final String tagNameSelected) {
|
||||
final Set<Long> distributionList = new HashSet<Long>();
|
||||
final Set<Long> distributionList = new HashSet<>();
|
||||
distributionList.add(selectedDS.getId());
|
||||
final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment(distributionList,
|
||||
tagNameSelected);
|
||||
@@ -137,12 +136,6 @@ public class DistributionTagToken extends AbstractTagToken {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.tagDetails.AbstractTagToken#unassignTag(
|
||||
* java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected void unassignTag(final String tagName) {
|
||||
final DistributionSetTagAssigmentResult result = toggleAssignment(tagName);
|
||||
@@ -160,26 +153,14 @@ public class DistributionTagToken extends AbstractTagToken {
|
||||
|
||||
/* To Be Done : this implementation will vary in views */
|
||||
private List<String> getClickedTagList() {
|
||||
return new ArrayList<String>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.tagDetails.AbstractTagToken#
|
||||
* hasUpdatePermission()
|
||||
*/
|
||||
@Override
|
||||
protected Boolean isToggleTagAssignmentAllowed() {
|
||||
return spChecker.hasUpdateDistributionPermission();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.tagDetails.AbstractTagToken#
|
||||
* displayAlreadyAssignedTags()
|
||||
*/
|
||||
@Override
|
||||
public void displayAlreadyAssignedTags() {
|
||||
removePreviouslyAddedTokens();
|
||||
@@ -190,12 +171,6 @@ public class DistributionTagToken extends AbstractTagToken {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.tagDetails.AbstractTagToken#
|
||||
* populateContainer()
|
||||
*/
|
||||
@Override
|
||||
protected void populateContainer() {
|
||||
container.removeAllItems();
|
||||
|
||||
@@ -79,8 +79,6 @@ import com.vaadin.ui.themes.ValoTheme;
|
||||
|
||||
/**
|
||||
* Window for create update Distribution Set Type.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@ViewScope
|
||||
@@ -221,7 +219,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
|
||||
getPreviewButtonColor(DEFAULT_COLOR);
|
||||
|
||||
selectors = new HashSet<ColorSelector>();
|
||||
selectors = new HashSet<>();
|
||||
selectedColor = new Color(44, 151, 32);
|
||||
selPreview = new SpColorPickerPreview(selectedColor);
|
||||
|
||||
@@ -457,6 +455,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
sourceTable.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public String generateDescription(final Component source, final Object itemId, final Object propertyId) {
|
||||
final Item item = sourceTable.getItem(itemId);
|
||||
final String description = (String) item.getItemProperty(DIST_TYPE_DESCRIPTION).getValue();
|
||||
@@ -657,10 +656,10 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
DistributionSetType newDistType = new DistributionSetType(typeKeyValue, typeNameValue, typeDescValue);
|
||||
for (final Long id : itemIds) {
|
||||
final Item item = selectedTable.getItem(id);
|
||||
final String dist_type_name = (String) item.getItemProperty(DIST_TYPE_NAME).getValue();
|
||||
final String distTypeName = (String) item.getItemProperty(DIST_TYPE_NAME).getValue();
|
||||
final CheckBox mandatoryCheckBox = (CheckBox) item.getItemProperty(DIST_TYPE_MANDATORY).getValue();
|
||||
final Boolean isMandatory = mandatoryCheckBox.getValue();
|
||||
final SoftwareModuleType swModuleType = softwareManagement.findSoftwareModuleTypeByName(dist_type_name);
|
||||
final SoftwareModuleType swModuleType = softwareManagement.findSoftwareModuleTypeByName(distTypeName);
|
||||
if (isMandatory) {
|
||||
newDistType.addMandatoryModuleType(swModuleType);
|
||||
|
||||
@@ -1032,7 +1031,6 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
* as the selected tag from combo
|
||||
*/
|
||||
private void setTypeTagCombo(final String distSetTypeSelected) {
|
||||
boolean mandatory = false;
|
||||
typeName.setValue(distSetTypeSelected);
|
||||
getSourceTableData();
|
||||
selectedTable.getContainerDataSource().removeAllItems();
|
||||
@@ -1053,13 +1051,11 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
||||
saveDistSetType.setEnabled(false);
|
||||
}
|
||||
for (final SoftwareModuleType swModuleType : selectedTypeTag.getOptionalModuleTypes()) {
|
||||
mandatory = false;
|
||||
addTargetTableforUpdate(swModuleType, mandatory);
|
||||
addTargetTableforUpdate(swModuleType, false);
|
||||
}
|
||||
|
||||
for (final SoftwareModuleType swModuleType : selectedTypeTag.getMandatoryModuleTypes()) {
|
||||
mandatory = true;
|
||||
addTargetTableforUpdate(swModuleType, mandatory);
|
||||
addTargetTableforUpdate(swModuleType, true);
|
||||
}
|
||||
|
||||
if (null == selectedTypeTag.getColour()) {
|
||||
|
||||
@@ -74,8 +74,6 @@ import com.vaadin.ui.UI;
|
||||
/**
|
||||
* Distribution set table.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@ViewScope
|
||||
@@ -114,7 +112,7 @@ public class DistributionSetTable extends AbstractTable {
|
||||
|
||||
@Autowired
|
||||
private transient TargetManagement targetManagement;
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the component.
|
||||
*/
|
||||
@@ -136,24 +134,11 @@ public class DistributionSetTable extends AbstractTable {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.table.AbstractTable#getTableId()
|
||||
*/
|
||||
@Override
|
||||
protected String getTableId() {
|
||||
return SPUIComponetIdProvider.DIST_TABLE_ID;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.table.AbstractTable#createContainer(
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
|
||||
@@ -165,9 +150,9 @@ public class DistributionSetTable extends AbstractTable {
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME),
|
||||
distributionQF);
|
||||
}
|
||||
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
final Map<String, Object> queryConfig = new HashMap<>();
|
||||
manageDistUIState.getManageDistFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
@@ -178,14 +163,7 @@ public class DistributionSetTable extends AbstractTable {
|
||||
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.AbstractTable#addContainerProperties
|
||||
* (com.vaadin.data.Container )
|
||||
*/
|
||||
@Override
|
||||
protected void addContainerProperties(final Container container) {
|
||||
HawkbitCommonUtil.getDsTableColumnProperties(container);
|
||||
@@ -193,12 +171,6 @@ public class DistributionSetTable extends AbstractTable {
|
||||
Boolean.class, null, false, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTable#
|
||||
* addCustomGeneratedColumns ()
|
||||
*/
|
||||
@Override
|
||||
protected void addCustomGeneratedColumns() {
|
||||
/**
|
||||
@@ -206,23 +178,12 @@ public class DistributionSetTable extends AbstractTable {
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTable#
|
||||
* isFirstRowSelectedOnLoad ()
|
||||
*/
|
||||
@Override
|
||||
protected boolean isFirstRowSelectedOnLoad() {
|
||||
return !manageDistUIState.getSelectedDistributions().isPresent()
|
||||
|| manageDistUIState.getSelectedDistributions().get().isEmpty();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.AbstractTable#getItemIdToSelect()
|
||||
*/
|
||||
@Override
|
||||
protected Object getItemIdToSelect() {
|
||||
if (manageDistUIState.getSelectedDistributions().isPresent()) {
|
||||
@@ -231,12 +192,6 @@ public class DistributionSetTable extends AbstractTable {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.table.AbstractTable#onValueChange()
|
||||
*/
|
||||
@Override
|
||||
protected void onValueChange() {
|
||||
eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
|
||||
@@ -271,33 +226,16 @@ public class DistributionSetTable extends AbstractTable {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.table.AbstractTable#isMaximized()
|
||||
*/
|
||||
@Override
|
||||
protected boolean isMaximized() {
|
||||
return manageDistUIState.isDsTableMaximized();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.AbstractTable#getTableVisibleColumns
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
protected List<TableColumn> getTableVisibleColumns() {
|
||||
return HawkbitCommonUtil.getTableVisibleColumns(isMaximized(), false, i18n);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.AbstractTable#getTableDropHandler()
|
||||
*/
|
||||
@Override
|
||||
protected DropHandler getTableDropHandler() {
|
||||
return new DropHandler() {
|
||||
|
||||
@@ -37,8 +37,6 @@ import com.google.common.base.Strings;
|
||||
/**
|
||||
* Manage Distributions table bean query.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
|
||||
|
||||
@@ -83,28 +81,15 @@ public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery#constructBean()
|
||||
*/
|
||||
@Override
|
||||
protected ProxyDistribution constructBean() {
|
||||
return new ProxyDistribution();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery#loadBeans(int,
|
||||
* int)
|
||||
*/
|
||||
@Override
|
||||
protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) {
|
||||
Page<DistributionSet> distBeans;
|
||||
final List<ProxyDistribution> proxyDistributions = new ArrayList<ProxyDistribution>();
|
||||
final List<ProxyDistribution> proxyDistributions = new ArrayList<>();
|
||||
if (startIndex == 0 && firstPageDistributionSets != null) {
|
||||
distBeans = firstPageDistributionSets;
|
||||
} else if (Strings.isNullOrEmpty(searchText)) {
|
||||
@@ -136,24 +121,12 @@ public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
|
||||
return proxyDistributions;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery#saveBeans(java.
|
||||
* util.List, java.util.List, java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void saveBeans(final List<ProxyDistribution> arg0, final List<ProxyDistribution> arg1,
|
||||
final List<ProxyDistribution> arg2) {
|
||||
// Add,Delete and Update are performed through repository methods
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery#size()
|
||||
*/
|
||||
@Override
|
||||
public int size() {
|
||||
if (Strings.isNullOrEmpty(searchText) && null == distributionSetType) {
|
||||
|
||||
@@ -28,8 +28,6 @@ import com.vaadin.ui.Component;
|
||||
/**
|
||||
* Distributions View for Accept criteria.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@ViewScope
|
||||
@@ -47,12 +45,6 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
@Autowired
|
||||
private transient EventBus.SessionEventBus eventBus;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.AbstractAcceptCriteria#analyseDragComponent
|
||||
* (com.vaadin.event .dd.DragAndDropEvent, com.vaadin.ui.Component)
|
||||
*/
|
||||
@Override
|
||||
protected void analyseDragComponent(final Component compsource) {
|
||||
final String sourceID = getComponentId(compsource);
|
||||
@@ -60,24 +52,11 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
eventBus.publish(this, event);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#hideDropHints
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
protected void hideDropHints() {
|
||||
eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#invalidDrop()
|
||||
*/
|
||||
@Override
|
||||
protected void invalidDrop() {
|
||||
uiNotification.displayValidationError(SPUILabelDefinitions.ACTION_NOT_ALLOWED);
|
||||
@@ -94,34 +73,16 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
return id;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
|
||||
* getDropHintConfigurations()
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, Object> getDropHintConfigurations() {
|
||||
return DROP_HINTS_CONFIGS;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
|
||||
* publishDragStartEvent(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void publishDragStartEvent(final Object event) {
|
||||
eventBus.publish(this, event);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
|
||||
* getDropConfigurations()
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, List<String>> getDropConfigurations() {
|
||||
return DROP_CONFIGS;
|
||||
@@ -137,7 +98,7 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
}
|
||||
|
||||
private static Map<String, List<String>> createDropConfigurations() {
|
||||
final Map<String, List<String>> config = new HashMap<String, List<String>>();
|
||||
final Map<String, List<String>> config = new HashMap<>();
|
||||
|
||||
// Delete drop area droppable components
|
||||
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID,
|
||||
@@ -153,7 +114,7 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
}
|
||||
|
||||
private static Map<String, Object> createDropHintConfigurations() {
|
||||
final Map<String, Object> config = new HashMap<String, Object>();
|
||||
final Map<String, Object> config = new HashMap<>();
|
||||
config.put(SPUIDefinitions.DISTRIBUTION_TYPE_ID_PREFIXS, DragEvent.DISTRIBUTION_TYPE_DRAG);
|
||||
config.put(SPUIComponetIdProvider.DIST_TABLE_ID, DragEvent.DISTRIBUTION_DRAG);
|
||||
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, DragEvent.SOFTWAREMODULE_DRAG);
|
||||
|
||||
@@ -32,9 +32,6 @@ import com.google.common.base.Strings;
|
||||
/**
|
||||
* Simple implementation of generics bean query which dynamically loads a batch
|
||||
* of beans.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem> {
|
||||
@@ -77,17 +74,10 @@ public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem>
|
||||
return new ProxyBaseSwModuleItem();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery#loadBeans(int,
|
||||
* int)
|
||||
*/
|
||||
@Override
|
||||
protected List<ProxyBaseSwModuleItem> loadBeans(final int startIndex, final int count) {
|
||||
final Slice<CustomSoftwareModule> swModuleBeans;
|
||||
final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<ProxyBaseSwModuleItem>();
|
||||
final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<>();
|
||||
|
||||
swModuleBeans = getSoftwareManagement().findSoftwareModuleOrderByDistribution(
|
||||
new OffsetBasedPageRequest(startIndex, count, new Sort(Direction.ASC, "name", "version")),
|
||||
|
||||
@@ -67,8 +67,6 @@ import com.vaadin.ui.Window;
|
||||
|
||||
/**
|
||||
* Implementation of software module table using generic abstract table styles .
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@@ -94,10 +92,11 @@ public class SwModuleTable extends AbstractTable {
|
||||
|
||||
@Autowired
|
||||
private ArtifactDetailsLayout artifactDetailsLayout;
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Initialize the filter layout.
|
||||
*/
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -158,56 +157,35 @@ public class SwModuleTable extends AbstractTable {
|
||||
}
|
||||
}
|
||||
|
||||
/* All Override methods */
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.SPTable#getTableId()
|
||||
*/
|
||||
@Override
|
||||
protected String getTableId() {
|
||||
return SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.SPTable#createContainer()
|
||||
*/
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||
|
||||
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<SwModuleBeanQuery>(
|
||||
SwModuleBeanQuery.class);
|
||||
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<>(SwModuleBeanQuery.class);
|
||||
swQF.setQueryConfiguration(queryConfiguration);
|
||||
|
||||
final LazyQueryContainer container = new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
return container;
|
||||
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
}
|
||||
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
final Map<String, Object> queryConfig = new HashMap<>();
|
||||
manageDistUIState.getSoftwareModuleFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType()
|
||||
.ifPresent(type -> queryConfig.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
|
||||
|
||||
manageDistUIState.getLastSelectedDistribution().ifPresent(
|
||||
distIdName -> queryConfig.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
|
||||
manageDistUIState.getLastSelectedDistribution()
|
||||
.ifPresent(distIdName -> queryConfig.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
|
||||
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.SPTable#addContainerProperties(com.
|
||||
* vaadin.data.Container)
|
||||
*/
|
||||
@Override
|
||||
protected void addContainerProperties(final Container container) {
|
||||
final LazyQueryContainer lazyContainer = (LazyQueryContainer) container;
|
||||
@@ -226,11 +204,6 @@ public class SwModuleTable extends AbstractTable {
|
||||
lazyContainer.addContainerProperty(SPUILabelDefinitions.VAR_SOFT_TYPE_ID, Long.class, null, false, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.SPTable#addCustomGeneratedColumns()
|
||||
*/
|
||||
@Override
|
||||
protected void addCustomGeneratedColumns() {
|
||||
|
||||
@@ -249,32 +222,16 @@ public class SwModuleTable extends AbstractTable {
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.SPTable#isFirstRowSelectedOnLoad()
|
||||
*/
|
||||
@Override
|
||||
protected boolean isFirstRowSelectedOnLoad() {
|
||||
return manageDistUIState.getSelectedSoftwareModules().isEmpty();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.table.SPTable#getItemIdToSelect()
|
||||
*/
|
||||
@Override
|
||||
protected Object getItemIdToSelect() {
|
||||
return manageDistUIState.getSelectedSoftwareModules();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.SPTable#isMaximized()
|
||||
*/
|
||||
@Override
|
||||
protected boolean isMaximized() {
|
||||
return manageDistUIState.isSwModuleTableMaximized();
|
||||
@@ -306,16 +263,9 @@ public class SwModuleTable extends AbstractTable {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.table.SPTable#getTableVisibleColumns
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
protected List<TableColumn> getTableVisibleColumns() {
|
||||
final List<TableColumn> columnList = new ArrayList<TableColumn>();
|
||||
final List<TableColumn> columnList = new ArrayList<>();
|
||||
if (isMaximized()) {
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.1F));
|
||||
@@ -370,11 +320,6 @@ public class SwModuleTable extends AbstractTable {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param color
|
||||
* @param isAssigned
|
||||
* @return
|
||||
*/
|
||||
private String getTableStyle(final Long typeId, final boolean isAssigned, final String color) {
|
||||
if (isAssigned) {
|
||||
addTypeStyle(typeId, color);
|
||||
@@ -391,11 +336,6 @@ public class SwModuleTable extends AbstractTable {
|
||||
+ "{background-color:" + color + " !important;background-image:none !important }")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId
|
||||
* @param propertyId
|
||||
* @return
|
||||
*/
|
||||
private String createTableStyle(final Object itemId, final Object propertyId) {
|
||||
if (null == propertyId) {
|
||||
final Item item = getItem(itemId);
|
||||
@@ -429,12 +369,6 @@ public class SwModuleTable extends AbstractTable {
|
||||
return name + "." + version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new software module to table.
|
||||
*
|
||||
* @param swModule
|
||||
* new software module
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void addSoftwareModule(final SoftwareModule swModule) {
|
||||
final Object addItem = addItem();
|
||||
@@ -461,11 +395,6 @@ public class SwModuleTable extends AbstractTable {
|
||||
select(swModule.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId
|
||||
* @param nameVersionStr
|
||||
* @return
|
||||
*/
|
||||
private void showArtifactDetailsWindow(final Long itemId, final String nameVersionStr) {
|
||||
final Window atrifactDtlsWindow = new Window();
|
||||
atrifactDtlsWindow.setCaption(HawkbitCommonUtil.getArtifactoryDetailsLabelId(nameVersionStr));
|
||||
|
||||
@@ -40,8 +40,6 @@ import com.vaadin.spring.annotation.ViewScope;
|
||||
/**
|
||||
* Software Module Type filter buttons.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@ViewScope
|
||||
@@ -64,40 +62,25 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
||||
* @param filterButtonClickBehaviour
|
||||
* the clickable behaviour.
|
||||
*/
|
||||
@Override
|
||||
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
||||
super.init(filterButtonClickBehaviour);
|
||||
eventBus.subscribe(this);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* getButtonsTableId()
|
||||
*/
|
||||
@Override
|
||||
protected String getButtonsTableId() {
|
||||
|
||||
return SPUIComponetIdProvider.SW_MODULE_TYPE_TABLE_ID;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* createButtonsLazyQueryContainer ()
|
||||
*/
|
||||
@Override
|
||||
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
final BeanQueryFactory<SoftwareModuleTypeBeanQuery> typeQF = new BeanQueryFactory<SoftwareModuleTypeBeanQuery>(
|
||||
final Map<String, Object> queryConfig = new HashMap<>();
|
||||
final BeanQueryFactory<SoftwareModuleTypeBeanQuery> typeQF = new BeanQueryFactory<>(
|
||||
SoftwareModuleTypeBeanQuery.class);
|
||||
typeQF.setQueryConfiguration(queryConfig);
|
||||
final LazyQueryContainer lazyQueryContainer = new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, 20, SPUILabelDefinitions.VAR_NAME), typeQF);
|
||||
return lazyQueryContainer;
|
||||
return new LazyQueryContainer(new LazyQueryDefinition(true, 20, SPUILabelDefinitions.VAR_NAME), typeQF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,13 +88,6 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* isClickedByDefault(java.lang .Long)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isClickedByDefault(final Long buttonId) {
|
||||
|
||||
@@ -119,25 +95,11 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
||||
&& manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType().get().getId().equals(buttonId);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* createButtonId(java.lang. String)
|
||||
*/
|
||||
@Override
|
||||
protected String createButtonId(final String name) {
|
||||
return SPUIComponetIdProvider.SM_TYPE_FILTER_BTN_ID + name;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* getFilterButtonDropHandler()
|
||||
*/
|
||||
@Override
|
||||
protected DropHandler getFilterButtonDropHandler() {
|
||||
|
||||
@@ -156,13 +118,6 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* getButttonWrapperId()
|
||||
*/
|
||||
@Override
|
||||
protected String getButttonWrapperIdPrefix() {
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ import com.vaadin.spring.annotation.VaadinSessionScope;
|
||||
|
||||
/**
|
||||
* Distribution table filter state.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@VaadinSessionScope
|
||||
@@ -31,9 +29,9 @@ public class ManageDistFilters implements Serializable {
|
||||
|
||||
private String searchText;
|
||||
|
||||
private List<String> distSetTags = new ArrayList<String>();
|
||||
private List<String> distSetTags = new ArrayList<>();
|
||||
|
||||
private List<String> clickedDistSetTags = new ArrayList<String>();
|
||||
private List<String> clickedDistSetTags = new ArrayList<>();
|
||||
|
||||
private DistributionSetType clickedDistSetType;
|
||||
|
||||
@@ -61,17 +59,10 @@ public class ManageDistFilters implements Serializable {
|
||||
this.clickedDistSetTags = clickedDistSetTags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the searchText
|
||||
*/
|
||||
public Optional<String> getSearchText() {
|
||||
return searchText == null ? Optional.empty() : Optional.of(searchText);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param searchText
|
||||
* the searchText to set
|
||||
*/
|
||||
public void setSearchText(final String searchText) {
|
||||
this.searchText = searchText;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ import com.google.common.base.Strings;
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class TargetFilterBeanQuery extends AbstractBeanQuery<ProxyTargetFilter> {
|
||||
|
||||
private static final long serialVersionUID = 1845964596238990987L;
|
||||
@@ -76,8 +75,8 @@ public class TargetFilterBeanQuery extends AbstractBeanQuery<ProxyTargetFilter>
|
||||
|
||||
@Override
|
||||
protected List<ProxyTargetFilter> loadBeans(final int startIndex, final int count) {
|
||||
Slice<TargetFilterQuery> targetFilterQuery = null;
|
||||
final List<ProxyTargetFilter> proxyTargetFilter = new ArrayList<ProxyTargetFilter>();
|
||||
Slice<TargetFilterQuery> targetFilterQuery;
|
||||
final List<ProxyTargetFilter> proxyTargetFilter = new ArrayList<>();
|
||||
if (startIndex == 0 && firstPageTargetFilter != null) {
|
||||
targetFilterQuery = firstPageTargetFilter;
|
||||
} else if (Strings.isNullOrEmpty(searchText)) {
|
||||
|
||||
@@ -41,7 +41,6 @@ import org.vaadin.spring.events.annotation.EventBusListenerMethod;
|
||||
import com.vaadin.data.Container;
|
||||
import com.vaadin.data.Item;
|
||||
import com.vaadin.server.FontAwesome;
|
||||
import com.vaadin.server.Sizeable.Unit;
|
||||
import com.vaadin.spring.annotation.SpringComponent;
|
||||
import com.vaadin.spring.annotation.ViewScope;
|
||||
import com.vaadin.ui.Button;
|
||||
@@ -84,20 +83,20 @@ public class TargetFilterTable extends Table {
|
||||
* Initialize the Action History Table.
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
setStyleName("sp-table");
|
||||
setSizeFull();
|
||||
setImmediate(true);
|
||||
setHeight(100.0f, Unit.PERCENTAGE);
|
||||
addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
|
||||
addStyleName(ValoTheme.TABLE_SMALL);
|
||||
addCustomGeneratedColumns();
|
||||
populateTableData();
|
||||
setColumnCollapsingAllowed(true);
|
||||
setColumnProperties();
|
||||
setId(SPUIComponetIdProvider.TAEGET_FILTER_TABLE_ID);
|
||||
eventBus.subscribe(this);
|
||||
}
|
||||
public void init() {
|
||||
setStyleName("sp-table");
|
||||
setSizeFull();
|
||||
setImmediate(true);
|
||||
setHeight(100.0f, Unit.PERCENTAGE);
|
||||
addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
|
||||
addStyleName(ValoTheme.TABLE_SMALL);
|
||||
addCustomGeneratedColumns();
|
||||
populateTableData();
|
||||
setColumnCollapsingAllowed(true);
|
||||
setColumnProperties();
|
||||
setId(SPUIComponetIdProvider.TAEGET_FILTER_TABLE_ID);
|
||||
eventBus.subscribe(this);
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
void destroy() {
|
||||
@@ -114,20 +113,14 @@ public class TargetFilterTable extends Table {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a empty HierarchicalContainer.
|
||||
*
|
||||
*
|
||||
*/
|
||||
private Container createContainer() {
|
||||
final Map<String, Object> queryConfig = prepareQueryConfigFilters();
|
||||
final BeanQueryFactory<TargetFilterBeanQuery> targetQF = new BeanQueryFactory<TargetFilterBeanQuery>(
|
||||
TargetFilterBeanQuery.class);
|
||||
final BeanQueryFactory<TargetFilterBeanQuery> targetQF = new BeanQueryFactory<>(TargetFilterBeanQuery.class);
|
||||
|
||||
targetQF.setQueryConfiguration(queryConfig);
|
||||
// create lazy query container with lazy defination and query
|
||||
final LazyQueryContainer targetFilterContainer = new LazyQueryContainer(new LazyQueryDefinition(true,
|
||||
SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_ID), targetQF);
|
||||
final LazyQueryContainer targetFilterContainer = new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_ID), targetQF);
|
||||
targetFilterContainer.getQueryView().getQueryDefinition().setMaxNestedPropertyDepth(PROPERTY_DEPT);
|
||||
|
||||
return targetFilterContainer;
|
||||
@@ -135,15 +128,12 @@ public class TargetFilterTable extends Table {
|
||||
}
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
filterManagementUIState.getCustomFilterSearchText().ifPresent(
|
||||
value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
final Map<String, Object> queryConfig = new HashMap<>();
|
||||
filterManagementUIState.getCustomFilterSearchText()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a empty HierarchicalContainer.
|
||||
*/
|
||||
private void addContainerproperties() {
|
||||
/* Create HierarchicalContainer container */
|
||||
container.addContainerProperty(SPUILabelDefinitions.NAME, Link.class, null);
|
||||
@@ -154,7 +144,7 @@ public class TargetFilterTable extends Table {
|
||||
}
|
||||
|
||||
private List<TableColumn> getVisbleColumns() {
|
||||
final List<TableColumn> columnList = new ArrayList<TableColumn>();
|
||||
final List<TableColumn> columnList = new ArrayList<>();
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.get("header.name"), 0.2F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_USER, i18n.get("header.createdBy"), 0.15F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.2F));
|
||||
@@ -165,7 +155,6 @@ public class TargetFilterTable extends Table {
|
||||
|
||||
}
|
||||
|
||||
/* re -create the container and get the data and set it to the table */
|
||||
private void refreshContainer() {
|
||||
populateTableData();
|
||||
|
||||
@@ -187,10 +176,6 @@ public class TargetFilterTable extends Table {
|
||||
.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
private void onDelete(final ClickEvent event) {
|
||||
/* Display the confirmation */
|
||||
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.filter.delete.confirmbox"),
|
||||
@@ -206,8 +191,8 @@ public class TargetFilterTable extends Table {
|
||||
* of the deleted custom filter.
|
||||
*/
|
||||
|
||||
notification.displaySuccess(i18n.get("message.delete.filter.success",
|
||||
new Object[] { deletedFilterName }));
|
||||
notification.displaySuccess(
|
||||
i18n.get("message.delete.filter.success", new Object[] { deletedFilterName }));
|
||||
refreshContainer();
|
||||
}
|
||||
});
|
||||
@@ -236,10 +221,6 @@ public class TargetFilterTable extends Table {
|
||||
return updateIcon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
private void onClickOfDetailButton(final ClickEvent event) {
|
||||
final String targetFilterName = (String) ((Button) event.getComponent()).getData();
|
||||
final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement
|
||||
|
||||
@@ -202,16 +202,8 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
hierarchicalContainer.addContainerProperty(SPUIDefinitions.ACTION_HIS_TBL_ROLLOUT_NAME, String.class, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Action based on status.
|
||||
*
|
||||
* @param type
|
||||
* as Action.Type
|
||||
*
|
||||
* @return List of Actions
|
||||
*/
|
||||
private List<Object> getVisbleColumns() {
|
||||
final List<Object> visibleColumnIds = new ArrayList<Object>();
|
||||
final List<Object> visibleColumnIds = new ArrayList<>();
|
||||
visibleColumnIds.add(SPUIDefinitions.ACTION_HIS_TBL_ACTIVE);
|
||||
visibleColumnIds.add(SPUIDefinitions.ACTION_HIS_TBL_DIST);
|
||||
visibleColumnIds.add(SPUIDefinitions.ACTION_HIS_TBL_DATETIME);
|
||||
|
||||
@@ -96,7 +96,7 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
|
||||
@Override
|
||||
protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) {
|
||||
Page<DistributionSet> distBeans;
|
||||
final List<ProxyDistribution> proxyDistributions = new ArrayList<ProxyDistribution>();
|
||||
final List<ProxyDistribution> proxyDistributions = new ArrayList<>();
|
||||
if (startIndex == 0 && firstPageDistributionSets != null) {
|
||||
distBeans = firstPageDistributionSets;
|
||||
} else if (pinnedControllerId != null) {
|
||||
|
||||
@@ -73,8 +73,6 @@ import com.vaadin.ui.UI;
|
||||
|
||||
/**
|
||||
* Distribution set table.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@@ -112,11 +110,11 @@ public class DistributionTable extends AbstractTable {
|
||||
private Boolean isDistPinned = false;
|
||||
|
||||
private Button distributinPinnedBtn;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the distribution table.
|
||||
*/
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -142,7 +140,7 @@ public class DistributionTable extends AbstractTable {
|
||||
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
||||
|| event == DistributionTableFilterEvent.FILTER_BY_TAG) {
|
||||
UI.getCurrent().access(() -> refreshFilter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||
@@ -221,23 +219,22 @@ public class DistributionTable extends AbstractTable {
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||
|
||||
final BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<DistributionBeanQuery>(
|
||||
|
||||
final BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<>(
|
||||
DistributionBeanQuery.class);
|
||||
distributionQF.setQueryConfiguration(queryConfiguration);
|
||||
final LazyQueryContainer distributionContainer = new LazyQueryContainer(
|
||||
return new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME),
|
||||
distributionQF);
|
||||
return distributionContainer;
|
||||
}
|
||||
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
managementUIState.getDistributionTableFilters().getSearchText()
|
||||
final Map<String, Object> queryConfig = new HashMap<>();
|
||||
managementUIState.getDistributionTableFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
managementUIState.getDistributionTableFilters().getPinnedTargetId()
|
||||
managementUIState.getDistributionTableFilters().getPinnedTargetId()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.ORDER_BY_PINNED_TARGET, value));
|
||||
final List<String> list = new ArrayList<String>();
|
||||
final List<String> list = new ArrayList<>();
|
||||
queryConfig.put(SPUIDefinitions.FILTER_BY_NO_TAG,
|
||||
managementUIState.getDistributionTableFilters().isNoTagSelected());
|
||||
if (!managementUIState.getDistributionTableFilters().getDistSetTags().isEmpty()) {
|
||||
@@ -247,23 +244,11 @@ public class DistributionTable extends AbstractTable {
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.AbstractTable#addContainerProperties(
|
||||
* com.vaadin.data.Container )
|
||||
*/
|
||||
@Override
|
||||
protected void addContainerProperties(final Container container) {
|
||||
HawkbitCommonUtil.getDsTableColumnProperties(container);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTable#
|
||||
* addCustomGeneratedColumns()
|
||||
*/
|
||||
@Override
|
||||
protected void addCustomGeneratedColumns() {
|
||||
addGeneratedColumn(SPUILabelDefinitions.PIN_COLUMN, new Table.ColumnGenerator() {
|
||||
@@ -276,23 +261,12 @@ public class DistributionTable extends AbstractTable {
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTable#
|
||||
* isFirstRowSelectedOnLoad()
|
||||
*/
|
||||
@Override
|
||||
protected boolean isFirstRowSelectedOnLoad() {
|
||||
return !managementUIState.getSelectedDsIdName().isPresent()
|
||||
|| managementUIState.getSelectedDsIdName().get().isEmpty();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.AbstractTable#getItemIdToSelect()
|
||||
*/
|
||||
@Override
|
||||
protected Object getItemIdToSelect() {
|
||||
if (managementUIState.getSelectedDsIdName().isPresent()) {
|
||||
@@ -301,16 +275,9 @@ public class DistributionTable extends AbstractTable {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.table.AbstractTable#onValueChange()
|
||||
*/
|
||||
@Override
|
||||
protected void onValueChange() {
|
||||
eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
|
||||
@SuppressWarnings("unchecked")
|
||||
final Set<DistributionSetIdName> values = HawkbitCommonUtil.getSelectedDSDetails(this);
|
||||
DistributionSetIdName value = null;
|
||||
if (values != null && !values.isEmpty()) {
|
||||
@@ -319,10 +286,7 @@ public class DistributionTable extends AbstractTable {
|
||||
while (iterator.hasNext()) {
|
||||
value = iterator.next();
|
||||
}
|
||||
/**
|
||||
* Adding null check to make to avoid NPE.Its weird that at times
|
||||
* getValue returns null.
|
||||
*/
|
||||
|
||||
if (null != value) {
|
||||
managementUIState.setSelectedDsIdName(values);
|
||||
managementUIState.setLastSelectedDsIdName(value);
|
||||
@@ -339,33 +303,16 @@ public class DistributionTable extends AbstractTable {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.table.AbstractTable#isMaximized()
|
||||
*/
|
||||
@Override
|
||||
protected boolean isMaximized() {
|
||||
return managementUIState.isDsTableMaximized();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.AbstractTable#getTableVisibleColumns(
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
protected List<TableColumn> getTableVisibleColumns() {
|
||||
return HawkbitCommonUtil.getTableVisibleColumns(isMaximized(), true, i18n);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.table.AbstractTable#getTableDropHandler()
|
||||
*/
|
||||
@Override
|
||||
protected DropHandler getTableDropHandler() {
|
||||
return new DropHandler() {
|
||||
@@ -403,7 +350,7 @@ public class DistributionTable extends AbstractTable {
|
||||
final com.vaadin.event.dd.TargetDetails taregtDet = event.getTargetDetails();
|
||||
final Table distTable = (Table) taregtDet.getTarget();
|
||||
final Set<DistributionSetIdName> distsSelected = HawkbitCommonUtil.getSelectedDSDetails(distTable);
|
||||
final Set<Long> distList = new HashSet<Long>();
|
||||
final Set<Long> distList = new HashSet<>();
|
||||
|
||||
final AbstractSelectTargetDetails dropData = (AbstractSelectTargetDetails) event.getTargetDetails();
|
||||
final Object distItemId = dropData.getItemIdOver();
|
||||
@@ -435,7 +382,7 @@ public class DistributionTable extends AbstractTable {
|
||||
// assign dist to those targets
|
||||
final List<Target> assignedTargets = targetService.findTargetsByTag(targetTagName);
|
||||
if (!assignedTargets.isEmpty()) {
|
||||
final Set<TargetIdName> targetDetailsList = new HashSet<TargetIdName>();
|
||||
final Set<TargetIdName> targetDetailsList = new HashSet<>();
|
||||
assignedTargets.forEach(target -> targetDetailsList
|
||||
.add(new TargetIdName(target.getId(), target.getControllerId(), target.getName())));
|
||||
assignTargetToDs(getItem(distItemId), targetDetailsList);
|
||||
@@ -448,7 +395,7 @@ public class DistributionTable extends AbstractTable {
|
||||
final TableTransferable transferable = (TableTransferable) event.getTransferable();
|
||||
final Table source = transferable.getSourceComponent();
|
||||
final Set<TargetIdName> targetsSelected = HawkbitCommonUtil.getSelectedTargetDetails(source);
|
||||
final Set<TargetIdName> targetDetailsList = new HashSet<TargetIdName>();
|
||||
final Set<TargetIdName> targetDetailsList = new HashSet<>();
|
||||
|
||||
if (!targetsSelected.contains(transferable.getData("itemId"))) {
|
||||
targetDetailsList.add((TargetIdName) transferable.getData("itemId"));
|
||||
@@ -474,13 +421,6 @@ public class DistributionTable extends AbstractTable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate event.
|
||||
*
|
||||
* @param dragEvent
|
||||
* as event
|
||||
* @return boolean as flag
|
||||
*/
|
||||
private Boolean doValidation(final DragAndDropEvent dragEvent) {
|
||||
final Component compsource = dragEvent.getTransferable().getSourceComponent();
|
||||
if (compsource instanceof Table) {
|
||||
@@ -528,15 +468,6 @@ public class DistributionTable extends AbstractTable {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the assignment.
|
||||
*
|
||||
* @param targetDetailsList
|
||||
* @param source
|
||||
* @param distId
|
||||
* @param distName
|
||||
* @return String as indicator
|
||||
*/
|
||||
private String validate(final Set<TargetIdName> targetDetailsList,
|
||||
final DistributionSetIdName distributionSetIdName) {
|
||||
String pendingActionMessage = null;
|
||||
@@ -555,17 +486,6 @@ public class DistributionTable extends AbstractTable {
|
||||
return pendingActionMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Message for Pending Action.
|
||||
*
|
||||
* @param message
|
||||
* as msg
|
||||
* @param targId
|
||||
* as ID
|
||||
* @param distName
|
||||
* as Dist Set Name
|
||||
* @return String as message
|
||||
*/
|
||||
private String getPendingActionMessage(final String message, final String targId, final String distNameVersion) {
|
||||
String pendActionMsg = i18n.get("message.target.assigned.pending");
|
||||
if (null == message) {
|
||||
@@ -574,12 +494,6 @@ public class DistributionTable extends AbstractTable {
|
||||
return pendActionMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show or Hide Popup Notification Message.
|
||||
*
|
||||
* @param message
|
||||
* as msg
|
||||
*/
|
||||
private void showOrHidePopupAndNotification(final String message) {
|
||||
if (null != managementUIState.getAssignedList() && !managementUIState.getAssignedList().isEmpty()) {
|
||||
eventBus.publish(this, ManagementUIEvent.UPDATE_COUNT);
|
||||
@@ -636,19 +550,6 @@ public class DistributionTable extends AbstractTable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Added by Saumya Get Pin style.
|
||||
*
|
||||
* @param itemId
|
||||
* as item clicked
|
||||
* @param propertyId
|
||||
* as property
|
||||
* @param installedDistItemIds
|
||||
* as set
|
||||
* @param assignedDistTableItemIds
|
||||
* as set
|
||||
* @return String as Style
|
||||
*/
|
||||
private String getPinnedDistributionStyle(final Long installedDistItemIds, final Long assignedDistTableItemIds,
|
||||
final Object itemId) {
|
||||
final Long distId = ((DistributionSetIdName) itemId).getId();
|
||||
@@ -662,10 +563,6 @@ public class DistributionTable extends AbstractTable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param itemId
|
||||
* @return
|
||||
*/
|
||||
private Object getPinButton(final Object itemId) {
|
||||
final DistributionSetIdName dist = (DistributionSetIdName) getContainerDataSource().getItem(itemId)
|
||||
.getItemProperty(SPUILabelDefinitions.VAR_DIST_ID_NAME).getValue();
|
||||
@@ -684,12 +581,6 @@ public class DistributionTable extends AbstractTable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add listener to pin.
|
||||
*
|
||||
* @param pinBtn
|
||||
* as event
|
||||
*/
|
||||
private void addPinClickListener(final ClickEvent event) {
|
||||
eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
|
||||
checkifAlreadyPinned(event.getButton());
|
||||
@@ -701,12 +592,6 @@ public class DistributionTable extends AbstractTable {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check already pinned.
|
||||
*
|
||||
* @param eventBtn
|
||||
* as button
|
||||
*/
|
||||
private void checkifAlreadyPinned(final Button eventBtn) {
|
||||
final Long newPinnedDistItemId = ((DistributionSetIdName) eventBtn.getData()).getId();
|
||||
Long pinnedDistId = null;
|
||||
@@ -758,9 +643,6 @@ public class DistributionTable extends AbstractTable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set style to distribution set table.
|
||||
*/
|
||||
private void styleDistributionSetTable() {
|
||||
setCellStyleGenerator(new Table.CellStyleGenerator() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -772,12 +654,6 @@ public class DistributionTable extends AbstractTable {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply pin style to pin.
|
||||
*
|
||||
* @param eventBtn
|
||||
* as button
|
||||
*/
|
||||
private void applyPinStyle(final Button eventBtn) {
|
||||
final StringBuilder style = new StringBuilder(SPUIComponentProvider.getPinButtonStyle());
|
||||
style.append(' ').append(SPUIStyleDefinitions.DIST_PIN).append(' ').append("tablePin").append(' ')
|
||||
@@ -822,14 +698,9 @@ public class DistributionTable extends AbstractTable {
|
||||
* @param assignedDistTableItemIds
|
||||
* Item ids of assigned distribution set
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public void styleDistributionSetTable(final Long installedDistItemId, final Long assignedDistTableItemId) {
|
||||
setCellStyleGenerator(new Table.CellStyleGenerator() {
|
||||
@Override
|
||||
public String getStyle(final Table source, final Object itemId, final Object propertyId) {
|
||||
return getPinnedDistributionStyle(installedDistItemId, assignedDistTableItemId, itemId);
|
||||
}
|
||||
});
|
||||
setCellStyleGenerator((source, itemId, propertyId) -> getPinnedDistributionStyle(installedDistItemId,
|
||||
assignedDistTableItemId, itemId));
|
||||
}
|
||||
|
||||
public void setDistributinPinnedBtn(final Button distributinPinnedBtn) {
|
||||
|
||||
@@ -75,7 +75,7 @@ public class DistributionTagBeanQuery extends AbstractBeanQuery<ProxyTag> {
|
||||
@Override
|
||||
protected List<ProxyTag> loadBeans(final int startIndex, final int count) {
|
||||
Page<DistributionSetTag> dsTagBeans;
|
||||
final List<ProxyTag> tagList = new ArrayList<ProxyTag>();
|
||||
final List<ProxyTag> tagList = new ArrayList<>();
|
||||
if (startIndex == 0 && firstPageDsTag != null) {
|
||||
dsTagBeans = firstPageDsTag;
|
||||
} else {
|
||||
|
||||
@@ -70,6 +70,7 @@ public class DistributionTagButtons extends AbstractFilterButtons {
|
||||
* @param filterButtonClickBehaviour
|
||||
* the clickable behaviour.
|
||||
*/
|
||||
@Override
|
||||
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
|
||||
super.init(filterButtonClickBehaviour);
|
||||
addNewTag(new DistributionSetTag("NO TAG"));
|
||||
@@ -106,34 +107,18 @@ public class DistributionTagButtons extends AbstractFilterButtons {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* getButtonsTableId()
|
||||
*/
|
||||
@Override
|
||||
protected String getButtonsTableId() {
|
||||
return SPUIComponetIdProvider.DISTRIBUTION_TAG_TABLE_ID;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* createButtonsLazyQueryContainer ()
|
||||
*/
|
||||
@Override
|
||||
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
final BeanQueryFactory<DistributionTagBeanQuery> tagQF = new BeanQueryFactory<DistributionTagBeanQuery>(
|
||||
DistributionTagBeanQuery.class);
|
||||
final Map<String, Object> queryConfig = new HashMap<>();
|
||||
final BeanQueryFactory<DistributionTagBeanQuery> tagQF = new BeanQueryFactory<>(DistributionTagBeanQuery.class);
|
||||
tagQF.setQueryConfiguration(queryConfig);
|
||||
final LazyQueryContainer tagContainer = HawkbitCommonUtil.createDSLazyQueryContainer(
|
||||
return HawkbitCommonUtil.createDSLazyQueryContainer(
|
||||
new BeanQueryFactory<DistributionTagBeanQuery>(DistributionTagBeanQuery.class));
|
||||
return tagContainer;
|
||||
|
||||
}
|
||||
|
||||
@@ -142,13 +127,6 @@ public class DistributionTagButtons extends AbstractFilterButtons {
|
||||
return SPUIDefinitions.DISTRIBUTION_TAG_BUTTON;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* isClickedByDefault(java.lang .Long)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isClickedByDefault(final Long buttonId) {
|
||||
final DistributionSetTag dsTagObject = tagMgmtService.findDistributionSetTagById(buttonId);
|
||||
@@ -161,37 +139,16 @@ public class DistributionTagButtons extends AbstractFilterButtons {
|
||||
return managementUIState.getDistributionTableFilters().isNoTagSelected();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* createButtonId(java.lang. String)
|
||||
*/
|
||||
@Override
|
||||
protected String createButtonId(final String name) {
|
||||
return name;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* getFilterButtonDropHandler()
|
||||
*/
|
||||
@Override
|
||||
protected DropHandler getFilterButtonDropHandler() {
|
||||
return spDistTagDropEvent;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* getButttonWrapperId()
|
||||
*/
|
||||
@Override
|
||||
protected String getButttonWrapperIdPrefix() {
|
||||
return SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS;
|
||||
|
||||
@@ -86,20 +86,13 @@ public class DistributionTagDropEvent implements DropHandler {
|
||||
private Boolean isNoTagAssigned(final DragAndDropEvent event) {
|
||||
final String tagName = ((DragAndDropWrapper) (event.getTargetDetails().getTarget())).getData().toString();
|
||||
if (tagName.equals(SPUIDefinitions.DISTRIBUTION_TAG_BUTTON)) {
|
||||
notification.displayValidationError(i18n.get("message.tag.cannot.be.assigned",
|
||||
new Object[] { i18n.get("label.no.tag.assigned") }));
|
||||
notification.displayValidationError(
|
||||
i18n.get("message.tag.cannot.be.assigned", new Object[] { i18n.get("label.no.tag.assigned") }));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the drop.
|
||||
*
|
||||
* @param event
|
||||
* DragAndDropEvent reference
|
||||
* @return Boolean
|
||||
*/
|
||||
private Boolean validate(final DragAndDropEvent event) {
|
||||
final Component compsource = event.getTransferable().getSourceComponent();
|
||||
if (!(compsource instanceof Table)) {
|
||||
@@ -116,11 +109,6 @@ public class DistributionTagDropEvent implements DropHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* validate the update permission.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
private boolean checkForDSUpdatePermission() {
|
||||
if (!permChecker.hasUpdateDistributionPermission()) {
|
||||
|
||||
@@ -131,13 +119,6 @@ public class DistributionTagDropEvent implements DropHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* validate the source tables.
|
||||
*
|
||||
* @param source
|
||||
* table
|
||||
* @return boolean
|
||||
*/
|
||||
private boolean validateIfSourceIsDs(final Table source) {
|
||||
if (!source.getId().equals(SPUIComponetIdProvider.DIST_TABLE_ID)) {
|
||||
notification.displayValidationError(i18n.get(SPUILabelDefinitions.ACTION_NOT_ALLOWED));
|
||||
@@ -146,12 +127,6 @@ public class DistributionTagDropEvent implements DropHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process target Drop event.
|
||||
*
|
||||
* @param event
|
||||
* DragAndDropEvent
|
||||
*/
|
||||
private void processDistributionDrop(final DragAndDropEvent event) {
|
||||
|
||||
final com.vaadin.event.dd.TargetDetails targetDetails = event.getTargetDetails();
|
||||
@@ -161,7 +136,7 @@ public class DistributionTagDropEvent implements DropHandler {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
final Set<DistributionSetIdName> distSelected = (Set<DistributionSetIdName>) source.getValue();
|
||||
final Set<Long> distributionList = new HashSet<Long>();
|
||||
final Set<Long> distributionList = new HashSet<>();
|
||||
if (!distSelected.contains(transferable.getData(ITEMID))) {
|
||||
distributionList.add(((DistributionSetIdName) transferable.getData(ITEMID)).getId());
|
||||
} else {
|
||||
@@ -172,8 +147,8 @@ public class DistributionTagDropEvent implements DropHandler {
|
||||
SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS);
|
||||
|
||||
final List<String> tagsClickedList = distFilterParameters.getDistSetTags();
|
||||
final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment(
|
||||
distributionList, distTagName);
|
||||
final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment(distributionList,
|
||||
distTagName);
|
||||
|
||||
notification.displaySuccess(HawkbitCommonUtil.getDistributionTagAssignmentMsg(distTagName, result, i18n));
|
||||
if (result.getUnassigned() >= 1 && !tagsClickedList.isEmpty()) {
|
||||
|
||||
@@ -47,12 +47,6 @@ public class ManagementViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
@Autowired
|
||||
private transient EventBus.SessionEventBus eventBus;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see hawkbit.server.ui.common.AbstractAcceptCriteria#analyseDragComponent
|
||||
* (com.vaadin.event .dd.DragAndDropEvent, com.vaadin.ui.Component)
|
||||
*/
|
||||
@Override
|
||||
protected void analyseDragComponent(final Component compsource) {
|
||||
final String sourceID = getComponentId(compsource);
|
||||
@@ -60,24 +54,11 @@ public class ManagementViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
eventBus.publish(this, event);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#hideDropHints
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
protected void hideDropHints() {
|
||||
eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#invalidDrop()
|
||||
*/
|
||||
@Override
|
||||
protected void invalidDrop() {
|
||||
uiNotification.displayValidationError(SPUILabelDefinitions.ACTION_NOT_ALLOWED);
|
||||
@@ -94,60 +75,31 @@ public class ManagementViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
return id;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
|
||||
* getDropHintConfigurations()
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, Object> getDropHintConfigurations() {
|
||||
return DROP_HINTS_CONFIGS;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
|
||||
* publishDragStartEvent(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected void publishDragStartEvent(final Object event) {
|
||||
eventBus.publish(this, event);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
|
||||
* getDropConfigurations()
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, List<String>> getDropConfigurations() {
|
||||
return DROP_CONFIGS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private boolean isDistributionTagId(final String id) {
|
||||
return id != null && id.startsWith(SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
private boolean isTargetTagId(final String id) {
|
||||
return id != null && id.startsWith(SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
private static Map<String, List<String>> createDropConfigurations() {
|
||||
final Map<String, List<String>> config = new HashMap<String, List<String>>();
|
||||
final Map<String, List<String>> config = new HashMap<>();
|
||||
|
||||
// Delete drop area acceptable components
|
||||
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID,
|
||||
@@ -174,7 +126,7 @@ public class ManagementViewAcceptCriteria extends AbstractAcceptCriteria {
|
||||
}
|
||||
|
||||
private static Map<String, Object> createDropHintConfigurations() {
|
||||
final Map<String, Object> config = new HashMap<String, Object>();
|
||||
final Map<String, Object> config = new HashMap<>();
|
||||
config.put(SPUIDefinitions.TARGET_TAG_ID_PREFIXS, DragEvent.TARGET_TAG_DRAG);
|
||||
config.put(SPUIComponetIdProvider.TARGET_TABLE_ID, DragEvent.TARGET_DRAG);
|
||||
config.put(SPUIComponetIdProvider.DIST_TABLE_ID, DragEvent.DISTRIBUTION_DRAG);
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.eclipse.hawkbit.repository.TagManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout;
|
||||
import org.eclipse.hawkbit.ui.management.dstable.DistributionTable;
|
||||
import org.eclipse.hawkbit.ui.management.event.BulkUploadPopupEvent;
|
||||
import org.eclipse.hawkbit.ui.management.event.DragEvent;
|
||||
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
|
||||
@@ -28,7 +27,6 @@ import org.eclipse.hawkbit.ui.management.event.SaveActionWindowEvent;
|
||||
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
|
||||
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent.TargetComponentEvent;
|
||||
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
|
||||
import org.eclipse.hawkbit.ui.management.targettable.TargetTable;
|
||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
|
||||
@@ -85,12 +83,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||
@Autowired
|
||||
private CountMessageLabel countMessageLabel;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#init()
|
||||
*/
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -172,73 +165,31 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* hasDeletePermission()
|
||||
*/
|
||||
@Override
|
||||
protected boolean hasDeletePermission() {
|
||||
return permChecker.hasDeleteDistributionPermission() || permChecker.hasDeleteTargetPermission();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* hasUpdatePermission()
|
||||
*/
|
||||
@Override
|
||||
protected boolean hasUpdatePermission() {
|
||||
return permChecker.hasUpdateTargetPermission() && permChecker.hasReadDistributionPermission();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* getDeleteAreaLabel()
|
||||
*/
|
||||
@Override
|
||||
protected String getDeleteAreaLabel() {
|
||||
return i18n.get("label.components.drop.area");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* getDeleteAreaId()
|
||||
*/
|
||||
@Override
|
||||
protected String getDeleteAreaId() {
|
||||
return SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* getDeleteLayoutAcceptCriteria ()
|
||||
*/
|
||||
@Override
|
||||
protected AcceptCriterion getDeleteLayoutAcceptCriteria() {
|
||||
return managementViewAcceptCriteria;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* processDroppedComponent(com .vaadin.event.dd.DragAndDropEvent)
|
||||
*/
|
||||
@Override
|
||||
protected void processDroppedComponent(final DragAndDropEvent event) {
|
||||
final Component source = event.getTransferable().getSourceComponent();
|
||||
@@ -275,61 +226,26 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* getNoActionsButtonLabel()
|
||||
*/
|
||||
@Override
|
||||
protected String getNoActionsButtonLabel() {
|
||||
return i18n.get("button.no.actions");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* getActionsButtonLabel()
|
||||
*/
|
||||
@Override
|
||||
protected String getActionsButtonLabel() {
|
||||
return i18n.get("button.actions");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* reloadActionCount()
|
||||
*/
|
||||
@Override
|
||||
protected void restoreActionCount() {
|
||||
updateActionCount();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* getUnsavedActionsWindowCaption ()
|
||||
*/
|
||||
@Override
|
||||
protected String getUnsavedActionsWindowCaption() {
|
||||
return i18n.get("caption.save.window");
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* unsavedActionsWindowClosed()
|
||||
*/
|
||||
@Override
|
||||
protected void unsavedActionsWindowClosed() {
|
||||
final String message = manangementConfirmationWindowLayout.getConsolidatedMessage();
|
||||
@@ -338,26 +254,12 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* getUnsavedActionsWindowContent ()
|
||||
*/
|
||||
@Override
|
||||
protected Component getUnsavedActionsWindowContent() {
|
||||
manangementConfirmationWindowLayout.init();
|
||||
return manangementConfirmationWindowLayout;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* hasUnsavedActions()
|
||||
*/
|
||||
@Override
|
||||
protected boolean hasUnsavedActions() {
|
||||
if (!managementUIState.getDeletedDistributionList().isEmpty()
|
||||
@@ -368,25 +270,11 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* hasCountMessage()
|
||||
*/
|
||||
@Override
|
||||
protected boolean hasCountMessage() {
|
||||
return permChecker.hasTargetReadPermission();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* getCountMessageLabel()
|
||||
*/
|
||||
@Override
|
||||
protected Label getCountMessageLabel() {
|
||||
return countMessageLabel;
|
||||
@@ -413,19 +301,9 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Prepare deleted distribution set .
|
||||
*
|
||||
* @param sourceTable
|
||||
* {@link DistributionTable}
|
||||
* @param transferable
|
||||
* {@link TableTransferable}
|
||||
*
|
||||
*/
|
||||
private void addInDeleteDistributionList(final Table sourceTable, final TableTransferable transferable) {
|
||||
final Set<DistributionSetIdName> distSelected = HawkbitCommonUtil.getSelectedDSDetails(sourceTable);
|
||||
final Set<DistributionSetIdName> distributionIdNameSet = new HashSet<DistributionSetIdName>();
|
||||
final Set<DistributionSetIdName> distributionIdNameSet = new HashSet<>();
|
||||
|
||||
if (!distSelected.contains(transferable.getData(SPUIDefinitions.ITEMID))) {
|
||||
distributionIdNameSet.add((DistributionSetIdName) transferable.getData(SPUIDefinitions.ITEMID));
|
||||
@@ -477,15 +355,6 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare deleted target list.
|
||||
*
|
||||
* @param sourceTable
|
||||
* {@link TargetTable}
|
||||
* @param transferable
|
||||
* {@link TableTransferable}
|
||||
*
|
||||
*/
|
||||
private void addInDeleteTargetList(final Table sourceTable, final TableTransferable transferable) {
|
||||
final Set<TargetIdName> targetSelected = HawkbitCommonUtil.getSelectedTargetDetails(sourceTable);
|
||||
|
||||
@@ -521,9 +390,6 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the software module delete count.
|
||||
*/
|
||||
private void updateActionCount() {
|
||||
final int count = managementUIState.getDeletedTargetList().size()
|
||||
+ managementUIState.getDeletedDistributionList().size() + managementUIState.getAssignedList().size();
|
||||
@@ -546,34 +412,16 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* hasBulkUploadPermission()
|
||||
*/
|
||||
@Override
|
||||
protected boolean hasBulkUploadPermission() {
|
||||
return permChecker.hasCreateTargetPermission();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* showBulkUploadWindow()
|
||||
*/
|
||||
@Override
|
||||
protected void showBulkUploadWindow() {
|
||||
eventBus.publish(this, BulkUploadPopupEvent.MAXIMIMIZED);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout#
|
||||
* restoreBulkUploadStatusCount()
|
||||
*/
|
||||
@Override
|
||||
protected void restoreBulkUploadStatusCount() {
|
||||
final Long failedCount = managementUIState.getTargetTableFilters().getBulkUpload().getFailedUploadCount();
|
||||
|
||||
@@ -33,9 +33,9 @@ public class DistributionTableFilters implements Serializable {
|
||||
|
||||
private String pinnedTargetId;
|
||||
|
||||
private final List<String> distSetTags = new ArrayList<String>();
|
||||
private final List<String> distSetTags = new ArrayList<>();
|
||||
|
||||
private List<String> clickedDistSetTags = new ArrayList<String>();
|
||||
private List<String> clickedDistSetTags = new ArrayList<>();
|
||||
|
||||
private Boolean noTagSelected = Boolean.FALSE;
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ public class TargetFilterParameters implements Serializable {
|
||||
|
||||
private String searchText;
|
||||
|
||||
private final List<TargetUpdateStatus> status = new ArrayList<TargetUpdateStatus>();
|
||||
private final List<TargetUpdateStatus> status = new ArrayList<>();
|
||||
|
||||
private List<String> targetTags = new ArrayList<String>();
|
||||
private List<String> targetTags = new ArrayList<>();
|
||||
|
||||
private Long distributionSetId;
|
||||
|
||||
|
||||
@@ -22,9 +22,6 @@ import com.vaadin.spring.annotation.VaadinSessionScope;
|
||||
|
||||
/**
|
||||
* Target Table Filters.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@VaadinSessionScope
|
||||
@SpringComponent
|
||||
@@ -32,8 +29,8 @@ public class TargetTableFilters implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5251492630546463593L;
|
||||
|
||||
private final List<String> clickedTargetTags = new ArrayList<String>();
|
||||
private final List<TargetUpdateStatus> clickedStatusTargetTags = new ArrayList<TargetUpdateStatus>();
|
||||
private final List<String> clickedTargetTags = new ArrayList<>();
|
||||
private final List<TargetUpdateStatus> clickedStatusTargetTags = new ArrayList<>();
|
||||
private String searchText;
|
||||
private DistributionSetIdName distributionSet;
|
||||
private Long pinnedDistId;
|
||||
|
||||
@@ -39,10 +39,6 @@ import com.google.common.base.Strings;
|
||||
* Simple implementation of generics bean query which dynamically loads a batch
|
||||
* of beans.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
|
||||
private static final long serialVersionUID = -5645680058303167558L;
|
||||
@@ -105,7 +101,7 @@ public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
|
||||
@Override
|
||||
protected List<ProxyTarget> loadBeans(final int startIndex, final int count) {
|
||||
Slice<Target> targetBeans;
|
||||
final List<ProxyTarget> proxyTargetBeans = new ArrayList<ProxyTarget>();
|
||||
final List<ProxyTarget> proxyTargetBeans = new ArrayList<>();
|
||||
if (pinnedDistId != null) {
|
||||
targetBeans = getTargetManagement().findTargetsAllOrderByLinkedDistributionSet(
|
||||
new OffsetBasedPageRequest(startIndex, SPUIDefinitions.PAGE_SIZE, sort), pinnedDistId,
|
||||
|
||||
@@ -56,9 +56,6 @@ import com.vaadin.ui.themes.ValoTheme;
|
||||
|
||||
/**
|
||||
* Target table header layout.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@ViewScope
|
||||
@@ -95,6 +92,7 @@ public class TargetTableHeader extends AbstractTableHeader {
|
||||
/**
|
||||
* Initialization of Target Header Component.
|
||||
*/
|
||||
@Override
|
||||
@PostConstruct
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -258,7 +256,7 @@ public class TargetTableHeader extends AbstractTableHeader {
|
||||
|
||||
@Override
|
||||
protected void resetSearchText() {
|
||||
if(managementUIState.getTargetTableFilters().getSearchText().isPresent()){
|
||||
if (managementUIState.getTargetTableFilters().getSearchText().isPresent()) {
|
||||
managementUIState.getTargetTableFilters().setSearchText(null);
|
||||
eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_TEXT);
|
||||
}
|
||||
@@ -337,6 +335,11 @@ public class TargetTableHeader extends AbstractTableHeader {
|
||||
@Override
|
||||
protected DropHandler getDropFilterHandler() {
|
||||
return new DropHandler() {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public void drop(final DragAndDropEvent event) {
|
||||
filterByDroppedDist(event);
|
||||
@@ -395,10 +398,9 @@ public class TargetTableHeader extends AbstractTableHeader {
|
||||
}
|
||||
|
||||
private Set<DistributionSetIdName> getDropppedDistributionDetails(final TableTransferable transferable) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final Set<DistributionSetIdName> distSelected = HawkbitCommonUtil
|
||||
.getSelectedDSDetails(transferable.getSourceComponent());
|
||||
final Set<DistributionSetIdName> distributionIdSet = new HashSet<DistributionSetIdName>();
|
||||
final Set<DistributionSetIdName> distributionIdSet = new HashSet<>();
|
||||
if (!distSelected.contains(transferable.getData("itemId"))) {
|
||||
distributionIdSet.add((DistributionSetIdName) transferable.getData("itemId"));
|
||||
} else {
|
||||
@@ -443,12 +445,6 @@ public class TargetTableHeader extends AbstractTableHeader {
|
||||
eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_DISTRIBUTION);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
||||
* displayFilterDropedInfoOnLoad()
|
||||
*/
|
||||
@Override
|
||||
protected void displayFilterDropedInfoOnLoad() {
|
||||
if (managementUIState.getTargetTableFilters().getDistributionSet().isPresent()) {
|
||||
@@ -456,23 +452,11 @@ public class TargetTableHeader extends AbstractTableHeader {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
|
||||
* getFilterIconStyle()
|
||||
*/
|
||||
@Override
|
||||
protected String getFilterIconStyle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.hawkbit.ui.common.table.AbstractTableHeader#
|
||||
* isBulkUploadInProgress()
|
||||
*/
|
||||
@Override
|
||||
protected boolean isBulkUploadInProgress() {
|
||||
return managementUIState.getTargetTableFilters().getBulkUpload().getSucessfulUploadCount() != 0
|
||||
|
||||
@@ -75,7 +75,7 @@ public class TargetTagBeanQuery extends AbstractBeanQuery<ProxyTag> {
|
||||
@Override
|
||||
protected List<ProxyTag> loadBeans(final int startIndex, final int count) {
|
||||
Page<TargetTag> targetTagBeans;
|
||||
final List<ProxyTag> targetTagList = new ArrayList<ProxyTag>();
|
||||
final List<ProxyTag> targetTagList = new ArrayList<>();
|
||||
if (startIndex == 0 && firstPageTargetTag != null) {
|
||||
targetTagBeans = firstPageTargetTag;
|
||||
} else {
|
||||
|
||||
@@ -57,9 +57,6 @@ import com.vaadin.ui.UI;
|
||||
|
||||
/**
|
||||
* Target Tag filter buttons table.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@SpringComponent
|
||||
@ViewScope
|
||||
@@ -129,40 +126,18 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* getButtonsTableId()
|
||||
*/
|
||||
@Override
|
||||
protected String getButtonsTableId() {
|
||||
return SPUIComponetIdProvider.TARGET_TAG_TABLE_ID;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* createButtonsLazyQueryContainer ()
|
||||
*/
|
||||
@Override
|
||||
protected LazyQueryContainer createButtonsLazyQueryContainer() {
|
||||
final LazyQueryContainer tagContainer = HawkbitCommonUtil
|
||||
return HawkbitCommonUtil
|
||||
.createDSLazyQueryContainer(new BeanQueryFactory<TargetTagBeanQuery>(TargetTagBeanQuery.class));
|
||||
return tagContainer;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* isClickedByDefault(java.lang .Long)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isClickedByDefault(final Long buttonId) {
|
||||
final TargetTag newTagClickedObj = tagMgmtService.findTargetTagById(buttonId);
|
||||
@@ -175,26 +150,12 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
return managementUIState.getTargetTableFilters().isNoTagSelected();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* createButtonId(java.lang. String)
|
||||
*/
|
||||
@Override
|
||||
protected String createButtonId(final String name) {
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* getFilterButtonDropHandler()
|
||||
*/
|
||||
@Override
|
||||
protected DropHandler getFilterButtonDropHandler() {
|
||||
|
||||
@@ -267,21 +228,14 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process target Drop event.
|
||||
*
|
||||
* @param event
|
||||
* DragAndDropEvent
|
||||
*/
|
||||
private void processTargetDrop(final DragAndDropEvent event) {
|
||||
|
||||
final com.vaadin.event.dd.TargetDetails targetDetails = event.getTargetDetails();
|
||||
final TableTransferable transferable = (TableTransferable) event.getTransferable();
|
||||
final Table source = transferable.getSourceComponent();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
final Set<TargetIdName> targetSelected = HawkbitCommonUtil.getSelectedTargetDetails(source);
|
||||
final Set<String> targetList = new HashSet<String>();
|
||||
final Set<String> targetList = new HashSet<>();
|
||||
if (transferable.getData(ITEMID) != null) {
|
||||
if (!targetSelected.contains(transferable.getData(ITEMID))) {
|
||||
targetList.add(((TargetIdName) transferable.getData(ITEMID)).getControllerId());
|
||||
@@ -306,13 +260,6 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* validate the source tables.
|
||||
*
|
||||
* @param source
|
||||
* table
|
||||
* @return boolean
|
||||
*/
|
||||
private boolean validateIfSourceisTargetTable(final Table source) {
|
||||
if (!source.getId().equals(SPUIComponetIdProvider.TARGET_TABLE_ID)) {
|
||||
notification.displayValidationError(i18n.get(SPUILabelDefinitions.ACTION_NOT_ALLOWED));
|
||||
@@ -321,13 +268,6 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
|
||||
* getButttonWrapperId()
|
||||
*/
|
||||
@Override
|
||||
protected String getButttonWrapperIdPrefix() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user