add license text

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Melanie Retter
2016-05-30 18:08:52 +02:00
parent f1533a7f1e
commit 2dfda701b5
7 changed files with 109 additions and 56 deletions

View File

@@ -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;
import com.vaadin.shared.ui.colorpicker.Color;

View File

@@ -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;
import org.eclipse.hawkbit.ui.management.tag.SpColorPickerPreview;

View File

@@ -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;
import java.util.HashSet;

View File

@@ -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;
import org.apache.commons.lang3.StringUtils;

View File

@@ -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;
import java.util.ArrayList;
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.ui.components.SPUIComponentProvider;
@@ -14,7 +22,6 @@ import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.vaadin.spring.events.EventBus.SessionEventBus;
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
@@ -23,21 +30,21 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
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 Logger LOG = LoggerFactory.getLogger(DistributionSetMetadatadetailslayout.class);
private static final String METADATA_KEY = "Key";
private static final String VIEW ="view";
private static final String VIEW = "view";
private SpPermissionChecker permissionChecker;
private I18N i18n;
/**
/**
* Initialize software module table- to be displayed in details layout.
*
* @param i18n
@@ -78,7 +85,7 @@ public class DistributionSetMetadatadetailslayout extends Table{
container.addContainerProperty(METADATA_KEY, String.class, "");
setColumnExpandRatio(METADATA_KEY, 0.7f);
setColumnAlignment(METADATA_KEY, Align.LEFT);
if (permissionChecker.hasUpdateDistributionPermission()) {
container.addContainerProperty(VIEW, Label.class, "");
setColumnExpandRatio(VIEW, 0.2F);
@@ -98,35 +105,37 @@ public class DistributionSetMetadatadetailslayout extends Table{
*/
public void populateDSMetadata(final DistributionSet distributionSet) {
removeAllItems();
List<DistributionSetMetadata> dsMetadtaList = new ArrayList<>();
for(int i=1;i<=5;i++){
DistributionSetMetadata dsMetadata = new DistributionSetMetadata();
dsMetadata.setKey("ReleaseNote AAA" +i);
dsMetadata.setValue("ReleaseNote AAA sample data"+i);
final List<DistributionSetMetadata> dsMetadtaList = new ArrayList<>();
for (int i = 1; i <= 5; i++) {
final DistributionSetMetadata dsMetadata = new DistributionSetMetadata();
dsMetadata.setKey("ReleaseNote AAA" + i);
dsMetadata.setValue("ReleaseNote AAA sample data" + i);
dsMetadtaList.add(dsMetadata);
}
if (null != distributionSet) {
/* final List<DistributionSetMetadata> dsMetadataList = distributionSet.getMetadata();*/
}
if (null != distributionSet) {
/*
* final List<DistributionSetMetadata> dsMetadataList =
* distributionSet.getMetadata();
*/
final List<DistributionSetMetadata> dsMetadataList = dsMetadtaList;
if (null != dsMetadataList && !dsMetadataList.isEmpty()) {
dsMetadataList.forEach(dsMetadata -> setDSMetadataProperties(dsMetadata));
}
}
}
}
private void setDSMetadataProperties(final DistributionSetMetadata dsMetadata){
private void setDSMetadataProperties(final DistributionSetMetadata dsMetadata) {
final Item item = getContainerDataSource().addItem(dsMetadata.getKey());
item.getItemProperty(METADATA_KEY).setValue(dsMetadata.getKey());
if (permissionChecker.hasUpdateDistributionPermission()) {
item.getItemProperty(VIEW).setValue(HawkbitCommonUtil.getFormatedLabel("View"));
}
}
protected void addCustomGeneratedColumns() {
addGeneratedColumn(VIEW,
(source, itemId, columnId) -> customMetadataDetailButton((String) itemId));
protected void addCustomGeneratedColumns() {
addGeneratedColumn(VIEW, (source, itemId, columnId) -> customMetadataDetailButton((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);
viewIcon.setData(metadataKey);
viewIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
//viewIcon.addClickListener(event -> onClickOfDetailButton(event));
// viewIcon.addClickListener(event -> onClickOfDetailButton(event));
return viewIcon;
}
private static String getDetailLinkId(final String name) {
return new StringBuilder(SPUIComponetIdProvider.DS_METADATA_DETAIL_LINK).append('.').append(name)
.toString();
return new StringBuilder(SPUIComponetIdProvider.DS_METADATA_DETAIL_LINK).append('.').append(name).toString();
}
}

View File

@@ -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;
import java.util.ArrayList;
import java.util.List;
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.SoftwareModuleMetadata;
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.Label;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.Align;
import com.vaadin.ui.Table.ColumnHeaderMode;
import com.vaadin.ui.themes.ValoTheme;
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 String METADATA_KEY = "Key";
private static final String VIEW ="view";
private static final String VIEW = "view";
private SpPermissionChecker permissionChecker;
private I18N i18n;
/**
/**
* Initialize software module table- to be displayed in details layout.
*
* @param i18n
@@ -81,7 +85,7 @@ public class SoftwareModuleMetadatadetailslayout extends Table {
container.addContainerProperty(METADATA_KEY, String.class, "");
setColumnExpandRatio(METADATA_KEY, 0.7f);
setColumnAlignment(METADATA_KEY, Align.LEFT);
if (permissionChecker.hasUpdateDistributionPermission()) {
container.addContainerProperty(VIEW, Label.class, "");
setColumnExpandRatio(VIEW, 0.2F);
@@ -101,35 +105,37 @@ public class SoftwareModuleMetadatadetailslayout extends Table {
*/
public void populateSMMetadata(final SoftwareModule swModule) {
removeAllItems();
List<SoftwareModuleMetadata> swMetadtaList = new ArrayList<>();
for(int i=1;i<=5;i++){
SoftwareModuleMetadata swMetadata = new SoftwareModuleMetadata();
swMetadata.setKey("ReleaseNote BBB" +i);
swMetadata.setValue("ReleaseNote BBB sample data"+i);
final List<SoftwareModuleMetadata> swMetadtaList = new ArrayList<>();
for (int i = 1; i <= 5; i++) {
final SoftwareModuleMetadata swMetadata = new SoftwareModuleMetadata();
swMetadata.setKey("ReleaseNote BBB" + i);
swMetadata.setValue("ReleaseNote BBB sample data" + i);
swMetadtaList.add(swMetadata);
}
if (null != swModule) {
/*final List<SoftwareModuleMetadata> swMetadataList = swModule.getMetadata();*/
}
if (null != swModule) {
/*
* final List<SoftwareModuleMetadata> swMetadataList =
* swModule.getMetadata();
*/
final List<SoftwareModuleMetadata> swMetadataList = swMetadtaList;
if (null != swMetadataList && !swMetadataList.isEmpty()) {
swMetadataList.forEach(swMetadata -> setSWMetadataProperties(swMetadata));
}
}
}
}
private void setSWMetadataProperties(final SoftwareModuleMetadata swMetadata){
private void setSWMetadataProperties(final SoftwareModuleMetadata swMetadata) {
final Item item = getContainerDataSource().addItem(swMetadata.getKey());
item.getItemProperty(METADATA_KEY).setValue(swMetadata.getKey());
if (permissionChecker.hasUpdateDistributionPermission()) {
item.getItemProperty(VIEW).setValue(HawkbitCommonUtil.getFormatedLabel("View"));
}
}
protected void addCustomGeneratedColumns() {
addGeneratedColumn(VIEW,
(source, itemId, columnId) -> customMetadataDetailButton((String) itemId));
protected void addCustomGeneratedColumns() {
addGeneratedColumn(VIEW, (source, itemId, columnId) -> customMetadataDetailButton((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);
viewIcon.setData(metadataKey);
viewIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
//viewIcon.addClickListener(event -> onClickOfDetailButton(event));
// viewIcon.addClickListener(event -> onClickOfDetailButton(event));
return viewIcon;
}
private static String getDetailLinkId(final String name) {
return new StringBuilder(SPUIComponetIdProvider.SW_METADATA_DETAIL_LINK).append('.').append(name)
.toString();
return new StringBuilder(SPUIComponetIdProvider.SW_METADATA_DETAIL_LINK).append('.').append(name).toString();
}
}

View File

@@ -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;
import org.eclipse.hawkbit.repository.model.DistributionSetType;