add license text
Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
package org.eclipse.hawkbit.ui.colorPicker;
|
package org.eclipse.hawkbit.ui.colorPicker;
|
||||||
|
|
||||||
import com.vaadin.shared.ui.colorpicker.Color;
|
import com.vaadin.shared.ui.colorpicker.Color;
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
package org.eclipse.hawkbit.ui.colorPicker;
|
package org.eclipse.hawkbit.ui.colorPicker;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ui.management.tag.SpColorPickerPreview;
|
import org.eclipse.hawkbit.ui.management.tag.SpColorPickerPreview;
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
package org.eclipse.hawkbit.ui.colorPicker;
|
package org.eclipse.hawkbit.ui.colorPicker;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
package org.eclipse.hawkbit.ui.common;
|
package org.eclipse.hawkbit.ui.common;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
package org.eclipse.hawkbit.ui.common.detailslayout;
|
package org.eclipse.hawkbit.ui.common.detailslayout;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
|
||||||
|
|
||||||
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
@@ -14,7 +22,6 @@ import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
|
|||||||
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.vaadin.spring.events.EventBus.SessionEventBus;
|
|
||||||
|
|
||||||
import com.vaadin.data.Item;
|
import com.vaadin.data.Item;
|
||||||
import com.vaadin.data.util.IndexedContainer;
|
import com.vaadin.data.util.IndexedContainer;
|
||||||
@@ -23,21 +30,21 @@ import com.vaadin.ui.Label;
|
|||||||
import com.vaadin.ui.Table;
|
import com.vaadin.ui.Table;
|
||||||
import com.vaadin.ui.themes.ValoTheme;
|
import com.vaadin.ui.themes.ValoTheme;
|
||||||
|
|
||||||
public class DistributionSetMetadatadetailslayout extends Table{
|
public class DistributionSetMetadatadetailslayout extends Table {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2913758299611837718L;
|
private static final long serialVersionUID = 2913758299611837718L;
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(DistributionSetMetadatadetailslayout.class);
|
private static final Logger LOG = LoggerFactory.getLogger(DistributionSetMetadatadetailslayout.class);
|
||||||
|
|
||||||
private static final String METADATA_KEY = "Key";
|
private static final String METADATA_KEY = "Key";
|
||||||
|
|
||||||
private static final String VIEW ="view";
|
private static final String VIEW = "view";
|
||||||
|
|
||||||
private SpPermissionChecker permissionChecker;
|
private SpPermissionChecker permissionChecker;
|
||||||
|
|
||||||
private I18N i18n;
|
private I18N i18n;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize software module table- to be displayed in details layout.
|
* Initialize software module table- to be displayed in details layout.
|
||||||
*
|
*
|
||||||
* @param i18n
|
* @param i18n
|
||||||
@@ -78,7 +85,7 @@ public class DistributionSetMetadatadetailslayout extends Table{
|
|||||||
container.addContainerProperty(METADATA_KEY, String.class, "");
|
container.addContainerProperty(METADATA_KEY, String.class, "");
|
||||||
setColumnExpandRatio(METADATA_KEY, 0.7f);
|
setColumnExpandRatio(METADATA_KEY, 0.7f);
|
||||||
setColumnAlignment(METADATA_KEY, Align.LEFT);
|
setColumnAlignment(METADATA_KEY, Align.LEFT);
|
||||||
|
|
||||||
if (permissionChecker.hasUpdateDistributionPermission()) {
|
if (permissionChecker.hasUpdateDistributionPermission()) {
|
||||||
container.addContainerProperty(VIEW, Label.class, "");
|
container.addContainerProperty(VIEW, Label.class, "");
|
||||||
setColumnExpandRatio(VIEW, 0.2F);
|
setColumnExpandRatio(VIEW, 0.2F);
|
||||||
@@ -98,35 +105,37 @@ public class DistributionSetMetadatadetailslayout extends Table{
|
|||||||
*/
|
*/
|
||||||
public void populateDSMetadata(final DistributionSet distributionSet) {
|
public void populateDSMetadata(final DistributionSet distributionSet) {
|
||||||
removeAllItems();
|
removeAllItems();
|
||||||
List<DistributionSetMetadata> dsMetadtaList = new ArrayList<>();
|
final List<DistributionSetMetadata> dsMetadtaList = new ArrayList<>();
|
||||||
for(int i=1;i<=5;i++){
|
for (int i = 1; i <= 5; i++) {
|
||||||
DistributionSetMetadata dsMetadata = new DistributionSetMetadata();
|
final DistributionSetMetadata dsMetadata = new DistributionSetMetadata();
|
||||||
dsMetadata.setKey("ReleaseNote AAA" +i);
|
dsMetadata.setKey("ReleaseNote AAA" + i);
|
||||||
dsMetadata.setValue("ReleaseNote AAA sample data"+i);
|
dsMetadata.setValue("ReleaseNote AAA sample data" + i);
|
||||||
dsMetadtaList.add(dsMetadata);
|
dsMetadtaList.add(dsMetadata);
|
||||||
}
|
}
|
||||||
if (null != distributionSet) {
|
if (null != distributionSet) {
|
||||||
/* final List<DistributionSetMetadata> dsMetadataList = distributionSet.getMetadata();*/
|
/*
|
||||||
|
* final List<DistributionSetMetadata> dsMetadataList =
|
||||||
|
* distributionSet.getMetadata();
|
||||||
|
*/
|
||||||
final List<DistributionSetMetadata> dsMetadataList = dsMetadtaList;
|
final List<DistributionSetMetadata> dsMetadataList = dsMetadtaList;
|
||||||
if (null != dsMetadataList && !dsMetadataList.isEmpty()) {
|
if (null != dsMetadataList && !dsMetadataList.isEmpty()) {
|
||||||
dsMetadataList.forEach(dsMetadata -> setDSMetadataProperties(dsMetadata));
|
dsMetadataList.forEach(dsMetadata -> setDSMetadataProperties(dsMetadata));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDSMetadataProperties(final DistributionSetMetadata dsMetadata){
|
private void setDSMetadataProperties(final DistributionSetMetadata dsMetadata) {
|
||||||
final Item item = getContainerDataSource().addItem(dsMetadata.getKey());
|
final Item item = getContainerDataSource().addItem(dsMetadata.getKey());
|
||||||
item.getItemProperty(METADATA_KEY).setValue(dsMetadata.getKey());
|
item.getItemProperty(METADATA_KEY).setValue(dsMetadata.getKey());
|
||||||
if (permissionChecker.hasUpdateDistributionPermission()) {
|
if (permissionChecker.hasUpdateDistributionPermission()) {
|
||||||
item.getItemProperty(VIEW).setValue(HawkbitCommonUtil.getFormatedLabel("View"));
|
item.getItemProperty(VIEW).setValue(HawkbitCommonUtil.getFormatedLabel("View"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addCustomGeneratedColumns() {
|
protected void addCustomGeneratedColumns() {
|
||||||
addGeneratedColumn(VIEW,
|
addGeneratedColumn(VIEW, (source, itemId, columnId) -> customMetadataDetailButton((String) itemId));
|
||||||
(source, itemId, columnId) -> customMetadataDetailButton((String) itemId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Button customMetadataDetailButton(final String itemId) {
|
private Button customMetadataDetailButton(final String itemId) {
|
||||||
@@ -137,12 +146,11 @@ public class DistributionSetMetadatadetailslayout extends Table{
|
|||||||
"View DistributionSet Metadata details", null, false, null, SPUIButtonStyleSmallNoBorder.class);
|
"View DistributionSet Metadata details", null, false, null, SPUIButtonStyleSmallNoBorder.class);
|
||||||
viewIcon.setData(metadataKey);
|
viewIcon.setData(metadataKey);
|
||||||
viewIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
|
viewIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
|
||||||
//viewIcon.addClickListener(event -> onClickOfDetailButton(event));
|
// viewIcon.addClickListener(event -> onClickOfDetailButton(event));
|
||||||
return viewIcon;
|
return viewIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getDetailLinkId(final String name) {
|
private static String getDetailLinkId(final String name) {
|
||||||
return new StringBuilder(SPUIComponetIdProvider.DS_METADATA_DETAIL_LINK).append('.').append(name)
|
return new StringBuilder(SPUIComponetIdProvider.DS_METADATA_DETAIL_LINK).append('.').append(name).toString();
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
package org.eclipse.hawkbit.ui.common.detailslayout;
|
package org.eclipse.hawkbit.ui.common.detailslayout;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
|
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
|
import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
@@ -22,8 +28,6 @@ import com.vaadin.data.util.IndexedContainer;
|
|||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
import com.vaadin.ui.Table;
|
import com.vaadin.ui.Table;
|
||||||
import com.vaadin.ui.Table.Align;
|
|
||||||
import com.vaadin.ui.Table.ColumnHeaderMode;
|
|
||||||
import com.vaadin.ui.themes.ValoTheme;
|
import com.vaadin.ui.themes.ValoTheme;
|
||||||
|
|
||||||
public class SoftwareModuleMetadatadetailslayout extends Table {
|
public class SoftwareModuleMetadatadetailslayout extends Table {
|
||||||
@@ -33,14 +37,14 @@ public class SoftwareModuleMetadatadetailslayout extends Table {
|
|||||||
private static final Logger LOG = LoggerFactory.getLogger(SoftwareModuleMetadatadetailslayout.class);
|
private static final Logger LOG = LoggerFactory.getLogger(SoftwareModuleMetadatadetailslayout.class);
|
||||||
|
|
||||||
private static final String METADATA_KEY = "Key";
|
private static final String METADATA_KEY = "Key";
|
||||||
|
|
||||||
private static final String VIEW ="view";
|
private static final String VIEW = "view";
|
||||||
|
|
||||||
private SpPermissionChecker permissionChecker;
|
private SpPermissionChecker permissionChecker;
|
||||||
|
|
||||||
private I18N i18n;
|
private I18N i18n;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize software module table- to be displayed in details layout.
|
* Initialize software module table- to be displayed in details layout.
|
||||||
*
|
*
|
||||||
* @param i18n
|
* @param i18n
|
||||||
@@ -81,7 +85,7 @@ public class SoftwareModuleMetadatadetailslayout extends Table {
|
|||||||
container.addContainerProperty(METADATA_KEY, String.class, "");
|
container.addContainerProperty(METADATA_KEY, String.class, "");
|
||||||
setColumnExpandRatio(METADATA_KEY, 0.7f);
|
setColumnExpandRatio(METADATA_KEY, 0.7f);
|
||||||
setColumnAlignment(METADATA_KEY, Align.LEFT);
|
setColumnAlignment(METADATA_KEY, Align.LEFT);
|
||||||
|
|
||||||
if (permissionChecker.hasUpdateDistributionPermission()) {
|
if (permissionChecker.hasUpdateDistributionPermission()) {
|
||||||
container.addContainerProperty(VIEW, Label.class, "");
|
container.addContainerProperty(VIEW, Label.class, "");
|
||||||
setColumnExpandRatio(VIEW, 0.2F);
|
setColumnExpandRatio(VIEW, 0.2F);
|
||||||
@@ -101,35 +105,37 @@ public class SoftwareModuleMetadatadetailslayout extends Table {
|
|||||||
*/
|
*/
|
||||||
public void populateSMMetadata(final SoftwareModule swModule) {
|
public void populateSMMetadata(final SoftwareModule swModule) {
|
||||||
removeAllItems();
|
removeAllItems();
|
||||||
List<SoftwareModuleMetadata> swMetadtaList = new ArrayList<>();
|
final List<SoftwareModuleMetadata> swMetadtaList = new ArrayList<>();
|
||||||
for(int i=1;i<=5;i++){
|
for (int i = 1; i <= 5; i++) {
|
||||||
SoftwareModuleMetadata swMetadata = new SoftwareModuleMetadata();
|
final SoftwareModuleMetadata swMetadata = new SoftwareModuleMetadata();
|
||||||
swMetadata.setKey("ReleaseNote BBB" +i);
|
swMetadata.setKey("ReleaseNote BBB" + i);
|
||||||
swMetadata.setValue("ReleaseNote BBB sample data"+i);
|
swMetadata.setValue("ReleaseNote BBB sample data" + i);
|
||||||
swMetadtaList.add(swMetadata);
|
swMetadtaList.add(swMetadata);
|
||||||
}
|
}
|
||||||
if (null != swModule) {
|
if (null != swModule) {
|
||||||
/*final List<SoftwareModuleMetadata> swMetadataList = swModule.getMetadata();*/
|
/*
|
||||||
|
* final List<SoftwareModuleMetadata> swMetadataList =
|
||||||
|
* swModule.getMetadata();
|
||||||
|
*/
|
||||||
final List<SoftwareModuleMetadata> swMetadataList = swMetadtaList;
|
final List<SoftwareModuleMetadata> swMetadataList = swMetadtaList;
|
||||||
if (null != swMetadataList && !swMetadataList.isEmpty()) {
|
if (null != swMetadataList && !swMetadataList.isEmpty()) {
|
||||||
swMetadataList.forEach(swMetadata -> setSWMetadataProperties(swMetadata));
|
swMetadataList.forEach(swMetadata -> setSWMetadataProperties(swMetadata));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSWMetadataProperties(final SoftwareModuleMetadata swMetadata){
|
private void setSWMetadataProperties(final SoftwareModuleMetadata swMetadata) {
|
||||||
final Item item = getContainerDataSource().addItem(swMetadata.getKey());
|
final Item item = getContainerDataSource().addItem(swMetadata.getKey());
|
||||||
item.getItemProperty(METADATA_KEY).setValue(swMetadata.getKey());
|
item.getItemProperty(METADATA_KEY).setValue(swMetadata.getKey());
|
||||||
if (permissionChecker.hasUpdateDistributionPermission()) {
|
if (permissionChecker.hasUpdateDistributionPermission()) {
|
||||||
item.getItemProperty(VIEW).setValue(HawkbitCommonUtil.getFormatedLabel("View"));
|
item.getItemProperty(VIEW).setValue(HawkbitCommonUtil.getFormatedLabel("View"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addCustomGeneratedColumns() {
|
protected void addCustomGeneratedColumns() {
|
||||||
addGeneratedColumn(VIEW,
|
addGeneratedColumn(VIEW, (source, itemId, columnId) -> customMetadataDetailButton((String) itemId));
|
||||||
(source, itemId, columnId) -> customMetadataDetailButton((String) itemId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Button customMetadataDetailButton(final String itemId) {
|
private Button customMetadataDetailButton(final String itemId) {
|
||||||
@@ -140,12 +146,11 @@ public class SoftwareModuleMetadatadetailslayout extends Table {
|
|||||||
"View Software Module Metadata details", null, false, null, SPUIButtonStyleSmallNoBorder.class);
|
"View Software Module Metadata details", null, false, null, SPUIButtonStyleSmallNoBorder.class);
|
||||||
viewIcon.setData(metadataKey);
|
viewIcon.setData(metadataKey);
|
||||||
viewIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
|
viewIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
|
||||||
//viewIcon.addClickListener(event -> onClickOfDetailButton(event));
|
// viewIcon.addClickListener(event -> onClickOfDetailButton(event));
|
||||||
return viewIcon;
|
return viewIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getDetailLinkId(final String name) {
|
private static String getDetailLinkId(final String name) {
|
||||||
return new StringBuilder(SPUIComponetIdProvider.SW_METADATA_DETAIL_LINK).append('.').append(name)
|
return new StringBuilder(SPUIComponetIdProvider.SW_METADATA_DETAIL_LINK).append('.').append(name).toString();
|
||||||
.toString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
package org.eclipse.hawkbit.ui.layouts;
|
package org.eclipse.hawkbit.ui.layouts;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||||
|
|||||||
Reference in New Issue
Block a user