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:
SirWayne
2016-02-24 18:24:53 +01:00
parent ca66932918
commit fcd6555e3e
45 changed files with 142 additions and 1048 deletions

View File

@@ -75,7 +75,7 @@ public class RedisConfiguration {
*/ */
@Bean @Bean
public RedisTemplate<String, Object> redisTemplate() { public RedisTemplate<String, Object> redisTemplate() {
final RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>(); final RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(jedisConnectionFactory()); redisTemplate.setConnectionFactory(jedisConnectionFactory());
redisTemplate.setKeySerializer(new JdkSerializationRedisSerializer()); redisTemplate.setKeySerializer(new JdkSerializationRedisSerializer());
redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer()); redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());

View File

@@ -95,7 +95,7 @@ public class EventDistributor {
* wants to subscribe * wants to subscribe
*/ */
public Collection<Topic> getTopics() { public Collection<Topic> getTopics() {
final List<Topic> topics = new ArrayList<Topic>(); final List<Topic> topics = new ArrayList<>();
topics.add(new PatternTopic(SUB_DISTRIBUTION_CHANNEL)); topics.add(new PatternTopic(SUB_DISTRIBUTION_CHANNEL));
return topics; return topics;
} }

View File

@@ -21,7 +21,7 @@ import java.util.List;
*/ */
public class ListReportSeries extends AbstractReportSeries { public class ListReportSeries extends AbstractReportSeries {
private final List<Number> data = new ArrayList<Number>(); private final List<Number> data = new ArrayList<>();
/** /**
* @param name * @param name

View File

@@ -330,7 +330,7 @@ public class DeploymentManagement {
// one we have been switched to canceling state because for targets // one we have been switched to canceling state because for targets
// which we have changed to // which we have changed to
// canceling we don't want to publish the new action update event. // canceling we don't want to publish the new action update event.
final Set<Long> targetIdsCancellList = new HashSet<Long>(); final Set<Long> targetIdsCancellList = new HashSet<>();
targetIds.forEach(ids -> targetIdsCancellList.addAll(overrideObsoleteUpdateActions(ids))); targetIds.forEach(ids -> targetIdsCancellList.addAll(overrideObsoleteUpdateActions(ids)));
// cancel all scheduled actions which are in-active, these actions were // cancel all scheduled actions which are in-active, these actions were
@@ -435,7 +435,7 @@ public class DeploymentManagement {
*/ */
private Set<Long> overrideObsoleteUpdateActions(final List<Long> targetsIds) { private Set<Long> overrideObsoleteUpdateActions(final List<Long> targetsIds) {
final Set<Long> cancelledTargetIds = new HashSet<Long>(); final Set<Long> cancelledTargetIds = new HashSet<>();
// Figure out if there are potential target/action combinations that // Figure out if there are potential target/action combinations that
// need to be considered // need to be considered
@@ -779,8 +779,7 @@ public class DeploymentManagement {
multiselect.where(cb.equal(actionRoot.get(Action_.target), target)); multiselect.where(cb.equal(actionRoot.get(Action_.target), target));
multiselect.orderBy(cb.desc(actionRoot.get(Action_.id))); multiselect.orderBy(cb.desc(actionRoot.get(Action_.id)));
multiselect.groupBy(actionRoot.get(Action_.id)); multiselect.groupBy(actionRoot.get(Action_.id));
final List<ActionWithStatusCount> resultList = entityManager.createQuery(multiselect).getResultList(); return entityManager.createQuery(multiselect).getResultList();
return resultList;
} }
/** /**

View File

@@ -57,7 +57,7 @@ public class NoCountPagingRepository {
*/ */
public <T, I extends Serializable> Slice<T> findAll(final Specification<T> spec, final Pageable pageable, public <T, I extends Serializable> Slice<T> findAll(final Specification<T> spec, final Pageable pageable,
final Class<T> domainClass) { final Class<T> domainClass) {
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<T, I>(domainClass, em); final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<>(domainClass, em);
return noCountDao.findAll(spec, pageable); return noCountDao.findAll(spec, pageable);
} }
@@ -76,7 +76,7 @@ public class NoCountPagingRepository {
* org.springframework.data.domain.Pageable) * org.springframework.data.domain.Pageable)
*/ */
public <T, I extends Serializable> Slice<T> findAll(final Pageable pageable, final Class<T> domainClass) { public <T, I extends Serializable> Slice<T> findAll(final Pageable pageable, final Class<T> domainClass) {
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<T, I>(domainClass, em); final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<>(domainClass, em);
return noCountDao.findAll(pageable); return noCountDao.findAll(pageable);
} }
@@ -120,7 +120,7 @@ public class NoCountPagingRepository {
final List<T> content = query.getResultList(); final List<T> content = query.getResultList();
return new PageImpl<T>(content, pageable, content.size()); return new PageImpl<>(content, pageable, content.size());
} }
} }
} }

View File

@@ -160,7 +160,7 @@ public class TagManagement {
public void deleteTargetTag(@NotEmpty final String targetTagName) { public void deleteTargetTag(@NotEmpty final String targetTagName) {
final TargetTag tag = targetTagRepository.findByNameEquals(targetTagName); final TargetTag tag = targetTagRepository.findByNameEquals(targetTagName);
final List<Target> changed = new LinkedList<Target>(); final List<Target> changed = new LinkedList<>();
for (final Target target : targetRepository.findByTag(tag)) { for (final Target target : targetRepository.findByTag(tag)) {
target.getTags().remove(tag); target.getTags().remove(tag);
changed.add(target); changed.add(target);
@@ -311,7 +311,7 @@ public class TagManagement {
public void deleteDistributionSetTag(@NotEmpty final String tagName) { public void deleteDistributionSetTag(@NotEmpty final String tagName) {
final DistributionSetTag tag = distributionSetTagRepository.findByNameEquals(tagName); final DistributionSetTag tag = distributionSetTagRepository.findByNameEquals(tagName);
final List<DistributionSet> changed = new LinkedList<DistributionSet>(); final List<DistributionSet> changed = new LinkedList<>();
for (final DistributionSet set : distributionSetRepository.findByTag(tag)) { for (final DistributionSet set : distributionSetRepository.findByTag(tag)) {
set.getTags().remove(tag); set.getTags().remove(tag);
changed.add(set); changed.add(set);

View File

@@ -63,7 +63,7 @@ public class ActionStatus extends BaseEntity {
@CollectionTable(name = "sp_action_status_messages", joinColumns = @JoinColumn(name = "action_status_id", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_stat_msg_act_stat") ) , indexes = { @CollectionTable(name = "sp_action_status_messages", joinColumns = @JoinColumn(name = "action_status_id", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_stat_msg_act_stat") ) , indexes = {
@Index(name = "sp_idx_action_status_msgs_01", columnList = "action_status_id") }) @Index(name = "sp_idx_action_status_msgs_01", columnList = "action_status_id") })
@Column(name = "detail_message", length = 512) @Column(name = "detail_message", length = 512)
private final List<String> messages = new ArrayList<String>(); private final List<String> messages = new ArrayList<>();
/** /**
* Creates a new {@link ActionStatus} object. * Creates a new {@link ActionStatus} object.

View File

@@ -87,7 +87,7 @@ public class Target extends NamedEntity implements Persistable<Long> {
@JoinTable(name = "sp_target_target_tag", joinColumns = { @JoinTable(name = "sp_target_target_tag", joinColumns = {
@JoinColumn(name = "target", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_target") ) }, inverseJoinColumns = { @JoinColumn(name = "target", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_target") ) }, inverseJoinColumns = {
@JoinColumn(name = "tag", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_tag") ) }) @JoinColumn(name = "tag", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_tag") ) })
private Set<TargetTag> tags = new HashSet<TargetTag>(); private Set<TargetTag> tags = new HashSet<>();
@CascadeOnDelete @CascadeOnDelete
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true, cascade = { CascadeType.REMOVE }) @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true, cascade = { CascadeType.REMOVE })

View File

@@ -88,7 +88,7 @@ final class DistributionSetTypeMapper {
} }
static List<DistributionSetTypeRest> toListResponse(final List<DistributionSetType> types) { static List<DistributionSetTypeRest> toListResponse(final List<DistributionSetType> types) {
final List<DistributionSetTypeRest> response = new ArrayList<DistributionSetTypeRest>(); final List<DistributionSetTypeRest> response = new ArrayList<>();
for (final DistributionSetType dsType : types) { for (final DistributionSetType dsType : types) {
response.add(toResponse(dsType)); response.add(toResponse(dsType));
} }

View File

@@ -59,7 +59,7 @@ final class SoftwareModuleTypeMapper {
} }
static List<SoftwareModuleTypeRest> toListResponse(final Collection<SoftwareModuleType> types) { static List<SoftwareModuleTypeRest> toListResponse(final Collection<SoftwareModuleType> types) {
final List<SoftwareModuleTypeRest> response = new ArrayList<SoftwareModuleTypeRest>(); final List<SoftwareModuleTypeRest> response = new ArrayList<>();
for (final SoftwareModuleType softwareModule : types) { for (final SoftwareModuleType softwareModule : types) {
response.add(toResponse(softwareModule)); response.add(toResponse(softwareModule));
} }

View File

@@ -208,14 +208,13 @@ public class ArtifactDetailsLayout extends VerticalLayout {
} }
private Container createArtifactLazyQueryContainer() { private Container createArtifactLazyQueryContainer() {
final Map<String, Object> queryConfiguration = new HashMap<String, Object>(); final Map<String, Object> queryConfiguration = new HashMap<>();
return getArtifactLazyQueryContainer(queryConfiguration); return getArtifactLazyQueryContainer(queryConfiguration);
} }
private LazyQueryContainer getArtifactLazyQueryContainer(final Map<String, Object> queryConfig) { private LazyQueryContainer getArtifactLazyQueryContainer(final Map<String, Object> queryConfig) {
final BeanQueryFactory<ArtifactBeanQuery> artifactQF = new BeanQueryFactory<ArtifactBeanQuery>( final BeanQueryFactory<ArtifactBeanQuery> artifactQF = new BeanQueryFactory<>(ArtifactBeanQuery.class);
ArtifactBeanQuery.class);
artifactQF.setQueryConfiguration(queryConfig); artifactQF.setQueryConfiguration(queryConfig);
final LazyQueryContainer artifactCont = new LazyQueryContainer(new LazyQueryDefinition(true, 10, "id"), final LazyQueryContainer artifactCont = new LazyQueryContainer(new LazyQueryDefinition(true, 10, "id"),
artifactQF); artifactQF);
@@ -431,7 +430,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
titleOfArtifactDetails.setContentMode(ContentMode.HTML); titleOfArtifactDetails.setContentMode(ContentMode.HTML);
} }
} }
final Map<String, Object> queryConfiguration = new HashMap<String, Object>(); final Map<String, Object> queryConfiguration = new HashMap<>();
if (baseSwModuleId != null) { if (baseSwModuleId != null) {
queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId); queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId);
} }

View File

@@ -47,12 +47,6 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
@Autowired @Autowired
private transient EventBus.SessionEventBus eventBus; private transient EventBus.SessionEventBus eventBus;
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.AbstractAcceptCriteria#analyseDragComponent
* (com.vaadin.event .dd.DragAndDropEvent, com.vaadin.ui.Component)
*/
@Override @Override
protected void analyseDragComponent(final Component compsource) { protected void analyseDragComponent(final Component compsource) {
final String sourceID = getComponentId(compsource); final String sourceID = getComponentId(compsource);
@@ -60,24 +54,11 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
eventBus.publish(this, event); eventBus.publish(this, event);
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#hideDropHints
* ()
*/
@Override @Override
protected void hideDropHints() { protected void hideDropHints() {
eventBus.publish(this, DragEvent.HIDE_DROP_HINT); eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#invalidDrop()
*/
@Override @Override
protected void invalidDrop() { protected void invalidDrop() {
uiNotification.displayValidationError(SPUILabelDefinitions.ACTION_NOT_ALLOWED); uiNotification.displayValidationError(SPUILabelDefinitions.ACTION_NOT_ALLOWED);
@@ -92,41 +73,23 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
return id; return id;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
* getDropHintConfigurations()
*/
@Override @Override
protected Map<String, Object> getDropHintConfigurations() { protected Map<String, Object> getDropHintConfigurations() {
return DROP_HINTS_CONFIGS; return DROP_HINTS_CONFIGS;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
* publishDragStartEvent(java.lang.Object)
*/
@Override @Override
protected void publishDragStartEvent(final Object event) { protected void publishDragStartEvent(final Object event) {
eventBus.publish(this, event); eventBus.publish(this, event);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
* getDropConfigurations()
*/
@Override @Override
protected Map<String, List<String>> getDropConfigurations() { protected Map<String, List<String>> getDropConfigurations() {
return DROP_CONFIGS; return DROP_CONFIGS;
} }
private static Map<String, List<String>> createDropConfigurations() { 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 // Delete drop area droppable components
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID, Arrays.asList( config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID, Arrays.asList(
SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX)); 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() { 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_TYPE_BUTTON_PREFIX, UploadArtifactUIEvent.SOFTWARE_TYPE_DRAG_START);
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, UploadArtifactUIEvent.SOFTWARE_DRAG_START); config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, UploadArtifactUIEvent.SOFTWARE_DRAG_START);
return config; return config;

View File

@@ -32,10 +32,6 @@ import com.google.common.base.Strings;
* Simple implementation of generics bean query which dynamically loads a batch * Simple implementation of generics bean query which dynamically loads a batch
* of beans. * of beans.
* *
*
*
*
*
*/ */
public class BaseSwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSoftwareModuleItem> { public class BaseSwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSoftwareModuleItem> {
private static final long serialVersionUID = 4362142538539335466L; private static final long serialVersionUID = 4362142538539335466L;
@@ -76,7 +72,7 @@ public class BaseSwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSoftwareMo
@Override @Override
protected List<ProxyBaseSoftwareModuleItem> loadBeans(final int startIndex, final int count) { protected List<ProxyBaseSoftwareModuleItem> loadBeans(final int startIndex, final int count) {
final Slice<SoftwareModule> swModuleBeans; final Slice<SoftwareModule> swModuleBeans;
final List<ProxyBaseSoftwareModuleItem> proxyBeans = new ArrayList<ProxyBaseSoftwareModuleItem>(); final List<ProxyBaseSoftwareModuleItem> proxyBeans = new ArrayList<>();
if (type == null && Strings.isNullOrEmpty(searchText)) { if (type == null && Strings.isNullOrEmpty(searchText)) {
swModuleBeans = getSoftwareManagementService() swModuleBeans = getSoftwareManagementService()

View File

@@ -55,8 +55,6 @@ import com.vaadin.ui.UI;
/** /**
* Header of Software module table. * Header of Software module table.
* *
*
*
*/ */
@SpringComponent @SpringComponent
@ViewScope @ViewScope
@@ -78,11 +76,11 @@ public class SoftwareModuleTable extends AbstractTable {
@Autowired @Autowired
private UploadViewAcceptCriteria uploadViewAcceptCriteria; private UploadViewAcceptCriteria uploadViewAcceptCriteria;
/** /**
* Initialize the filter layout. * Initialize the filter layout.
*/ */
@Override
@PostConstruct @PostConstruct
protected void init() { protected void init() {
super.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 @Override
protected String getTableId() { protected String getTableId() {
return SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE; return SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.table.SPTable#createContainer()
*/
@Override @Override
protected Container createContainer() { protected Container createContainer() {
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters(); final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<BaseSwModuleBeanQuery>( final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<>(BaseSwModuleBeanQuery.class);
BaseSwModuleBeanQuery.class);
swQF.setQueryConfiguration(queryConfiguration); swQF.setQueryConfiguration(queryConfiguration);
final LazyQueryContainer container = new LazyQueryContainer( return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
return container;
} }
private Map<String, Object> prepareQueryConfigFilters() { private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>(); final Map<String, Object> queryConfig = new HashMap<>();
artifactUploadState.getSoftwareModuleFilters().getSearchText() artifactUploadState.getSoftwareModuleFilters().getSearchText()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value)); .ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
@@ -149,8 +134,6 @@ public class SoftwareModuleTable extends AbstractTable {
return queryConfig; return queryConfig;
} }
@Override @Override
protected void addContainerProperties(final Container container) { protected void addContainerProperties(final Container container) {
@@ -274,16 +257,9 @@ public class SoftwareModuleTable extends AbstractTable {
select(swModule.getId()); select(swModule.getId());
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.table.SPTable#getTableVisibleColumns
* ()
*/
@Override @Override
protected List<TableColumn> getTableVisibleColumns() { protected List<TableColumn> getTableVisibleColumns() {
final List<TableColumn> columnList = new ArrayList<TableColumn>(); final List<TableColumn> columnList = new ArrayList<>();
if (isMaximized()) { if (isMaximized()) {
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F)); 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)); columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.1F));

View File

@@ -193,7 +193,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
getPreviewButtonColor(DEFAULT_COLOR); getPreviewButtonColor(DEFAULT_COLOR);
tagColorPreviewBtn.setStyleName(TAG_DYNAMIC_STYLE); tagColorPreviewBtn.setStyleName(TAG_DYNAMIC_STYLE);
selectors = new HashSet<ColorSelector>(); selectors = new HashSet<>();
selectedColor = new Color(44, 151, 32); selectedColor = new Color(44, 151, 32);
selPreview = new SpColorPickerPreview(selectedColor); selPreview = new SpColorPickerPreview(selectedColor);
@@ -741,38 +741,17 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
return null; return null;
} }
/*
* (non-Javadoc)
*
* @see com.vaadin.ui.components.colorpicker.HasColorChangeListener#
* addColorChangeListener(com.vaadin
* .ui.components.colorpicker.ColorChangeListener)
*/
@Override @Override
public void addColorChangeListener(final ColorChangeListener listener) { public void addColorChangeListener(final ColorChangeListener listener) {
LOG.debug("inside addColorChangeListener"); LOG.debug("inside addColorChangeListener");
} }
/*
* (non-Javadoc)
*
* @see com.vaadin.ui.components.colorpicker.HasColorChangeListener#
* removeColorChangeListener(com.
* vaadin.ui.components.colorpicker.ColorChangeListener)
*/
@Override @Override
public void removeColorChangeListener(final ColorChangeListener listener) { public void removeColorChangeListener(final ColorChangeListener listener) {
LOG.debug("inside removeColorChangeListener"); LOG.debug("inside removeColorChangeListener");
} }
/*
* (non-Javadoc)
*
* @see
* com.vaadin.ui.components.colorpicker.ColorSelector#setColor(com.vaadin.
* shared.ui.colorpicker .Color)
*/
@Override @Override
public void setColor(final Color color) { public void setColor(final Color color) {
if (color == null) { 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 @Override
public Color getColor() { public Color getColor() {
return null; return null;
} }
/*
* (non-Javadoc)
*
* @see
* com.vaadin.ui.components.colorpicker.ColorChangeListener#colorChanged(com
* .vaadin.ui.components .colorpicker.ColorChangeEvent)
*/
@Override @Override
public void colorChanged(final ColorChangeEvent event) { public void colorChanged(final ColorChangeEvent event) {
setColor(event.getColor()); setColor(event.getColor());

View File

@@ -56,11 +56,7 @@ import com.vaadin.ui.themes.ValoTheme;
/** /**
* Artifact upload confirmation popup. * Artifact upload confirmation popup.
* *
*
*
*
*
*/ */
public class UploadConfirmationwindow implements Button.ClickListener { public class UploadConfirmationwindow implements Button.ClickListener {
@@ -106,7 +102,7 @@ public class UploadConfirmationwindow implements Button.ClickListener {
private IndexedContainer tabelContainer; private IndexedContainer tabelContainer;
private final List<UploadStatus> uploadResultList = new ArrayList<UploadStatus>(); private final List<UploadStatus> uploadResultList = new ArrayList<>();
private VerticalLayout uploadArtifactDetails; private VerticalLayout uploadArtifactDetails;

View File

@@ -69,8 +69,6 @@ import com.vaadin.ui.VerticalLayout;
/** /**
* Upload files layout. * Upload files layout.
*
*
*/ */
@ViewScope @ViewScope
@SpringComponent @SpringComponent
@@ -102,7 +100,7 @@ public class UploadLayout extends VerticalLayout {
private final AtomicInteger numberOfFilesActuallyUpload = new AtomicInteger(); private final AtomicInteger numberOfFilesActuallyUpload = new AtomicInteger();
private final List<String> duplicateFileNamesList = new ArrayList<String>(); private final List<String> duplicateFileNamesList = new ArrayList<>();
private Button processBtn; private Button processBtn;

View File

@@ -44,7 +44,7 @@ public class UploadResultWindow implements Button.ClickListener {
private static final long serialVersionUID = 5205927189362269027L; private static final long serialVersionUID = 5205927189362269027L;
private List<UploadStatus> uploadResultList = new ArrayList<UploadStatus>(); private List<UploadStatus> uploadResultList = new ArrayList<>();
private Button closeBtn; private Button closeBtn;

View File

@@ -83,7 +83,7 @@ public class DistributionSetTypeBeanQuery extends AbstractBeanQuery<Distribution
@Override @Override
protected List<DistributionSetType> loadBeans(final int startIndex, final int count) { protected List<DistributionSetType> loadBeans(final int startIndex, final int count) {
Page<DistributionSetType> typeBeans; Page<DistributionSetType> typeBeans;
final List<DistributionSetType> distSetTypeList = new ArrayList<DistributionSetType>(); final List<DistributionSetType> distSetTypeList = new ArrayList<>();
if (startIndex == 0 && firstPageDistSetType != null) { if (startIndex == 0 && firstPageDistSetType != null) {
typeBeans = firstPageDistSetType; typeBeans = firstPageDistSetType;
} else { } else {

View File

@@ -45,8 +45,6 @@ import com.vaadin.ui.UI;
/** /**
* Implementation of target/ds tag token layout. * Implementation of target/ds tag token layout.
*
*
* *
*/ */
@SpringComponent @SpringComponent
@@ -80,6 +78,7 @@ public class DistributionTagToken extends AbstractTagToken {
// To Be Done : have to set this value based on view??? // To Be Done : have to set this value based on view???
private static final Boolean NOTAGS_SELECTED = Boolean.FALSE; private static final Boolean NOTAGS_SELECTED = Boolean.FALSE;
@Override
@PostConstruct @PostConstruct
protected void init() { protected void init() {
super.init(); super.init();
@@ -129,7 +128,7 @@ public class DistributionTagToken extends AbstractTagToken {
} }
private DistributionSetTagAssigmentResult toggleAssignment(final String tagNameSelected) { private DistributionSetTagAssigmentResult toggleAssignment(final String tagNameSelected) {
final Set<Long> distributionList = new HashSet<Long>(); final Set<Long> distributionList = new HashSet<>();
distributionList.add(selectedDS.getId()); distributionList.add(selectedDS.getId());
final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment(distributionList, final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment(distributionList,
tagNameSelected); tagNameSelected);
@@ -137,12 +136,6 @@ public class DistributionTagToken extends AbstractTagToken {
return result; return result;
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.tagDetails.AbstractTagToken#unassignTag(
* java.lang.String)
*/
@Override @Override
protected void unassignTag(final String tagName) { protected void unassignTag(final String tagName) {
final DistributionSetTagAssigmentResult result = toggleAssignment(tagName); final DistributionSetTagAssigmentResult result = toggleAssignment(tagName);
@@ -160,26 +153,14 @@ public class DistributionTagToken extends AbstractTagToken {
/* To Be Done : this implementation will vary in views */ /* To Be Done : this implementation will vary in views */
private List<String> getClickedTagList() { private List<String> getClickedTagList() {
return new ArrayList<String>(); return new ArrayList<>();
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.tagDetails.AbstractTagToken#
* hasUpdatePermission()
*/
@Override @Override
protected Boolean isToggleTagAssignmentAllowed() { protected Boolean isToggleTagAssignmentAllowed() {
return spChecker.hasUpdateDistributionPermission(); return spChecker.hasUpdateDistributionPermission();
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.tagDetails.AbstractTagToken#
* displayAlreadyAssignedTags()
*/
@Override @Override
public void displayAlreadyAssignedTags() { public void displayAlreadyAssignedTags() {
removePreviouslyAddedTokens(); removePreviouslyAddedTokens();
@@ -190,12 +171,6 @@ public class DistributionTagToken extends AbstractTagToken {
} }
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.tagDetails.AbstractTagToken#
* populateContainer()
*/
@Override @Override
protected void populateContainer() { protected void populateContainer() {
container.removeAllItems(); container.removeAllItems();

View File

@@ -79,8 +79,6 @@ import com.vaadin.ui.themes.ValoTheme;
/** /**
* Window for create update Distribution Set Type. * Window for create update Distribution Set Type.
*
*
*/ */
@SpringComponent @SpringComponent
@ViewScope @ViewScope
@@ -221,7 +219,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
getPreviewButtonColor(DEFAULT_COLOR); getPreviewButtonColor(DEFAULT_COLOR);
selectors = new HashSet<ColorSelector>(); selectors = new HashSet<>();
selectedColor = new Color(44, 151, 32); selectedColor = new Color(44, 151, 32);
selPreview = new SpColorPickerPreview(selectedColor); selPreview = new SpColorPickerPreview(selectedColor);
@@ -457,6 +455,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
sourceTable.setItemDescriptionGenerator(new ItemDescriptionGenerator() { sourceTable.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Override
public String generateDescription(final Component source, final Object itemId, final Object propertyId) { public String generateDescription(final Component source, final Object itemId, final Object propertyId) {
final Item item = sourceTable.getItem(itemId); final Item item = sourceTable.getItem(itemId);
final String description = (String) item.getItemProperty(DIST_TYPE_DESCRIPTION).getValue(); 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); DistributionSetType newDistType = new DistributionSetType(typeKeyValue, typeNameValue, typeDescValue);
for (final Long id : itemIds) { for (final Long id : itemIds) {
final Item item = selectedTable.getItem(id); 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 CheckBox mandatoryCheckBox = (CheckBox) item.getItemProperty(DIST_TYPE_MANDATORY).getValue();
final Boolean isMandatory = mandatoryCheckBox.getValue(); final Boolean isMandatory = mandatoryCheckBox.getValue();
final SoftwareModuleType swModuleType = softwareManagement.findSoftwareModuleTypeByName(dist_type_name); final SoftwareModuleType swModuleType = softwareManagement.findSoftwareModuleTypeByName(distTypeName);
if (isMandatory) { if (isMandatory) {
newDistType.addMandatoryModuleType(swModuleType); newDistType.addMandatoryModuleType(swModuleType);
@@ -1032,7 +1031,6 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
* as the selected tag from combo * as the selected tag from combo
*/ */
private void setTypeTagCombo(final String distSetTypeSelected) { private void setTypeTagCombo(final String distSetTypeSelected) {
boolean mandatory = false;
typeName.setValue(distSetTypeSelected); typeName.setValue(distSetTypeSelected);
getSourceTableData(); getSourceTableData();
selectedTable.getContainerDataSource().removeAllItems(); selectedTable.getContainerDataSource().removeAllItems();
@@ -1053,13 +1051,11 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
saveDistSetType.setEnabled(false); saveDistSetType.setEnabled(false);
} }
for (final SoftwareModuleType swModuleType : selectedTypeTag.getOptionalModuleTypes()) { for (final SoftwareModuleType swModuleType : selectedTypeTag.getOptionalModuleTypes()) {
mandatory = false; addTargetTableforUpdate(swModuleType, false);
addTargetTableforUpdate(swModuleType, mandatory);
} }
for (final SoftwareModuleType swModuleType : selectedTypeTag.getMandatoryModuleTypes()) { for (final SoftwareModuleType swModuleType : selectedTypeTag.getMandatoryModuleTypes()) {
mandatory = true; addTargetTableforUpdate(swModuleType, true);
addTargetTableforUpdate(swModuleType, mandatory);
} }
if (null == selectedTypeTag.getColour()) { if (null == selectedTypeTag.getColour()) {

View File

@@ -74,8 +74,6 @@ import com.vaadin.ui.UI;
/** /**
* Distribution set table. * Distribution set table.
* *
*
*
*/ */
@SpringComponent @SpringComponent
@ViewScope @ViewScope
@@ -114,7 +112,7 @@ public class DistributionSetTable extends AbstractTable {
@Autowired @Autowired
private transient TargetManagement targetManagement; private transient TargetManagement targetManagement;
/** /**
* Initialize the component. * 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 @Override
protected String getTableId() { protected String getTableId() {
return SPUIComponetIdProvider.DIST_TABLE_ID; return SPUIComponetIdProvider.DIST_TABLE_ID;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.table.AbstractTable#createContainer(
* )
*/
@Override @Override
protected Container createContainer() { protected Container createContainer() {
@@ -165,9 +150,9 @@ public class DistributionSetTable extends AbstractTable {
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME), new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME),
distributionQF); distributionQF);
} }
private Map<String, Object> prepareQueryConfigFilters() { private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>(); final Map<String, Object> queryConfig = new HashMap<>();
manageDistUIState.getManageDistFilters().getSearchText() manageDistUIState.getManageDistFilters().getSearchText()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value)); .ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
@@ -178,14 +163,7 @@ public class DistributionSetTable extends AbstractTable {
return queryConfig; return queryConfig;
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.AbstractTable#addContainerProperties
* (com.vaadin.data.Container )
*/
@Override @Override
protected void addContainerProperties(final Container container) { protected void addContainerProperties(final Container container) {
HawkbitCommonUtil.getDsTableColumnProperties(container); HawkbitCommonUtil.getDsTableColumnProperties(container);
@@ -193,12 +171,6 @@ public class DistributionSetTable extends AbstractTable {
Boolean.class, null, false, true); Boolean.class, null, false, true);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTable#
* addCustomGeneratedColumns ()
*/
@Override @Override
protected void addCustomGeneratedColumns() { 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 @Override
protected boolean isFirstRowSelectedOnLoad() { protected boolean isFirstRowSelectedOnLoad() {
return !manageDistUIState.getSelectedDistributions().isPresent() return !manageDistUIState.getSelectedDistributions().isPresent()
|| manageDistUIState.getSelectedDistributions().get().isEmpty(); || manageDistUIState.getSelectedDistributions().get().isEmpty();
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.AbstractTable#getItemIdToSelect()
*/
@Override @Override
protected Object getItemIdToSelect() { protected Object getItemIdToSelect() {
if (manageDistUIState.getSelectedDistributions().isPresent()) { if (manageDistUIState.getSelectedDistributions().isPresent()) {
@@ -231,12 +192,6 @@ public class DistributionSetTable extends AbstractTable {
return null; return null;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.table.AbstractTable#onValueChange()
*/
@Override @Override
protected void onValueChange() { protected void onValueChange() {
eventBus.publish(this, DragEvent.HIDE_DROP_HINT); 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 @Override
protected boolean isMaximized() { protected boolean isMaximized() {
return manageDistUIState.isDsTableMaximized(); return manageDistUIState.isDsTableMaximized();
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.AbstractTable#getTableVisibleColumns
* ()
*/
@Override @Override
protected List<TableColumn> getTableVisibleColumns() { protected List<TableColumn> getTableVisibleColumns() {
return HawkbitCommonUtil.getTableVisibleColumns(isMaximized(), false, i18n); return HawkbitCommonUtil.getTableVisibleColumns(isMaximized(), false, i18n);
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.AbstractTable#getTableDropHandler()
*/
@Override @Override
protected DropHandler getTableDropHandler() { protected DropHandler getTableDropHandler() {
return new DropHandler() { return new DropHandler() {

View File

@@ -37,8 +37,6 @@ import com.google.common.base.Strings;
/** /**
* Manage Distributions table bean query. * Manage Distributions table bean query.
* *
*
*
*/ */
public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> { 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 @Override
protected ProxyDistribution constructBean() { protected ProxyDistribution constructBean() {
return new ProxyDistribution(); return new ProxyDistribution();
} }
/*
* (non-Javadoc)
*
* @see
* org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery#loadBeans(int,
* int)
*/
@Override @Override
protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) { protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) {
Page<DistributionSet> distBeans; Page<DistributionSet> distBeans;
final List<ProxyDistribution> proxyDistributions = new ArrayList<ProxyDistribution>(); final List<ProxyDistribution> proxyDistributions = new ArrayList<>();
if (startIndex == 0 && firstPageDistributionSets != null) { if (startIndex == 0 && firstPageDistributionSets != null) {
distBeans = firstPageDistributionSets; distBeans = firstPageDistributionSets;
} else if (Strings.isNullOrEmpty(searchText)) { } else if (Strings.isNullOrEmpty(searchText)) {
@@ -136,24 +121,12 @@ public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
return proxyDistributions; return proxyDistributions;
} }
/*
* (non-Javadoc)
*
* @see
* org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery#saveBeans(java.
* util.List, java.util.List, java.util.List)
*/
@Override @Override
protected void saveBeans(final List<ProxyDistribution> arg0, final List<ProxyDistribution> arg1, protected void saveBeans(final List<ProxyDistribution> arg0, final List<ProxyDistribution> arg1,
final List<ProxyDistribution> arg2) { final List<ProxyDistribution> arg2) {
// Add,Delete and Update are performed through repository methods // Add,Delete and Update are performed through repository methods
} }
/*
* (non-Javadoc)
*
* @see org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery#size()
*/
@Override @Override
public int size() { public int size() {
if (Strings.isNullOrEmpty(searchText) && null == distributionSetType) { if (Strings.isNullOrEmpty(searchText) && null == distributionSetType) {

View File

@@ -28,8 +28,6 @@ import com.vaadin.ui.Component;
/** /**
* Distributions View for Accept criteria. * Distributions View for Accept criteria.
* *
*
*
*/ */
@SpringComponent @SpringComponent
@ViewScope @ViewScope
@@ -47,12 +45,6 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
@Autowired @Autowired
private transient EventBus.SessionEventBus eventBus; private transient EventBus.SessionEventBus eventBus;
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.AbstractAcceptCriteria#analyseDragComponent
* (com.vaadin.event .dd.DragAndDropEvent, com.vaadin.ui.Component)
*/
@Override @Override
protected void analyseDragComponent(final Component compsource) { protected void analyseDragComponent(final Component compsource) {
final String sourceID = getComponentId(compsource); final String sourceID = getComponentId(compsource);
@@ -60,24 +52,11 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
eventBus.publish(this, event); eventBus.publish(this, event);
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#hideDropHints
* ()
*/
@Override @Override
protected void hideDropHints() { protected void hideDropHints() {
eventBus.publish(this, DragEvent.HIDE_DROP_HINT); eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#invalidDrop()
*/
@Override @Override
protected void invalidDrop() { protected void invalidDrop() {
uiNotification.displayValidationError(SPUILabelDefinitions.ACTION_NOT_ALLOWED); uiNotification.displayValidationError(SPUILabelDefinitions.ACTION_NOT_ALLOWED);
@@ -94,34 +73,16 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
return id; return id;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
* getDropHintConfigurations()
*/
@Override @Override
protected Map<String, Object> getDropHintConfigurations() { protected Map<String, Object> getDropHintConfigurations() {
return DROP_HINTS_CONFIGS; return DROP_HINTS_CONFIGS;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
* publishDragStartEvent(java.lang.Object)
*/
@Override @Override
protected void publishDragStartEvent(final Object event) { protected void publishDragStartEvent(final Object event) {
eventBus.publish(this, event); eventBus.publish(this, event);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
* getDropConfigurations()
*/
@Override @Override
protected Map<String, List<String>> getDropConfigurations() { protected Map<String, List<String>> getDropConfigurations() {
return DROP_CONFIGS; return DROP_CONFIGS;
@@ -137,7 +98,7 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
} }
private static Map<String, List<String>> createDropConfigurations() { 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 // Delete drop area droppable components
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID, config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID,
@@ -153,7 +114,7 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
} }
private static Map<String, Object> createDropHintConfigurations() { 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(SPUIDefinitions.DISTRIBUTION_TYPE_ID_PREFIXS, DragEvent.DISTRIBUTION_TYPE_DRAG);
config.put(SPUIComponetIdProvider.DIST_TABLE_ID, DragEvent.DISTRIBUTION_DRAG); config.put(SPUIComponetIdProvider.DIST_TABLE_ID, DragEvent.DISTRIBUTION_DRAG);
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, DragEvent.SOFTWAREMODULE_DRAG); config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, DragEvent.SOFTWAREMODULE_DRAG);

View File

@@ -32,9 +32,6 @@ import com.google.common.base.Strings;
/** /**
* Simple implementation of generics bean query which dynamically loads a batch * Simple implementation of generics bean query which dynamically loads a batch
* of beans. * of beans.
*
*
*
* *
*/ */
public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem> { public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem> {
@@ -77,17 +74,10 @@ public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem>
return new ProxyBaseSwModuleItem(); return new ProxyBaseSwModuleItem();
} }
/*
* (non-Javadoc)
*
* @see
* org.vaadin.addons.lazyquerycontainer.AbstractBeanQuery#loadBeans(int,
* int)
*/
@Override @Override
protected List<ProxyBaseSwModuleItem> loadBeans(final int startIndex, final int count) { protected List<ProxyBaseSwModuleItem> loadBeans(final int startIndex, final int count) {
final Slice<CustomSoftwareModule> swModuleBeans; final Slice<CustomSoftwareModule> swModuleBeans;
final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<ProxyBaseSwModuleItem>(); final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<>();
swModuleBeans = getSoftwareManagement().findSoftwareModuleOrderByDistribution( swModuleBeans = getSoftwareManagement().findSoftwareModuleOrderByDistribution(
new OffsetBasedPageRequest(startIndex, count, new Sort(Direction.ASC, "name", "version")), new OffsetBasedPageRequest(startIndex, count, new Sort(Direction.ASC, "name", "version")),

View File

@@ -67,8 +67,6 @@ import com.vaadin.ui.Window;
/** /**
* Implementation of software module table using generic abstract table styles . * Implementation of software module table using generic abstract table styles .
*
*
* *
*/ */
@SpringComponent @SpringComponent
@@ -94,10 +92,11 @@ public class SwModuleTable extends AbstractTable {
@Autowired @Autowired
private ArtifactDetailsLayout artifactDetailsLayout; private ArtifactDetailsLayout artifactDetailsLayout;
/** /**
* Initialize the filter layout. * Initialize the filter layout.
*/ */
@Override
@PostConstruct @PostConstruct
protected void init() { protected void init() {
super.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 @Override
protected String getTableId() { protected String getTableId() {
return SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE; return SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.table.SPTable#createContainer()
*/
@Override @Override
protected Container createContainer() { protected Container createContainer() {
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters(); final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<SwModuleBeanQuery>( final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<>(SwModuleBeanQuery.class);
SwModuleBeanQuery.class);
swQF.setQueryConfiguration(queryConfiguration); swQF.setQueryConfiguration(queryConfiguration);
final LazyQueryContainer container = new LazyQueryContainer( return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
return container;
} }
private Map<String, Object> prepareQueryConfigFilters() { private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>(); final Map<String, Object> queryConfig = new HashMap<>();
manageDistUIState.getSoftwareModuleFilters().getSearchText() manageDistUIState.getSoftwareModuleFilters().getSearchText()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value)); .ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType() manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType()
.ifPresent(type -> queryConfig.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type)); .ifPresent(type -> queryConfig.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
manageDistUIState.getLastSelectedDistribution().ifPresent( manageDistUIState.getLastSelectedDistribution()
distIdName -> queryConfig.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId())); .ifPresent(distIdName -> queryConfig.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
return queryConfig; return queryConfig;
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.SPTable#addContainerProperties(com.
* vaadin.data.Container)
*/
@Override @Override
protected void addContainerProperties(final Container container) { protected void addContainerProperties(final Container container) {
final LazyQueryContainer lazyContainer = (LazyQueryContainer) 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); lazyContainer.addContainerProperty(SPUILabelDefinitions.VAR_SOFT_TYPE_ID, Long.class, null, false, true);
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.SPTable#addCustomGeneratedColumns()
*/
@Override @Override
protected void addCustomGeneratedColumns() { protected void addCustomGeneratedColumns() {
@@ -249,32 +222,16 @@ public class SwModuleTable extends AbstractTable {
}); });
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.SPTable#isFirstRowSelectedOnLoad()
*/
@Override @Override
protected boolean isFirstRowSelectedOnLoad() { protected boolean isFirstRowSelectedOnLoad() {
return manageDistUIState.getSelectedSoftwareModules().isEmpty(); return manageDistUIState.getSelectedSoftwareModules().isEmpty();
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.table.SPTable#getItemIdToSelect()
*/
@Override @Override
protected Object getItemIdToSelect() { protected Object getItemIdToSelect() {
return manageDistUIState.getSelectedSoftwareModules(); return manageDistUIState.getSelectedSoftwareModules();
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.table.SPTable#isMaximized()
*/
@Override @Override
protected boolean isMaximized() { protected boolean isMaximized() {
return manageDistUIState.isSwModuleTableMaximized(); 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 @Override
protected List<TableColumn> getTableVisibleColumns() { protected List<TableColumn> getTableVisibleColumns() {
final List<TableColumn> columnList = new ArrayList<TableColumn>(); final List<TableColumn> columnList = new ArrayList<>();
if (isMaximized()) { if (isMaximized()) {
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F)); 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)); 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) { private String getTableStyle(final Long typeId, final boolean isAssigned, final String color) {
if (isAssigned) { if (isAssigned) {
addTypeStyle(typeId, color); addTypeStyle(typeId, color);
@@ -391,11 +336,6 @@ public class SwModuleTable extends AbstractTable {
+ "{background-color:" + color + " !important;background-image:none !important }"))); + "{background-color:" + color + " !important;background-image:none !important }")));
} }
/**
* @param itemId
* @param propertyId
* @return
*/
private String createTableStyle(final Object itemId, final Object propertyId) { private String createTableStyle(final Object itemId, final Object propertyId) {
if (null == propertyId) { if (null == propertyId) {
final Item item = getItem(itemId); final Item item = getItem(itemId);
@@ -429,12 +369,6 @@ public class SwModuleTable extends AbstractTable {
return name + "." + version; return name + "." + version;
} }
/**
* Add new software module to table.
*
* @param swModule
* new software module
*/
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private void addSoftwareModule(final SoftwareModule swModule) { private void addSoftwareModule(final SoftwareModule swModule) {
final Object addItem = addItem(); final Object addItem = addItem();
@@ -461,11 +395,6 @@ public class SwModuleTable extends AbstractTable {
select(swModule.getId()); select(swModule.getId());
} }
/**
* @param itemId
* @param nameVersionStr
* @return
*/
private void showArtifactDetailsWindow(final Long itemId, final String nameVersionStr) { private void showArtifactDetailsWindow(final Long itemId, final String nameVersionStr) {
final Window atrifactDtlsWindow = new Window(); final Window atrifactDtlsWindow = new Window();
atrifactDtlsWindow.setCaption(HawkbitCommonUtil.getArtifactoryDetailsLabelId(nameVersionStr)); atrifactDtlsWindow.setCaption(HawkbitCommonUtil.getArtifactoryDetailsLabelId(nameVersionStr));

View File

@@ -40,8 +40,6 @@ import com.vaadin.spring.annotation.ViewScope;
/** /**
* Software Module Type filter buttons. * Software Module Type filter buttons.
* *
*
*
*/ */
@SpringComponent @SpringComponent
@ViewScope @ViewScope
@@ -64,40 +62,25 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
* @param filterButtonClickBehaviour * @param filterButtonClickBehaviour
* the clickable behaviour. * the clickable behaviour.
*/ */
@Override
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) { public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
super.init(filterButtonClickBehaviour); super.init(filterButtonClickBehaviour);
eventBus.subscribe(this); eventBus.subscribe(this);
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* getButtonsTableId()
*/
@Override @Override
protected String getButtonsTableId() { protected String getButtonsTableId() {
return SPUIComponetIdProvider.SW_MODULE_TYPE_TABLE_ID; return SPUIComponetIdProvider.SW_MODULE_TYPE_TABLE_ID;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* createButtonsLazyQueryContainer ()
*/
@Override @Override
protected LazyQueryContainer createButtonsLazyQueryContainer() { protected LazyQueryContainer createButtonsLazyQueryContainer() {
final Map<String, Object> queryConfig = new HashMap<String, Object>(); final Map<String, Object> queryConfig = new HashMap<>();
final BeanQueryFactory<SoftwareModuleTypeBeanQuery> typeQF = new BeanQueryFactory<SoftwareModuleTypeBeanQuery>( final BeanQueryFactory<SoftwareModuleTypeBeanQuery> typeQF = new BeanQueryFactory<>(
SoftwareModuleTypeBeanQuery.class); SoftwareModuleTypeBeanQuery.class);
typeQF.setQueryConfiguration(queryConfig); typeQF.setQueryConfiguration(queryConfig);
final LazyQueryContainer lazyQueryContainer = new LazyQueryContainer( return new LazyQueryContainer(new LazyQueryDefinition(true, 20, SPUILabelDefinitions.VAR_NAME), typeQF);
new LazyQueryDefinition(true, 20, SPUILabelDefinitions.VAR_NAME), typeQF);
return lazyQueryContainer;
} }
@Override @Override
@@ -105,13 +88,6 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
return null; return null;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* isClickedByDefault(java.lang .Long)
*/
@Override @Override
protected boolean isClickedByDefault(final Long buttonId) { protected boolean isClickedByDefault(final Long buttonId) {
@@ -119,25 +95,11 @@ public class DistSMTypeFilterButtons extends AbstractFilterButtons {
&& manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType().get().getId().equals(buttonId); && manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType().get().getId().equals(buttonId);
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* createButtonId(java.lang. String)
*/
@Override @Override
protected String createButtonId(final String name) { protected String createButtonId(final String name) {
return SPUIComponetIdProvider.SM_TYPE_FILTER_BTN_ID + name; return SPUIComponetIdProvider.SM_TYPE_FILTER_BTN_ID + name;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* getFilterButtonDropHandler()
*/
@Override @Override
protected DropHandler getFilterButtonDropHandler() { 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 @Override
protected String getButttonWrapperIdPrefix() { protected String getButttonWrapperIdPrefix() {

View File

@@ -20,8 +20,6 @@ import com.vaadin.spring.annotation.VaadinSessionScope;
/** /**
* Distribution table filter state. * Distribution table filter state.
*
*
*/ */
@SpringComponent @SpringComponent
@VaadinSessionScope @VaadinSessionScope
@@ -31,9 +29,9 @@ public class ManageDistFilters implements Serializable {
private String searchText; 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; private DistributionSetType clickedDistSetType;
@@ -61,17 +59,10 @@ public class ManageDistFilters implements Serializable {
this.clickedDistSetTags = clickedDistSetTags; this.clickedDistSetTags = clickedDistSetTags;
} }
/**
* @return the searchText
*/
public Optional<String> getSearchText() { public Optional<String> getSearchText() {
return searchText == null ? Optional.empty() : Optional.of(searchText); return searchText == null ? Optional.empty() : Optional.of(searchText);
} }
/**
* @param searchText
* the searchText to set
*/
public void setSearchText(final String searchText) { public void setSearchText(final String searchText) {
this.searchText = searchText; this.searchText = searchText;
} }

View File

@@ -34,7 +34,6 @@ import com.google.common.base.Strings;
* *
* *
*/ */
public class TargetFilterBeanQuery extends AbstractBeanQuery<ProxyTargetFilter> { public class TargetFilterBeanQuery extends AbstractBeanQuery<ProxyTargetFilter> {
private static final long serialVersionUID = 1845964596238990987L; private static final long serialVersionUID = 1845964596238990987L;
@@ -76,8 +75,8 @@ public class TargetFilterBeanQuery extends AbstractBeanQuery<ProxyTargetFilter>
@Override @Override
protected List<ProxyTargetFilter> loadBeans(final int startIndex, final int count) { protected List<ProxyTargetFilter> loadBeans(final int startIndex, final int count) {
Slice<TargetFilterQuery> targetFilterQuery = null; Slice<TargetFilterQuery> targetFilterQuery;
final List<ProxyTargetFilter> proxyTargetFilter = new ArrayList<ProxyTargetFilter>(); final List<ProxyTargetFilter> proxyTargetFilter = new ArrayList<>();
if (startIndex == 0 && firstPageTargetFilter != null) { if (startIndex == 0 && firstPageTargetFilter != null) {
targetFilterQuery = firstPageTargetFilter; targetFilterQuery = firstPageTargetFilter;
} else if (Strings.isNullOrEmpty(searchText)) { } else if (Strings.isNullOrEmpty(searchText)) {

View File

@@ -41,7 +41,6 @@ import org.vaadin.spring.events.annotation.EventBusListenerMethod;
import com.vaadin.data.Container; import com.vaadin.data.Container;
import com.vaadin.data.Item; import com.vaadin.data.Item;
import com.vaadin.server.FontAwesome; import com.vaadin.server.FontAwesome;
import com.vaadin.server.Sizeable.Unit;
import com.vaadin.spring.annotation.SpringComponent; import com.vaadin.spring.annotation.SpringComponent;
import com.vaadin.spring.annotation.ViewScope; import com.vaadin.spring.annotation.ViewScope;
import com.vaadin.ui.Button; import com.vaadin.ui.Button;
@@ -84,20 +83,20 @@ public class TargetFilterTable extends Table {
* Initialize the Action History Table. * Initialize the Action History Table.
*/ */
@PostConstruct @PostConstruct
public void init() { public void init() {
setStyleName("sp-table"); setStyleName("sp-table");
setSizeFull(); setSizeFull();
setImmediate(true); setImmediate(true);
setHeight(100.0f, Unit.PERCENTAGE); setHeight(100.0f, Unit.PERCENTAGE);
addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES); addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
addStyleName(ValoTheme.TABLE_SMALL); addStyleName(ValoTheme.TABLE_SMALL);
addCustomGeneratedColumns(); addCustomGeneratedColumns();
populateTableData(); populateTableData();
setColumnCollapsingAllowed(true); setColumnCollapsingAllowed(true);
setColumnProperties(); setColumnProperties();
setId(SPUIComponetIdProvider.TAEGET_FILTER_TABLE_ID); setId(SPUIComponetIdProvider.TAEGET_FILTER_TABLE_ID);
eventBus.subscribe(this); eventBus.subscribe(this);
} }
@PreDestroy @PreDestroy
void destroy() { void destroy() {
@@ -114,20 +113,14 @@ public class TargetFilterTable extends Table {
} }
} }
/**
* Create a empty HierarchicalContainer.
*
*
*/
private Container createContainer() { private Container createContainer() {
final Map<String, Object> queryConfig = prepareQueryConfigFilters(); final Map<String, Object> queryConfig = prepareQueryConfigFilters();
final BeanQueryFactory<TargetFilterBeanQuery> targetQF = new BeanQueryFactory<TargetFilterBeanQuery>( final BeanQueryFactory<TargetFilterBeanQuery> targetQF = new BeanQueryFactory<>(TargetFilterBeanQuery.class);
TargetFilterBeanQuery.class);
targetQF.setQueryConfiguration(queryConfig); targetQF.setQueryConfiguration(queryConfig);
// create lazy query container with lazy defination and query // create lazy query container with lazy defination and query
final LazyQueryContainer targetFilterContainer = new LazyQueryContainer(new LazyQueryDefinition(true, final LazyQueryContainer targetFilterContainer = new LazyQueryContainer(
SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_ID), targetQF); new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_ID), targetQF);
targetFilterContainer.getQueryView().getQueryDefinition().setMaxNestedPropertyDepth(PROPERTY_DEPT); targetFilterContainer.getQueryView().getQueryDefinition().setMaxNestedPropertyDepth(PROPERTY_DEPT);
return targetFilterContainer; return targetFilterContainer;
@@ -135,15 +128,12 @@ public class TargetFilterTable extends Table {
} }
private Map<String, Object> prepareQueryConfigFilters() { private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>(); final Map<String, Object> queryConfig = new HashMap<>();
filterManagementUIState.getCustomFilterSearchText().ifPresent( filterManagementUIState.getCustomFilterSearchText()
value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value)); .ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
return queryConfig; return queryConfig;
} }
/**
* Create a empty HierarchicalContainer.
*/
private void addContainerproperties() { private void addContainerproperties() {
/* Create HierarchicalContainer container */ /* Create HierarchicalContainer container */
container.addContainerProperty(SPUILabelDefinitions.NAME, Link.class, null); container.addContainerProperty(SPUILabelDefinitions.NAME, Link.class, null);
@@ -154,7 +144,7 @@ public class TargetFilterTable extends Table {
} }
private List<TableColumn> getVisbleColumns() { 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.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_USER, i18n.get("header.createdBy"), 0.15F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.2F)); 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() { private void refreshContainer() {
populateTableData(); populateTableData();
@@ -187,10 +176,6 @@ public class TargetFilterTable extends Table {
.toString(); .toString();
} }
/**
* @param event
* @return
*/
private void onDelete(final ClickEvent event) { private void onDelete(final ClickEvent event) {
/* Display the confirmation */ /* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.filter.delete.confirmbox"), 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. * of the deleted custom filter.
*/ */
notification.displaySuccess(i18n.get("message.delete.filter.success", notification.displaySuccess(
new Object[] { deletedFilterName })); i18n.get("message.delete.filter.success", new Object[] { deletedFilterName }));
refreshContainer(); refreshContainer();
} }
}); });
@@ -236,10 +221,6 @@ public class TargetFilterTable extends Table {
return updateIcon; return updateIcon;
} }
/**
* @param event
* @return
*/
private void onClickOfDetailButton(final ClickEvent event) { private void onClickOfDetailButton(final ClickEvent event) {
final String targetFilterName = (String) ((Button) event.getComponent()).getData(); final String targetFilterName = (String) ((Button) event.getComponent()).getData();
final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement

View File

@@ -202,16 +202,8 @@ public class ActionHistoryTable extends TreeTable implements Handler {
hierarchicalContainer.addContainerProperty(SPUIDefinitions.ACTION_HIS_TBL_ROLLOUT_NAME, String.class, null); 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() { 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_ACTIVE);
visibleColumnIds.add(SPUIDefinitions.ACTION_HIS_TBL_DIST); visibleColumnIds.add(SPUIDefinitions.ACTION_HIS_TBL_DIST);
visibleColumnIds.add(SPUIDefinitions.ACTION_HIS_TBL_DATETIME); visibleColumnIds.add(SPUIDefinitions.ACTION_HIS_TBL_DATETIME);

View File

@@ -96,7 +96,7 @@ public class DistributionBeanQuery extends AbstractBeanQuery<ProxyDistribution>
@Override @Override
protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) { protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) {
Page<DistributionSet> distBeans; Page<DistributionSet> distBeans;
final List<ProxyDistribution> proxyDistributions = new ArrayList<ProxyDistribution>(); final List<ProxyDistribution> proxyDistributions = new ArrayList<>();
if (startIndex == 0 && firstPageDistributionSets != null) { if (startIndex == 0 && firstPageDistributionSets != null) {
distBeans = firstPageDistributionSets; distBeans = firstPageDistributionSets;
} else if (pinnedControllerId != null) { } else if (pinnedControllerId != null) {

View File

@@ -73,8 +73,6 @@ import com.vaadin.ui.UI;
/** /**
* Distribution set table. * Distribution set table.
*
*
* *
*/ */
@SpringComponent @SpringComponent
@@ -112,11 +110,11 @@ public class DistributionTable extends AbstractTable {
private Boolean isDistPinned = false; private Boolean isDistPinned = false;
private Button distributinPinnedBtn; private Button distributinPinnedBtn;
/** /**
* Initialize the distribution table. * Initialize the distribution table.
*/ */
@Override
@PostConstruct @PostConstruct
protected void init() { protected void init() {
super.init(); super.init();
@@ -142,7 +140,7 @@ public class DistributionTable extends AbstractTable {
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT || event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|| event == DistributionTableFilterEvent.FILTER_BY_TAG) { || event == DistributionTableFilterEvent.FILTER_BY_TAG) {
UI.getCurrent().access(() -> refreshFilter()); UI.getCurrent().access(() -> refreshFilter());
} }
} }
@EventBusListenerMethod(scope = EventScope.SESSION) @EventBusListenerMethod(scope = EventScope.SESSION)
@@ -221,23 +219,22 @@ public class DistributionTable extends AbstractTable {
@Override @Override
protected Container createContainer() { protected Container createContainer() {
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters(); final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
final BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<DistributionBeanQuery>( final BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<>(
DistributionBeanQuery.class); DistributionBeanQuery.class);
distributionQF.setQueryConfiguration(queryConfiguration); distributionQF.setQueryConfiguration(queryConfiguration);
final LazyQueryContainer distributionContainer = new LazyQueryContainer( return new LazyQueryContainer(
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME), new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME),
distributionQF); distributionQF);
return distributionContainer;
} }
private Map<String, Object> prepareQueryConfigFilters() { private Map<String, Object> prepareQueryConfigFilters() {
final Map<String, Object> queryConfig = new HashMap<String, Object>(); final Map<String, Object> queryConfig = new HashMap<>();
managementUIState.getDistributionTableFilters().getSearchText() managementUIState.getDistributionTableFilters().getSearchText()
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value)); .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)); .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, queryConfig.put(SPUIDefinitions.FILTER_BY_NO_TAG,
managementUIState.getDistributionTableFilters().isNoTagSelected()); managementUIState.getDistributionTableFilters().isNoTagSelected());
if (!managementUIState.getDistributionTableFilters().getDistSetTags().isEmpty()) { if (!managementUIState.getDistributionTableFilters().getDistSetTags().isEmpty()) {
@@ -247,23 +244,11 @@ public class DistributionTable extends AbstractTable {
return queryConfig; return queryConfig;
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.AbstractTable#addContainerProperties(
* com.vaadin.data.Container )
*/
@Override @Override
protected void addContainerProperties(final Container container) { protected void addContainerProperties(final Container container) {
HawkbitCommonUtil.getDsTableColumnProperties(container); HawkbitCommonUtil.getDsTableColumnProperties(container);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTable#
* addCustomGeneratedColumns()
*/
@Override @Override
protected void addCustomGeneratedColumns() { protected void addCustomGeneratedColumns() {
addGeneratedColumn(SPUILabelDefinitions.PIN_COLUMN, new Table.ColumnGenerator() { 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 @Override
protected boolean isFirstRowSelectedOnLoad() { protected boolean isFirstRowSelectedOnLoad() {
return !managementUIState.getSelectedDsIdName().isPresent() return !managementUIState.getSelectedDsIdName().isPresent()
|| managementUIState.getSelectedDsIdName().get().isEmpty(); || managementUIState.getSelectedDsIdName().get().isEmpty();
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.AbstractTable#getItemIdToSelect()
*/
@Override @Override
protected Object getItemIdToSelect() { protected Object getItemIdToSelect() {
if (managementUIState.getSelectedDsIdName().isPresent()) { if (managementUIState.getSelectedDsIdName().isPresent()) {
@@ -301,16 +275,9 @@ public class DistributionTable extends AbstractTable {
return null; return null;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.table.AbstractTable#onValueChange()
*/
@Override @Override
protected void onValueChange() { protected void onValueChange() {
eventBus.publish(this, DragEvent.HIDE_DROP_HINT); eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
@SuppressWarnings("unchecked")
final Set<DistributionSetIdName> values = HawkbitCommonUtil.getSelectedDSDetails(this); final Set<DistributionSetIdName> values = HawkbitCommonUtil.getSelectedDSDetails(this);
DistributionSetIdName value = null; DistributionSetIdName value = null;
if (values != null && !values.isEmpty()) { if (values != null && !values.isEmpty()) {
@@ -319,10 +286,7 @@ public class DistributionTable extends AbstractTable {
while (iterator.hasNext()) { while (iterator.hasNext()) {
value = iterator.next(); value = iterator.next();
} }
/**
* Adding null check to make to avoid NPE.Its weird that at times
* getValue returns null.
*/
if (null != value) { if (null != value) {
managementUIState.setSelectedDsIdName(values); managementUIState.setSelectedDsIdName(values);
managementUIState.setLastSelectedDsIdName(value); 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 @Override
protected boolean isMaximized() { protected boolean isMaximized() {
return managementUIState.isDsTableMaximized(); return managementUIState.isDsTableMaximized();
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.AbstractTable#getTableVisibleColumns(
* )
*/
@Override @Override
protected List<TableColumn> getTableVisibleColumns() { protected List<TableColumn> getTableVisibleColumns() {
return HawkbitCommonUtil.getTableVisibleColumns(isMaximized(), true, i18n); return HawkbitCommonUtil.getTableVisibleColumns(isMaximized(), true, i18n);
} }
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.table.AbstractTable#getTableDropHandler()
*/
@Override @Override
protected DropHandler getTableDropHandler() { protected DropHandler getTableDropHandler() {
return new DropHandler() { return new DropHandler() {
@@ -403,7 +350,7 @@ public class DistributionTable extends AbstractTable {
final com.vaadin.event.dd.TargetDetails taregtDet = event.getTargetDetails(); final com.vaadin.event.dd.TargetDetails taregtDet = event.getTargetDetails();
final Table distTable = (Table) taregtDet.getTarget(); final Table distTable = (Table) taregtDet.getTarget();
final Set<DistributionSetIdName> distsSelected = HawkbitCommonUtil.getSelectedDSDetails(distTable); 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 AbstractSelectTargetDetails dropData = (AbstractSelectTargetDetails) event.getTargetDetails();
final Object distItemId = dropData.getItemIdOver(); final Object distItemId = dropData.getItemIdOver();
@@ -435,7 +382,7 @@ public class DistributionTable extends AbstractTable {
// assign dist to those targets // assign dist to those targets
final List<Target> assignedTargets = targetService.findTargetsByTag(targetTagName); final List<Target> assignedTargets = targetService.findTargetsByTag(targetTagName);
if (!assignedTargets.isEmpty()) { if (!assignedTargets.isEmpty()) {
final Set<TargetIdName> targetDetailsList = new HashSet<TargetIdName>(); final Set<TargetIdName> targetDetailsList = new HashSet<>();
assignedTargets.forEach(target -> targetDetailsList assignedTargets.forEach(target -> targetDetailsList
.add(new TargetIdName(target.getId(), target.getControllerId(), target.getName()))); .add(new TargetIdName(target.getId(), target.getControllerId(), target.getName())));
assignTargetToDs(getItem(distItemId), targetDetailsList); assignTargetToDs(getItem(distItemId), targetDetailsList);
@@ -448,7 +395,7 @@ public class DistributionTable extends AbstractTable {
final TableTransferable transferable = (TableTransferable) event.getTransferable(); final TableTransferable transferable = (TableTransferable) event.getTransferable();
final Table source = transferable.getSourceComponent(); final Table source = transferable.getSourceComponent();
final Set<TargetIdName> targetsSelected = HawkbitCommonUtil.getSelectedTargetDetails(source); 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"))) { if (!targetsSelected.contains(transferable.getData("itemId"))) {
targetDetailsList.add((TargetIdName) 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) { private Boolean doValidation(final DragAndDropEvent dragEvent) {
final Component compsource = dragEvent.getTransferable().getSourceComponent(); final Component compsource = dragEvent.getTransferable().getSourceComponent();
if (compsource instanceof Table) { if (compsource instanceof Table) {
@@ -528,15 +468,6 @@ public class DistributionTable extends AbstractTable {
return false; return false;
} }
/**
* Validate the assignment.
*
* @param targetDetailsList
* @param source
* @param distId
* @param distName
* @return String as indicator
*/
private String validate(final Set<TargetIdName> targetDetailsList, private String validate(final Set<TargetIdName> targetDetailsList,
final DistributionSetIdName distributionSetIdName) { final DistributionSetIdName distributionSetIdName) {
String pendingActionMessage = null; String pendingActionMessage = null;
@@ -555,17 +486,6 @@ public class DistributionTable extends AbstractTable {
return pendingActionMessage; 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) { private String getPendingActionMessage(final String message, final String targId, final String distNameVersion) {
String pendActionMsg = i18n.get("message.target.assigned.pending"); String pendActionMsg = i18n.get("message.target.assigned.pending");
if (null == message) { if (null == message) {
@@ -574,12 +494,6 @@ public class DistributionTable extends AbstractTable {
return pendActionMsg; return pendActionMsg;
} }
/**
* Show or Hide Popup Notification Message.
*
* @param message
* as msg
*/
private void showOrHidePopupAndNotification(final String message) { private void showOrHidePopupAndNotification(final String message) {
if (null != managementUIState.getAssignedList() && !managementUIState.getAssignedList().isEmpty()) { if (null != managementUIState.getAssignedList() && !managementUIState.getAssignedList().isEmpty()) {
eventBus.publish(this, ManagementUIEvent.UPDATE_COUNT); 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, private String getPinnedDistributionStyle(final Long installedDistItemIds, final Long assignedDistTableItemIds,
final Object itemId) { final Object itemId) {
final Long distId = ((DistributionSetIdName) itemId).getId(); final Long distId = ((DistributionSetIdName) itemId).getId();
@@ -662,10 +563,6 @@ public class DistributionTable extends AbstractTable {
} }
} }
/**
* @param itemId
* @return
*/
private Object getPinButton(final Object itemId) { private Object getPinButton(final Object itemId) {
final DistributionSetIdName dist = (DistributionSetIdName) getContainerDataSource().getItem(itemId) final DistributionSetIdName dist = (DistributionSetIdName) getContainerDataSource().getItem(itemId)
.getItemProperty(SPUILabelDefinitions.VAR_DIST_ID_NAME).getValue(); .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) { private void addPinClickListener(final ClickEvent event) {
eventBus.publish(this, DragEvent.HIDE_DROP_HINT); eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
checkifAlreadyPinned(event.getButton()); 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) { private void checkifAlreadyPinned(final Button eventBtn) {
final Long newPinnedDistItemId = ((DistributionSetIdName) eventBtn.getData()).getId(); final Long newPinnedDistItemId = ((DistributionSetIdName) eventBtn.getData()).getId();
Long pinnedDistId = null; Long pinnedDistId = null;
@@ -758,9 +643,6 @@ public class DistributionTable extends AbstractTable {
} }
} }
/**
* set style to distribution set table.
*/
private void styleDistributionSetTable() { private void styleDistributionSetTable() {
setCellStyleGenerator(new Table.CellStyleGenerator() { setCellStyleGenerator(new Table.CellStyleGenerator() {
private static final long serialVersionUID = 1L; 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) { private void applyPinStyle(final Button eventBtn) {
final StringBuilder style = new StringBuilder(SPUIComponentProvider.getPinButtonStyle()); final StringBuilder style = new StringBuilder(SPUIComponentProvider.getPinButtonStyle());
style.append(' ').append(SPUIStyleDefinitions.DIST_PIN).append(' ').append("tablePin").append(' ') style.append(' ').append(SPUIStyleDefinitions.DIST_PIN).append(' ').append("tablePin").append(' ')
@@ -822,14 +698,9 @@ public class DistributionTable extends AbstractTable {
* @param assignedDistTableItemIds * @param assignedDistTableItemIds
* Item ids of assigned distribution set * Item ids of assigned distribution set
*/ */
@SuppressWarnings("serial")
public void styleDistributionSetTable(final Long installedDistItemId, final Long assignedDistTableItemId) { public void styleDistributionSetTable(final Long installedDistItemId, final Long assignedDistTableItemId) {
setCellStyleGenerator(new Table.CellStyleGenerator() { setCellStyleGenerator((source, itemId, propertyId) -> getPinnedDistributionStyle(installedDistItemId,
@Override assignedDistTableItemId, itemId));
public String getStyle(final Table source, final Object itemId, final Object propertyId) {
return getPinnedDistributionStyle(installedDistItemId, assignedDistTableItemId, itemId);
}
});
} }
public void setDistributinPinnedBtn(final Button distributinPinnedBtn) { public void setDistributinPinnedBtn(final Button distributinPinnedBtn) {

View File

@@ -75,7 +75,7 @@ public class DistributionTagBeanQuery extends AbstractBeanQuery<ProxyTag> {
@Override @Override
protected List<ProxyTag> loadBeans(final int startIndex, final int count) { protected List<ProxyTag> loadBeans(final int startIndex, final int count) {
Page<DistributionSetTag> dsTagBeans; Page<DistributionSetTag> dsTagBeans;
final List<ProxyTag> tagList = new ArrayList<ProxyTag>(); final List<ProxyTag> tagList = new ArrayList<>();
if (startIndex == 0 && firstPageDsTag != null) { if (startIndex == 0 && firstPageDsTag != null) {
dsTagBeans = firstPageDsTag; dsTagBeans = firstPageDsTag;
} else { } else {

View File

@@ -70,6 +70,7 @@ public class DistributionTagButtons extends AbstractFilterButtons {
* @param filterButtonClickBehaviour * @param filterButtonClickBehaviour
* the clickable behaviour. * the clickable behaviour.
*/ */
@Override
public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) { public void init(final AbstractFilterButtonClickBehaviour filterButtonClickBehaviour) {
super.init(filterButtonClickBehaviour); super.init(filterButtonClickBehaviour);
addNewTag(new DistributionSetTag("NO TAG")); 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 @Override
protected String getButtonsTableId() { protected String getButtonsTableId() {
return SPUIComponetIdProvider.DISTRIBUTION_TAG_TABLE_ID; return SPUIComponetIdProvider.DISTRIBUTION_TAG_TABLE_ID;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* createButtonsLazyQueryContainer ()
*/
@Override @Override
protected LazyQueryContainer createButtonsLazyQueryContainer() { protected LazyQueryContainer createButtonsLazyQueryContainer() {
final Map<String, Object> queryConfig = new HashMap<String, Object>(); final Map<String, Object> queryConfig = new HashMap<>();
final BeanQueryFactory<DistributionTagBeanQuery> tagQF = new BeanQueryFactory<DistributionTagBeanQuery>( final BeanQueryFactory<DistributionTagBeanQuery> tagQF = new BeanQueryFactory<>(DistributionTagBeanQuery.class);
DistributionTagBeanQuery.class);
tagQF.setQueryConfiguration(queryConfig); tagQF.setQueryConfiguration(queryConfig);
final LazyQueryContainer tagContainer = HawkbitCommonUtil.createDSLazyQueryContainer( return HawkbitCommonUtil.createDSLazyQueryContainer(
new BeanQueryFactory<DistributionTagBeanQuery>(DistributionTagBeanQuery.class)); new BeanQueryFactory<DistributionTagBeanQuery>(DistributionTagBeanQuery.class));
return tagContainer;
} }
@@ -142,13 +127,6 @@ public class DistributionTagButtons extends AbstractFilterButtons {
return SPUIDefinitions.DISTRIBUTION_TAG_BUTTON; return SPUIDefinitions.DISTRIBUTION_TAG_BUTTON;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* isClickedByDefault(java.lang .Long)
*/
@Override @Override
protected boolean isClickedByDefault(final Long buttonId) { protected boolean isClickedByDefault(final Long buttonId) {
final DistributionSetTag dsTagObject = tagMgmtService.findDistributionSetTagById(buttonId); final DistributionSetTag dsTagObject = tagMgmtService.findDistributionSetTagById(buttonId);
@@ -161,37 +139,16 @@ public class DistributionTagButtons extends AbstractFilterButtons {
return managementUIState.getDistributionTableFilters().isNoTagSelected(); return managementUIState.getDistributionTableFilters().isNoTagSelected();
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* createButtonId(java.lang. String)
*/
@Override @Override
protected String createButtonId(final String name) { protected String createButtonId(final String name) {
return name; return name;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* getFilterButtonDropHandler()
*/
@Override @Override
protected DropHandler getFilterButtonDropHandler() { protected DropHandler getFilterButtonDropHandler() {
return spDistTagDropEvent; return spDistTagDropEvent;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* getButttonWrapperId()
*/
@Override @Override
protected String getButttonWrapperIdPrefix() { protected String getButttonWrapperIdPrefix() {
return SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS; return SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS;

View File

@@ -86,20 +86,13 @@ public class DistributionTagDropEvent implements DropHandler {
private Boolean isNoTagAssigned(final DragAndDropEvent event) { private Boolean isNoTagAssigned(final DragAndDropEvent event) {
final String tagName = ((DragAndDropWrapper) (event.getTargetDetails().getTarget())).getData().toString(); final String tagName = ((DragAndDropWrapper) (event.getTargetDetails().getTarget())).getData().toString();
if (tagName.equals(SPUIDefinitions.DISTRIBUTION_TAG_BUTTON)) { if (tagName.equals(SPUIDefinitions.DISTRIBUTION_TAG_BUTTON)) {
notification.displayValidationError(i18n.get("message.tag.cannot.be.assigned", notification.displayValidationError(
new Object[] { i18n.get("label.no.tag.assigned") })); i18n.get("message.tag.cannot.be.assigned", new Object[] { i18n.get("label.no.tag.assigned") }));
return false; return false;
} }
return true; return true;
} }
/**
* Validate the drop.
*
* @param event
* DragAndDropEvent reference
* @return Boolean
*/
private Boolean validate(final DragAndDropEvent event) { private Boolean validate(final DragAndDropEvent event) {
final Component compsource = event.getTransferable().getSourceComponent(); final Component compsource = event.getTransferable().getSourceComponent();
if (!(compsource instanceof Table)) { if (!(compsource instanceof Table)) {
@@ -116,11 +109,6 @@ public class DistributionTagDropEvent implements DropHandler {
return true; return true;
} }
/**
* validate the update permission.
*
* @return boolean
*/
private boolean checkForDSUpdatePermission() { private boolean checkForDSUpdatePermission() {
if (!permChecker.hasUpdateDistributionPermission()) { if (!permChecker.hasUpdateDistributionPermission()) {
@@ -131,13 +119,6 @@ public class DistributionTagDropEvent implements DropHandler {
return true; return true;
} }
/**
* validate the source tables.
*
* @param source
* table
* @return boolean
*/
private boolean validateIfSourceIsDs(final Table source) { private boolean validateIfSourceIsDs(final Table source) {
if (!source.getId().equals(SPUIComponetIdProvider.DIST_TABLE_ID)) { if (!source.getId().equals(SPUIComponetIdProvider.DIST_TABLE_ID)) {
notification.displayValidationError(i18n.get(SPUILabelDefinitions.ACTION_NOT_ALLOWED)); notification.displayValidationError(i18n.get(SPUILabelDefinitions.ACTION_NOT_ALLOWED));
@@ -146,12 +127,6 @@ public class DistributionTagDropEvent implements DropHandler {
return true; return true;
} }
/**
* Process target Drop event.
*
* @param event
* DragAndDropEvent
*/
private void processDistributionDrop(final DragAndDropEvent event) { private void processDistributionDrop(final DragAndDropEvent event) {
final com.vaadin.event.dd.TargetDetails targetDetails = event.getTargetDetails(); final com.vaadin.event.dd.TargetDetails targetDetails = event.getTargetDetails();
@@ -161,7 +136,7 @@ public class DistributionTagDropEvent implements DropHandler {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
final Set<DistributionSetIdName> distSelected = (Set<DistributionSetIdName>) source.getValue(); 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))) { if (!distSelected.contains(transferable.getData(ITEMID))) {
distributionList.add(((DistributionSetIdName) transferable.getData(ITEMID)).getId()); distributionList.add(((DistributionSetIdName) transferable.getData(ITEMID)).getId());
} else { } else {
@@ -172,8 +147,8 @@ public class DistributionTagDropEvent implements DropHandler {
SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS); SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS);
final List<String> tagsClickedList = distFilterParameters.getDistSetTags(); final List<String> tagsClickedList = distFilterParameters.getDistSetTags();
final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment( final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment(distributionList,
distributionList, distTagName); distTagName);
notification.displaySuccess(HawkbitCommonUtil.getDistributionTagAssignmentMsg(distTagName, result, i18n)); notification.displaySuccess(HawkbitCommonUtil.getDistributionTagAssignmentMsg(distTagName, result, i18n));
if (result.getUnassigned() >= 1 && !tagsClickedList.isEmpty()) { if (result.getUnassigned() >= 1 && !tagsClickedList.isEmpty()) {

View File

@@ -47,12 +47,6 @@ public class ManagementViewAcceptCriteria extends AbstractAcceptCriteria {
@Autowired @Autowired
private transient EventBus.SessionEventBus eventBus; private transient EventBus.SessionEventBus eventBus;
/*
* (non-Javadoc)
*
* @see hawkbit.server.ui.common.AbstractAcceptCriteria#analyseDragComponent
* (com.vaadin.event .dd.DragAndDropEvent, com.vaadin.ui.Component)
*/
@Override @Override
protected void analyseDragComponent(final Component compsource) { protected void analyseDragComponent(final Component compsource) {
final String sourceID = getComponentId(compsource); final String sourceID = getComponentId(compsource);
@@ -60,24 +54,11 @@ public class ManagementViewAcceptCriteria extends AbstractAcceptCriteria {
eventBus.publish(this, event); eventBus.publish(this, event);
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#hideDropHints
* ()
*/
@Override @Override
protected void hideDropHints() { protected void hideDropHints() {
eventBus.publish(this, DragEvent.HIDE_DROP_HINT); eventBus.publish(this, DragEvent.HIDE_DROP_HINT);
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#invalidDrop()
*/
@Override @Override
protected void invalidDrop() { protected void invalidDrop() {
uiNotification.displayValidationError(SPUILabelDefinitions.ACTION_NOT_ALLOWED); uiNotification.displayValidationError(SPUILabelDefinitions.ACTION_NOT_ALLOWED);
@@ -94,60 +75,31 @@ public class ManagementViewAcceptCriteria extends AbstractAcceptCriteria {
return id; return id;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
* getDropHintConfigurations()
*/
@Override @Override
protected Map<String, Object> getDropHintConfigurations() { protected Map<String, Object> getDropHintConfigurations() {
return DROP_HINTS_CONFIGS; return DROP_HINTS_CONFIGS;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
* publishDragStartEvent(java.lang.Object)
*/
@Override @Override
protected void publishDragStartEvent(final Object event) { protected void publishDragStartEvent(final Object event) {
eventBus.publish(this, event); eventBus.publish(this, event);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.AbstractAcceptCriteria#
* getDropConfigurations()
*/
@Override @Override
protected Map<String, List<String>> getDropConfigurations() { protected Map<String, List<String>> getDropConfigurations() {
return DROP_CONFIGS; return DROP_CONFIGS;
} }
/**
* @param id
* @return
*/
private boolean isDistributionTagId(final String id) { private boolean isDistributionTagId(final String id) {
return id != null && id.startsWith(SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS); return id != null && id.startsWith(SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS);
} }
/**
* @param id
* @return
*/
private boolean isTargetTagId(final String id) { private boolean isTargetTagId(final String id) {
return id != null && id.startsWith(SPUIDefinitions.TARGET_TAG_ID_PREFIXS); return id != null && id.startsWith(SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
} }
/**
* @return
*/
private static Map<String, List<String>> createDropConfigurations() { 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 // Delete drop area acceptable components
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID, config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID,
@@ -174,7 +126,7 @@ public class ManagementViewAcceptCriteria extends AbstractAcceptCriteria {
} }
private static Map<String, Object> createDropHintConfigurations() { 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(SPUIDefinitions.TARGET_TAG_ID_PREFIXS, DragEvent.TARGET_TAG_DRAG);
config.put(SPUIComponetIdProvider.TARGET_TABLE_ID, DragEvent.TARGET_DRAG); config.put(SPUIComponetIdProvider.TARGET_TABLE_ID, DragEvent.TARGET_DRAG);
config.put(SPUIComponetIdProvider.DIST_TABLE_ID, DragEvent.DISTRIBUTION_DRAG); config.put(SPUIComponetIdProvider.DIST_TABLE_ID, DragEvent.DISTRIBUTION_DRAG);

View File

@@ -19,7 +19,6 @@ import org.eclipse.hawkbit.repository.TagManagement;
import org.eclipse.hawkbit.repository.model.DistributionSetIdName; import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
import org.eclipse.hawkbit.repository.model.TargetIdName; import org.eclipse.hawkbit.repository.model.TargetIdName;
import org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout; 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.BulkUploadPopupEvent;
import org.eclipse.hawkbit.ui.management.event.DragEvent; import org.eclipse.hawkbit.ui.management.event.DragEvent;
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent; 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;
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent.TargetComponentEvent; import org.eclipse.hawkbit.ui.management.event.TargetTableEvent.TargetComponentEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState; 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.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N; import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider; import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
@@ -85,12 +83,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
@Autowired @Autowired
private CountMessageLabel countMessageLabel; private CountMessageLabel countMessageLabel;
/* @Override
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.DeleteActionsLayout#init()
*/
@PostConstruct @PostConstruct
protected void init() { protected void init() {
super.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 @Override
protected boolean hasDeletePermission() { protected boolean hasDeletePermission() {
return permChecker.hasDeleteDistributionPermission() || permChecker.hasDeleteTargetPermission(); return permChecker.hasDeleteDistributionPermission() || permChecker.hasDeleteTargetPermission();
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* hasUpdatePermission()
*/
@Override @Override
protected boolean hasUpdatePermission() { protected boolean hasUpdatePermission() {
return permChecker.hasUpdateTargetPermission() && permChecker.hasReadDistributionPermission(); return permChecker.hasUpdateTargetPermission() && permChecker.hasReadDistributionPermission();
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* getDeleteAreaLabel()
*/
@Override @Override
protected String getDeleteAreaLabel() { protected String getDeleteAreaLabel() {
return i18n.get("label.components.drop.area"); return i18n.get("label.components.drop.area");
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* getDeleteAreaId()
*/
@Override @Override
protected String getDeleteAreaId() { protected String getDeleteAreaId() {
return SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID; return SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* getDeleteLayoutAcceptCriteria ()
*/
@Override @Override
protected AcceptCriterion getDeleteLayoutAcceptCriteria() { protected AcceptCriterion getDeleteLayoutAcceptCriteria() {
return managementViewAcceptCriteria; return managementViewAcceptCriteria;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* processDroppedComponent(com .vaadin.event.dd.DragAndDropEvent)
*/
@Override @Override
protected void processDroppedComponent(final DragAndDropEvent event) { protected void processDroppedComponent(final DragAndDropEvent event) {
final Component source = event.getTransferable().getSourceComponent(); final Component source = event.getTransferable().getSourceComponent();
@@ -275,61 +226,26 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
return true; return true;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* getNoActionsButtonLabel()
*/
@Override @Override
protected String getNoActionsButtonLabel() { protected String getNoActionsButtonLabel() {
return i18n.get("button.no.actions"); return i18n.get("button.no.actions");
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* getActionsButtonLabel()
*/
@Override @Override
protected String getActionsButtonLabel() { protected String getActionsButtonLabel() {
return i18n.get("button.actions"); return i18n.get("button.actions");
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* reloadActionCount()
*/
@Override @Override
protected void restoreActionCount() { protected void restoreActionCount() {
updateActionCount(); updateActionCount();
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* getUnsavedActionsWindowCaption ()
*/
@Override @Override
protected String getUnsavedActionsWindowCaption() { protected String getUnsavedActionsWindowCaption() {
return i18n.get("caption.save.window"); return i18n.get("caption.save.window");
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* unsavedActionsWindowClosed()
*/
@Override @Override
protected void unsavedActionsWindowClosed() { protected void unsavedActionsWindowClosed() {
final String message = manangementConfirmationWindowLayout.getConsolidatedMessage(); 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 @Override
protected Component getUnsavedActionsWindowContent() { protected Component getUnsavedActionsWindowContent() {
manangementConfirmationWindowLayout.init(); manangementConfirmationWindowLayout.init();
return manangementConfirmationWindowLayout; return manangementConfirmationWindowLayout;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* hasUnsavedActions()
*/
@Override @Override
protected boolean hasUnsavedActions() { protected boolean hasUnsavedActions() {
if (!managementUIState.getDeletedDistributionList().isEmpty() if (!managementUIState.getDeletedDistributionList().isEmpty()
@@ -368,25 +270,11 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
return false; return false;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* hasCountMessage()
*/
@Override @Override
protected boolean hasCountMessage() { protected boolean hasCountMessage() {
return permChecker.hasTargetReadPermission(); return permChecker.hasTargetReadPermission();
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.footer.AbstractDeleteActionsLayout#
* getCountMessageLabel()
*/
@Override @Override
protected Label getCountMessageLabel() { protected Label getCountMessageLabel() {
return countMessageLabel; 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) { private void addInDeleteDistributionList(final Table sourceTable, final TableTransferable transferable) {
final Set<DistributionSetIdName> distSelected = HawkbitCommonUtil.getSelectedDSDetails(sourceTable); 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))) { if (!distSelected.contains(transferable.getData(SPUIDefinitions.ITEMID))) {
distributionIdNameSet.add((DistributionSetIdName) transferable.getData(SPUIDefinitions.ITEMID)); distributionIdNameSet.add((DistributionSetIdName) transferable.getData(SPUIDefinitions.ITEMID));
@@ -477,15 +355,6 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
return false; return false;
} }
/**
* Prepare deleted target list.
*
* @param sourceTable
* {@link TargetTable}
* @param transferable
* {@link TableTransferable}
*
*/
private void addInDeleteTargetList(final Table sourceTable, final TableTransferable transferable) { private void addInDeleteTargetList(final Table sourceTable, final TableTransferable transferable) {
final Set<TargetIdName> targetSelected = HawkbitCommonUtil.getSelectedTargetDetails(sourceTable); 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() { private void updateActionCount() {
final int count = managementUIState.getDeletedTargetList().size() final int count = managementUIState.getDeletedTargetList().size()
+ managementUIState.getDeletedDistributionList().size() + managementUIState.getAssignedList().size(); + managementUIState.getDeletedDistributionList().size() + managementUIState.getAssignedList().size();
@@ -546,34 +412,16 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
return true; return true;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout#
* hasBulkUploadPermission()
*/
@Override @Override
protected boolean hasBulkUploadPermission() { protected boolean hasBulkUploadPermission() {
return permChecker.hasCreateTargetPermission(); return permChecker.hasCreateTargetPermission();
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout#
* showBulkUploadWindow()
*/
@Override @Override
protected void showBulkUploadWindow() { protected void showBulkUploadWindow() {
eventBus.publish(this, BulkUploadPopupEvent.MAXIMIMIZED); eventBus.publish(this, BulkUploadPopupEvent.MAXIMIMIZED);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout#
* restoreBulkUploadStatusCount()
*/
@Override @Override
protected void restoreBulkUploadStatusCount() { protected void restoreBulkUploadStatusCount() {
final Long failedCount = managementUIState.getTargetTableFilters().getBulkUpload().getFailedUploadCount(); final Long failedCount = managementUIState.getTargetTableFilters().getBulkUpload().getFailedUploadCount();

View File

@@ -33,9 +33,9 @@ public class DistributionTableFilters implements Serializable {
private String pinnedTargetId; 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; private Boolean noTagSelected = Boolean.FALSE;

View File

@@ -30,9 +30,9 @@ public class TargetFilterParameters implements Serializable {
private String searchText; 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; private Long distributionSetId;

View File

@@ -22,9 +22,6 @@ import com.vaadin.spring.annotation.VaadinSessionScope;
/** /**
* Target Table Filters. * Target Table Filters.
*
*
*
*/ */
@VaadinSessionScope @VaadinSessionScope
@SpringComponent @SpringComponent
@@ -32,8 +29,8 @@ public class TargetTableFilters implements Serializable {
private static final long serialVersionUID = -5251492630546463593L; private static final long serialVersionUID = -5251492630546463593L;
private final List<String> clickedTargetTags = new ArrayList<String>(); private final List<String> clickedTargetTags = new ArrayList<>();
private final List<TargetUpdateStatus> clickedStatusTargetTags = new ArrayList<TargetUpdateStatus>(); private final List<TargetUpdateStatus> clickedStatusTargetTags = new ArrayList<>();
private String searchText; private String searchText;
private DistributionSetIdName distributionSet; private DistributionSetIdName distributionSet;
private Long pinnedDistId; private Long pinnedDistId;

View File

@@ -39,10 +39,6 @@ import com.google.common.base.Strings;
* Simple implementation of generics bean query which dynamically loads a batch * Simple implementation of generics bean query which dynamically loads a batch
* of beans. * of beans.
* *
*
*
*
*
*/ */
public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> { public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
private static final long serialVersionUID = -5645680058303167558L; private static final long serialVersionUID = -5645680058303167558L;
@@ -105,7 +101,7 @@ public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
@Override @Override
protected List<ProxyTarget> loadBeans(final int startIndex, final int count) { protected List<ProxyTarget> loadBeans(final int startIndex, final int count) {
Slice<Target> targetBeans; Slice<Target> targetBeans;
final List<ProxyTarget> proxyTargetBeans = new ArrayList<ProxyTarget>(); final List<ProxyTarget> proxyTargetBeans = new ArrayList<>();
if (pinnedDistId != null) { if (pinnedDistId != null) {
targetBeans = getTargetManagement().findTargetsAllOrderByLinkedDistributionSet( targetBeans = getTargetManagement().findTargetsAllOrderByLinkedDistributionSet(
new OffsetBasedPageRequest(startIndex, SPUIDefinitions.PAGE_SIZE, sort), pinnedDistId, new OffsetBasedPageRequest(startIndex, SPUIDefinitions.PAGE_SIZE, sort), pinnedDistId,

View File

@@ -56,9 +56,6 @@ import com.vaadin.ui.themes.ValoTheme;
/** /**
* Target table header layout. * Target table header layout.
*
*
*
*/ */
@SpringComponent @SpringComponent
@ViewScope @ViewScope
@@ -95,6 +92,7 @@ public class TargetTableHeader extends AbstractTableHeader {
/** /**
* Initialization of Target Header Component. * Initialization of Target Header Component.
*/ */
@Override
@PostConstruct @PostConstruct
protected void init() { protected void init() {
super.init(); super.init();
@@ -258,7 +256,7 @@ public class TargetTableHeader extends AbstractTableHeader {
@Override @Override
protected void resetSearchText() { protected void resetSearchText() {
if(managementUIState.getTargetTableFilters().getSearchText().isPresent()){ if (managementUIState.getTargetTableFilters().getSearchText().isPresent()) {
managementUIState.getTargetTableFilters().setSearchText(null); managementUIState.getTargetTableFilters().setSearchText(null);
eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_TEXT); eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_TEXT);
} }
@@ -337,6 +335,11 @@ public class TargetTableHeader extends AbstractTableHeader {
@Override @Override
protected DropHandler getDropFilterHandler() { protected DropHandler getDropFilterHandler() {
return new DropHandler() { return new DropHandler() {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override @Override
public void drop(final DragAndDropEvent event) { public void drop(final DragAndDropEvent event) {
filterByDroppedDist(event); filterByDroppedDist(event);
@@ -395,10 +398,9 @@ public class TargetTableHeader extends AbstractTableHeader {
} }
private Set<DistributionSetIdName> getDropppedDistributionDetails(final TableTransferable transferable) { private Set<DistributionSetIdName> getDropppedDistributionDetails(final TableTransferable transferable) {
@SuppressWarnings("unchecked")
final Set<DistributionSetIdName> distSelected = HawkbitCommonUtil final Set<DistributionSetIdName> distSelected = HawkbitCommonUtil
.getSelectedDSDetails(transferable.getSourceComponent()); .getSelectedDSDetails(transferable.getSourceComponent());
final Set<DistributionSetIdName> distributionIdSet = new HashSet<DistributionSetIdName>(); final Set<DistributionSetIdName> distributionIdSet = new HashSet<>();
if (!distSelected.contains(transferable.getData("itemId"))) { if (!distSelected.contains(transferable.getData("itemId"))) {
distributionIdSet.add((DistributionSetIdName) transferable.getData("itemId")); distributionIdSet.add((DistributionSetIdName) transferable.getData("itemId"));
} else { } else {
@@ -443,12 +445,6 @@ public class TargetTableHeader extends AbstractTableHeader {
eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_DISTRIBUTION); eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_DISTRIBUTION);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.server.ui.common.table.AbstractTableHeader#
* displayFilterDropedInfoOnLoad()
*/
@Override @Override
protected void displayFilterDropedInfoOnLoad() { protected void displayFilterDropedInfoOnLoad() {
if (managementUIState.getTargetTableFilters().getDistributionSet().isPresent()) { 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 @Override
protected String getFilterIconStyle() { protected String getFilterIconStyle() {
return null; return null;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.hawkbit.ui.common.table.AbstractTableHeader#
* isBulkUploadInProgress()
*/
@Override @Override
protected boolean isBulkUploadInProgress() { protected boolean isBulkUploadInProgress() {
return managementUIState.getTargetTableFilters().getBulkUpload().getSucessfulUploadCount() != 0 return managementUIState.getTargetTableFilters().getBulkUpload().getSucessfulUploadCount() != 0

View File

@@ -75,7 +75,7 @@ public class TargetTagBeanQuery extends AbstractBeanQuery<ProxyTag> {
@Override @Override
protected List<ProxyTag> loadBeans(final int startIndex, final int count) { protected List<ProxyTag> loadBeans(final int startIndex, final int count) {
Page<TargetTag> targetTagBeans; Page<TargetTag> targetTagBeans;
final List<ProxyTag> targetTagList = new ArrayList<ProxyTag>(); final List<ProxyTag> targetTagList = new ArrayList<>();
if (startIndex == 0 && firstPageTargetTag != null) { if (startIndex == 0 && firstPageTargetTag != null) {
targetTagBeans = firstPageTargetTag; targetTagBeans = firstPageTargetTag;
} else { } else {

View File

@@ -57,9 +57,6 @@ import com.vaadin.ui.UI;
/** /**
* Target Tag filter buttons table. * Target Tag filter buttons table.
*
*
*
*/ */
@SpringComponent @SpringComponent
@ViewScope @ViewScope
@@ -129,40 +126,18 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
} }
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* getButtonsTableId()
*/
@Override @Override
protected String getButtonsTableId() { protected String getButtonsTableId() {
return SPUIComponetIdProvider.TARGET_TAG_TABLE_ID; return SPUIComponetIdProvider.TARGET_TAG_TABLE_ID;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* createButtonsLazyQueryContainer ()
*/
@Override @Override
protected LazyQueryContainer createButtonsLazyQueryContainer() { protected LazyQueryContainer createButtonsLazyQueryContainer() {
final LazyQueryContainer tagContainer = HawkbitCommonUtil return HawkbitCommonUtil
.createDSLazyQueryContainer(new BeanQueryFactory<TargetTagBeanQuery>(TargetTagBeanQuery.class)); .createDSLazyQueryContainer(new BeanQueryFactory<TargetTagBeanQuery>(TargetTagBeanQuery.class));
return tagContainer;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* isClickedByDefault(java.lang .Long)
*/
@Override @Override
protected boolean isClickedByDefault(final Long buttonId) { protected boolean isClickedByDefault(final Long buttonId) {
final TargetTag newTagClickedObj = tagMgmtService.findTargetTagById(buttonId); final TargetTag newTagClickedObj = tagMgmtService.findTargetTagById(buttonId);
@@ -175,26 +150,12 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
return managementUIState.getTargetTableFilters().isNoTagSelected(); return managementUIState.getTargetTableFilters().isNoTagSelected();
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* createButtonId(java.lang. String)
*/
@Override @Override
protected String createButtonId(final String name) { protected String createButtonId(final String name) {
return name; return name;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* getFilterButtonDropHandler()
*/
@Override @Override
protected DropHandler getFilterButtonDropHandler() { protected DropHandler getFilterButtonDropHandler() {
@@ -267,21 +228,14 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
return true; return true;
} }
/**
* Process target Drop event.
*
* @param event
* DragAndDropEvent
*/
private void processTargetDrop(final DragAndDropEvent event) { private void processTargetDrop(final DragAndDropEvent event) {
final com.vaadin.event.dd.TargetDetails targetDetails = event.getTargetDetails(); final com.vaadin.event.dd.TargetDetails targetDetails = event.getTargetDetails();
final TableTransferable transferable = (TableTransferable) event.getTransferable(); final TableTransferable transferable = (TableTransferable) event.getTransferable();
final Table source = transferable.getSourceComponent(); final Table source = transferable.getSourceComponent();
@SuppressWarnings("unchecked")
final Set<TargetIdName> targetSelected = HawkbitCommonUtil.getSelectedTargetDetails(source); 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 (transferable.getData(ITEMID) != null) {
if (!targetSelected.contains(transferable.getData(ITEMID))) { if (!targetSelected.contains(transferable.getData(ITEMID))) {
targetList.add(((TargetIdName) transferable.getData(ITEMID)).getControllerId()); 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) { private boolean validateIfSourceisTargetTable(final Table source) {
if (!source.getId().equals(SPUIComponetIdProvider.TARGET_TABLE_ID)) { if (!source.getId().equals(SPUIComponetIdProvider.TARGET_TABLE_ID)) {
notification.displayValidationError(i18n.get(SPUILabelDefinitions.ACTION_NOT_ALLOWED)); notification.displayValidationError(i18n.get(SPUILabelDefinitions.ACTION_NOT_ALLOWED));
@@ -321,13 +268,6 @@ public class TargetTagFilterButtons extends AbstractFilterButtons {
return true; return true;
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.hawkbit.server.ui.common.filterlayout.AbstractFilterButtons#
* getButttonWrapperId()
*/
@Override @Override
protected String getButttonWrapperIdPrefix() { protected String getButttonWrapperIdPrefix() {