Removed i18n class that was based on Vaadin4Spring utility. (#455)

* Removed i18n class that was based on Vaadin4Spring utility.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
Kai Zimmermann
2017-03-13 09:32:59 +01:00
committed by GitHub
parent cf2dff4c84
commit 809fe4a8b6
136 changed files with 1069 additions and 1104 deletions

View File

@@ -10,7 +10,7 @@ package org.eclipse.hawkbit.ui;
import org.eclipse.hawkbit.ui.menu.DashboardMenu;
import org.eclipse.hawkbit.ui.menu.DashboardMenuItem;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.springframework.beans.factory.annotation.Autowired;
@@ -40,12 +40,12 @@ class ErrorView extends VerticalLayout implements View {
private final Label message;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final DashboardMenu dashboardMenu;
@Autowired
ErrorView(final I18N i18n, final DashboardMenu dashboardMenu) {
ErrorView(final VaadinMessageSource i18n, final DashboardMenu dashboardMenu) {
this.i18n = i18n;
this.dashboardMenu = dashboardMenu;
setMargin(true);
@@ -57,17 +57,17 @@ class ErrorView extends VerticalLayout implements View {
public void enter(final ViewChangeListener.ViewChangeEvent event) {
final DashboardMenuItem view = dashboardMenu.getByViewName(event.getViewName());
if (view == null) {
message.setValue(i18n.get("message.error.view", new Object[] { event.getViewName() }));
message.setValue(i18n.getMessage("message.error.view", new Object[] { event.getViewName() }));
return;
}
if (dashboardMenu.isAccessDenied(event.getViewName())) {
final Notification nt = new Notification("Access denied",
i18n.get("message.accessdenied.view", new Object[] { event.getViewName() }), Type.ERROR_MESSAGE,
i18n.getMessage("message.accessdenied.view", new Object[] { event.getViewName() }), Type.ERROR_MESSAGE,
false);
nt.setStyleName(SPUILabelDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE);
nt.setPosition(Position.BOTTOM_RIGHT);
nt.show(UI.getCurrent().getPage());
message.setValue(i18n.get("message.accessdenied.view", new Object[] { event.getViewName() }));
message.setValue(i18n.getMessage("message.accessdenied.view", new Object[] { event.getViewName() }));
}
}

View File

@@ -21,7 +21,7 @@ import org.eclipse.hawkbit.ui.menu.DashboardEvent.PostViewChangeEvent;
import org.eclipse.hawkbit.ui.menu.DashboardMenu;
import org.eclipse.hawkbit.ui.menu.DashboardMenuItem;
import org.eclipse.hawkbit.ui.push.EventPushStrategy;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
import org.slf4j.Logger;
@@ -75,9 +75,6 @@ public class HawkbitUI extends DefaultHawkbitUI implements DetachListener {
@Autowired
private transient ApplicationContext context;
@Autowired
private I18N i18n;
@Autowired
private DashboardMenu dashboardMenu;
@@ -200,7 +197,7 @@ public class HawkbitUI extends DefaultHawkbitUI implements DetachListener {
UI.getCurrent().setErrorHandler(new HawkbitUIErrorHandler());
}
LOG.info("Current locale of the application is : {}", i18n.getLocale());
LOG.info("Current locale of the application is : {}", HawkbitCommonUtil.getLocale());
}
private Component buildHeader() {

View File

@@ -9,8 +9,10 @@
package org.eclipse.hawkbit.ui;
import org.eclipse.hawkbit.im.authentication.PermissionService;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@@ -26,15 +28,16 @@ import org.springframework.context.annotation.Import;
@EnableConfigurationProperties(UiProperties.class)
public class MgmtUiConfiguration {
/**
* @param permissionService
* to use in the checker
* @return {@link SpPermissionChecker} bean
*/
@Bean
@ConditionalOnMissingBean
public SpPermissionChecker spPermissionChecker(final PermissionService permissionService) {
SpPermissionChecker spPermissionChecker(final PermissionService permissionService) {
return new SpPermissionChecker(permissionService);
}
@Bean
@ConditionalOnMissingBean
VaadinMessageSource messageSourceVaadin(final MessageSource source) {
return new VaadinMessageSource(source);
}
}

View File

@@ -28,7 +28,7 @@ import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
import org.eclipse.hawkbit.ui.artifacts.upload.UploadLayout;
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
import org.eclipse.hawkbit.ui.dd.criteria.UploadViewClientCriterion;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.springframework.beans.factory.annotation.Autowired;
@@ -64,7 +64,7 @@ public class UploadArtifactView extends VerticalLayout implements View, BrowserW
private final SpPermissionChecker permChecker;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final UINotification uiNotification;
@@ -88,7 +88,7 @@ public class UploadArtifactView extends VerticalLayout implements View, BrowserW
private DragAndDropWrapper dadw;
@Autowired
UploadArtifactView(final UIEventBus eventBus, final SpPermissionChecker permChecker, final I18N i18n,
UploadArtifactView(final UIEventBus eventBus, final SpPermissionChecker permChecker, final VaadinMessageSource i18n,
final UINotification uiNotification, final ArtifactUploadState artifactUploadState,
final TagManagement tagManagement, final EntityFactory entityFactory,
final SoftwareManagement softwareManagement, final UploadViewClientCriterion uploadViewClientCriterion,
@@ -256,7 +256,7 @@ public class UploadArtifactView extends VerticalLayout implements View, BrowserW
private void checkNoDataAvaialble() {
if (artifactUploadState.isNoDataAvilableSoftwareModule()) {
uiNotification.displayValidationError(i18n.get("message.no.data"));
uiNotification.displayValidationError(i18n.getMessage("message.no.data"));
}
}

View File

@@ -27,7 +27,7 @@ import org.eclipse.hawkbit.ui.components.SPUIButton;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
@@ -80,7 +80,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private static final String MD5HASH = "md5Hash";
private final I18N i18n;
private final VaadinMessageSource i18n;
private final transient EventBus.UIEventBus eventBus;
@@ -102,7 +102,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private final transient ArtifactManagement artifactManagement;
public ArtifactDetailsLayout(final I18N i18n, final UIEventBus eventBus,
public ArtifactDetailsLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
final ArtifactUploadState artifactUploadState, final UINotification uINotification,
final ArtifactManagement artifactManagement) {
this.i18n = i18n;
@@ -251,12 +251,12 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private void confirmAndDeleteArtifact(final Long id, final String fileName) {
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.delete.artifact.confirmbox"),
i18n.get("message.delete.artifact", new Object[] { fileName }), i18n.get("button.ok"),
i18n.get("button.cancel"), ok -> {
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.getMessage("caption.delete.artifact.confirmbox"),
i18n.getMessage("message.delete.artifact", new Object[] { fileName }), i18n.getMessage("button.ok"),
i18n.getMessage("button.cancel"), ok -> {
if (ok) {
artifactManagement.deleteArtifact(id);
uINotification.displaySuccess(i18n.get("message.artifact.deleted", fileName));
uINotification.displaySuccess(i18n.getMessage("message.artifact.deleted", fileName));
if (artifactUploadState.getSelectedBaseSwModuleId().isPresent()) {
populateArtifactDetails(artifactUploadState.getSelectedBaseSwModuleId().get(),
HawkbitCommonUtil.getFormattedNameVersion(
@@ -274,15 +274,15 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private void setTableColumnDetails(final Table table) {
table.setColumnHeader(PROVIDED_FILE_NAME, i18n.get("upload.file.name"));
table.setColumnHeader(SIZE, i18n.get("upload.size"));
table.setColumnHeader(PROVIDED_FILE_NAME, i18n.getMessage("upload.file.name"));
table.setColumnHeader(SIZE, i18n.getMessage("upload.size"));
if (fullWindowMode) {
table.setColumnHeader(SHA1HASH, i18n.get("upload.sha1"));
table.setColumnHeader(MD5HASH, i18n.get("upload.md5"));
table.setColumnHeader(SHA1HASH, i18n.getMessage("upload.sha1"));
table.setColumnHeader(MD5HASH, i18n.getMessage("upload.md5"));
}
table.setColumnHeader(CREATE_MODIFIED_DATE_UPLOAD, i18n.get("upload.last.modified.date"));
table.setColumnHeader(CREATE_MODIFIED_DATE_UPLOAD, i18n.getMessage("upload.last.modified.date"));
if (!readOnly) {
table.setColumnHeader(ACTION, i18n.get("upload.action"));
table.setColumnHeader(ACTION, i18n.getMessage("upload.action"));
}
table.setColumnExpandRatio(PROVIDED_FILE_NAME, 3.5F);

View File

@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
import org.eclipse.hawkbit.ui.common.footer.AbstractDeleteActionsLayout;
import org.eclipse.hawkbit.ui.common.table.AbstractTable;
import org.eclipse.hawkbit.ui.dd.criteria.UploadViewClientCriterion;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -45,7 +45,7 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
private final UploadViewClientCriterion uploadViewClientCriterion;
public SMDeleteActionsLayout(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
public SMDeleteActionsLayout(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
final UINotification notification, final ArtifactUploadState artifactUploadState,
final SoftwareManagement softwareManagement, final UploadViewClientCriterion uploadViewClientCriterion) {
super(i18n, permChecker, eventBus, notification);
@@ -104,7 +104,7 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
@Override
protected String getDeleteAreaLabel() {
return i18n.get("label.software.module.drop.area");
return i18n.getMessage("label.software.module.drop.area");
}
@Override
@@ -132,7 +132,7 @@ public class SMDeleteActionsLayout extends AbstractDeleteActionsLayout {
if (artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
.map(type -> type.getName().equalsIgnoreCase(swModuleTypeName)).orElse(false)) {
notification.displayValidationError(
i18n.get("message.swmodule.type.check.delete", new Object[] { swModuleTypeName }));
i18n.getMessage("message.swmodule.type.check.delete", new Object[] { swModuleTypeName }));
} else {
deleteSWModuleType(swModuleTypeName);
updateSWActionCount();

View File

@@ -21,7 +21,7 @@ import org.eclipse.hawkbit.ui.artifacts.state.CustomFile;
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.AbstractConfirmationWindowLayout;
import org.eclipse.hawkbit.ui.common.confirmwindow.layout.ConfirmationTab;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -55,7 +55,7 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
private final ArtifactUploadState artifactUploadState;
UploadViewConfirmationWindowLayout(final I18N i18n, final UIEventBus eventBus,
UploadViewConfirmationWindowLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
final SoftwareManagement softwareManagement, final ArtifactUploadState artifactUploadState) {
super(i18n, eventBus);
this.softwareManagement = softwareManagement;
@@ -66,10 +66,10 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
protected Map<String, ConfirmationTab> getConfimrationTabs() {
final Map<String, ConfirmationTab> tabs = Maps.newHashMapWithExpectedSize(2);
if (!artifactUploadState.getDeleteSofwareModules().isEmpty()) {
tabs.put(i18n.get("caption.delete.swmodule.accordion.tab"), createSMDeleteConfirmationTab());
tabs.put(i18n.getMessage("caption.delete.swmodule.accordion.tab"), createSMDeleteConfirmationTab());
}
if (!artifactUploadState.getSelectedDeleteSWModuleTypes().isEmpty()) {
tabs.put(i18n.get("caption.delete.sw.module.type.accordion.tab"), createSMtypeDeleteConfirmationTab());
tabs.put(i18n.getMessage("caption.delete.sw.module.type.accordion.tab"), createSMtypeDeleteConfirmationTab());
}
return tabs;
}
@@ -79,10 +79,10 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
tab.getConfirmAll().setId(UIComponentIdProvider.SW_DELETE_ALL);
tab.getConfirmAll().setIcon(FontAwesome.TRASH_O);
tab.getConfirmAll().setCaption(i18n.get("button.delete.all"));
tab.getConfirmAll().setCaption(i18n.getMessage("button.delete.all"));
tab.getConfirmAll().addClickListener(event -> deleteSMAll(tab));
tab.getDiscardAll().setCaption(i18n.get("button.discard.all"));
tab.getDiscardAll().setCaption(i18n.getMessage("button.discard.all"));
tab.getDiscardAll().addClickListener(event -> discardSMAll(tab));
// Add items container to the table.
@@ -95,8 +95,8 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
});
tab.getTable().setVisibleColumns(SW_MODULE_NAME_MSG, SW_DISCARD_CHGS);
tab.getTable().setColumnHeaders(i18n.get("upload.swModuleTable.header"),
i18n.get("header.second.deletetarget.table"));
tab.getTable().setColumnHeaders(i18n.getMessage("upload.swModuleTable.header"),
i18n.getMessage("header.second.deletetarget.table"));
tab.getTable().setColumnExpandRatio(SW_MODULE_NAME_MSG, SPUIDefinitions.TARGET_DISTRIBUTION_COLUMN_WIDTH);
tab.getTable().setColumnExpandRatio(SW_DISCARD_CHGS, SPUIDefinitions.DISCARD_COLUMN_WIDTH);
@@ -145,7 +145,7 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
final Set<Long> swmoduleIds = artifactUploadState.getDeleteSofwareModules().keySet();
softwareManagement.deleteSoftwareModules(swmoduleIds);
addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.swModule.deleted", artifactUploadState.getDeleteSofwareModules().size()));
+ i18n.getMessage("message.swModule.deleted", artifactUploadState.getDeleteSofwareModules().size()));
/*
* Check if any information / files pending to upload for the deleted
* software modules. If so, then delete the files from the upload list.
@@ -167,14 +167,14 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
}
artifactUploadState.getDeleteSofwareModules().clear();
removeCurrentTab(tab);
setActionMessage(i18n.get("message.software.delete.success"));
setActionMessage(i18n.getMessage("message.software.delete.success"));
eventBus.publish(this, UploadArtifactUIEvent.DELETED_ALL_SOFWARE);
}
private void discardSMAll(final ConfirmationTab tab) {
removeCurrentTab(tab);
artifactUploadState.getDeleteSofwareModules().clear();
setActionMessage(i18n.get("message.software.discard.success"));
setActionMessage(i18n.getMessage("message.software.discard.success"));
eventBus.publish(this, UploadArtifactUIEvent.DISCARD_ALL_DELETE_SOFTWARE);
}
@@ -183,10 +183,10 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
tab.getConfirmAll().setId(UIComponentIdProvider.SAVE_DELETE_SW_MODULE_TYPE);
tab.getConfirmAll().setIcon(FontAwesome.TRASH_O);
tab.getConfirmAll().setCaption(i18n.get("button.delete.all"));
tab.getConfirmAll().setCaption(i18n.getMessage("button.delete.all"));
tab.getConfirmAll().addClickListener(event -> deleteSMtypeAll(tab));
tab.getDiscardAll().setCaption(i18n.get("button.discard.all"));
tab.getDiscardAll().setCaption(i18n.getMessage("button.discard.all"));
tab.getDiscardAll().addClickListener(event -> discardSMtypeAll(tab));
// Add items container to the table.
@@ -200,8 +200,8 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
});
tab.getTable().setVisibleColumns(SW_MODULE_TYPE_NAME, DISCARD);
tab.getTable().setColumnHeaders(i18n.get("header.first.delete.swmodule.type.table"),
i18n.get("header.second.delete.swmodule.type.table"));
tab.getTable().setColumnHeaders(i18n.getMessage("header.first.delete.swmodule.type.table"),
i18n.getMessage("header.second.delete.swmodule.type.table"));
tab.getTable().setColumnExpandRatio(SW_MODULE_TYPE_NAME, 2);
tab.getTable().setColumnExpandRatio(SW_DISCARD_CHGS, SPUIDefinitions.DISCARD_COLUMN_WIDTH);
@@ -243,17 +243,17 @@ public class UploadViewConfirmationWindowLayout extends AbstractConfirmationWind
.ifPresent(softwareManagement::deleteSoftwareModuleType);
}
addToConsolitatedMsg(FontAwesome.TASKS.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.sw.module.type.delete", new Object[] { deleteSWModuleTypeCount }));
+ i18n.getMessage("message.sw.module.type.delete", new Object[] { deleteSWModuleTypeCount }));
artifactUploadState.getSelectedDeleteSWModuleTypes().clear();
removeCurrentTab(tab);
setActionMessage(i18n.get("message.software.type.delete.success"));
setActionMessage(i18n.getMessage("message.software.type.delete.success"));
eventBus.publish(this, UploadArtifactUIEvent.DELETED_ALL_SOFWARE_TYPE);
}
private void discardSMtypeAll(final ConfirmationTab tab) {
removeCurrentTab(tab);
artifactUploadState.getSelectedDeleteSWModuleTypes().clear();
setActionMessage(i18n.get("message.software.type.discard.success"));
setActionMessage(i18n.getMessage("message.software.type.discard.success"));
eventBus.publish(this, UploadArtifactUIEvent.DISCARD_ALL_DELETE_SOFTWARE_TYPE);
}
}

View File

@@ -27,7 +27,7 @@ import org.eclipse.hawkbit.ui.common.builder.WindowBuilder;
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -51,7 +51,7 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
private static final long serialVersionUID = -5217675246477211483L;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final UINotification uiNotifcation;
@@ -91,7 +91,7 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
* @param entityFactory
* EntityFactory
*/
public SoftwareModuleAddUpdateWindow(final I18N i18n, final UINotification uiNotifcation, final UIEventBus eventBus,
public SoftwareModuleAddUpdateWindow(final VaadinMessageSource i18n, final UINotification uiNotifcation, final UIEventBus eventBus,
final SoftwareManagement softwareManagement, final EntityFactory entityFactory) {
this.i18n = i18n;
this.uiNotifcation = uiNotifcation;
@@ -136,7 +136,7 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
if (newSoftwareModule != null) {
eventBus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.ADD_ENTITY, newSoftwareModule));
uiNotifcation.displaySuccess(i18n.get("message.save.success",
uiNotifcation.displaySuccess(i18n.getMessage("message.save.success",
new Object[] { newSoftwareModule.getName() + ":" + newSoftwareModule.getVersion() }));
}
}
@@ -151,7 +151,7 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
if (moduleType.isPresent() && softwareManagement
.findSoftwareModuleByNameAndVersion(name, version, moduleType.get()).isPresent()) {
uiNotifcation.displayValidationError(
i18n.get("message.duplicate.softwaremodule", new Object[] { name, version }));
i18n.getMessage("message.duplicate.softwaremodule", new Object[] { name, version }));
return true;
}
return false;
@@ -164,7 +164,7 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
final SoftwareModule newSWModule = softwareManagement.updateSoftwareModule(entityFactory.softwareModule()
.update(baseSwModuleId).description(descTextArea.getValue()).vendor(vendorTextField.getValue()));
if (newSWModule != null) {
uiNotifcation.displaySuccess(i18n.get("message.save.success",
uiNotifcation.displaySuccess(i18n.getMessage("message.save.success",
new Object[] { newSWModule.getName() + ":" + newSWModule.getVersion() }));
eventBus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.UPDATED_ENTITY, newSWModule));
@@ -208,13 +208,13 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
vendorTextField.setRequired(false);
vendorTextField.setNullRepresentation(StringUtils.EMPTY);
descTextArea = new TextAreaBuilder().caption(i18n.get("textfield.description")).style("text-area-style")
.prompt(i18n.get("textfield.description")).id(UIComponentIdProvider.ADD_SW_MODULE_DESCRIPTION)
descTextArea = new TextAreaBuilder().caption(i18n.getMessage("textfield.description")).style("text-area-style")
.prompt(i18n.getMessage("textfield.description")).id(UIComponentIdProvider.ADD_SW_MODULE_DESCRIPTION)
.buildTextComponent();
descTextArea.setNullRepresentation(StringUtils.EMPTY);
typeComboBox = SPUIComponentProvider.getComboBox(i18n.get("upload.swmodule.type"), "", null, null, true, null,
i18n.get("upload.swmodule.type"));
typeComboBox = SPUIComponentProvider.getComboBox(i18n.getMessage("upload.swmodule.type"), "", null, null, true, null,
i18n.getMessage("upload.swmodule.type"));
typeComboBox.setId(UIComponentIdProvider.SW_MODULE_TYPE);
typeComboBox.setStyleName(SPUIDefinitions.COMBO_BOX_SPECIFIC_STYLE + " " + ValoTheme.COMBOBOX_TINY);
typeComboBox.setNewItemsAllowed(Boolean.FALSE);
@@ -222,7 +222,7 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
}
private TextField createTextField(final String in18Key, final String id) {
return new TextFieldBuilder().caption(i18n.get(in18Key)).required(true).prompt(i18n.get(in18Key))
return new TextFieldBuilder().caption(i18n.getMessage(in18Key)).required(true).prompt(i18n.getMessage(in18Key))
.immediate(true).id(id).buildTextComponent();
}
@@ -260,7 +260,7 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
setCompositionRoot(formLayout);
final CommonDialogWindow window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW)
.caption(i18n.get("upload.caption.add.new.swmodule")).content(this).layout(formLayout).i18n(i18n)
.caption(i18n.getMessage("upload.caption.add.new.swmodule")).content(this).layout(formLayout).i18n(i18n)
.saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow();
nameTextField.setEnabled(!editSwModule);
versionTextField.setEnabled(!editSwModule);

View File

@@ -22,7 +22,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent;
import org.eclipse.hawkbit.ui.distributions.smtable.SwMetadataPopupLayout;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -52,7 +52,7 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
private final SoftwareModuleMetadatadetailslayout swmMetadataTable;
SoftwareModuleDetails(final I18N i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
SoftwareModuleDetails(final VaadinMessageSource i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow,
final ArtifactUploadState artifactUploadState, final SoftwareManagement softwareManagement,
final SwMetadataPopupLayout swMetadataPopupLayout, final EntityFactory entityFactory) {
@@ -91,17 +91,17 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
@Override
protected void addTabs(final TabSheet detailsTab) {
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
detailsTab.addTab(swmMetadataTable, getI18n().get("caption.metadata"), null);
detailsTab.addTab(createDetailsLayout(), getI18n().getMessage("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().getMessage("caption.tab.description"), null);
detailsTab.addTab(createLogLayout(), getI18n().getMessage("caption.logs.tab"), null);
detailsTab.addTab(swmMetadataTable, getI18n().getMessage("caption.metadata"), null);
}
@Override
protected void onEdit(final ClickEvent event) {
final Window addSoftwareModule = softwareModuleAddUpdateWindow
.createUpdateSoftwareModuleWindow(getSelectedBaseEntityId());
addSoftwareModule.setCaption(getI18n().get("upload.caption.update.swmodule"));
addSoftwareModule.setCaption(getI18n().getMessage("upload.caption.update.swmodule"));
UI.getCurrent().addWindow(addSoftwareModule);
addSoftwareModule.setVisible(Boolean.TRUE);
}
@@ -111,9 +111,9 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
if (getSelectedBaseEntity() != null) {
String maxAssign;
if (getSelectedBaseEntity().getType().getMaxAssignments() == 1) {
maxAssign = getI18n().get("label.singleAssign.type");
maxAssign = getI18n().getMessage("label.singleAssign.type");
} else {
maxAssign = getI18n().get("label.multiAssign.type");
maxAssign = getI18n().getMessage("label.multiAssign.type");
}
updateSoftwareModuleDetailsLayout(getSelectedBaseEntity().getType().getName(),
getSelectedBaseEntity().getVendor(), maxAssign);
@@ -128,19 +128,19 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
detailsTabLayout.removeAllComponents();
final Label vendorLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.dist.details.vendor"),
final Label vendorLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.vendor"),
HawkbitCommonUtil.trimAndNullIfEmpty(vendor) == null ? "" : vendor);
vendorLabel.setId(UIComponentIdProvider.DETAILS_VENDOR_LABEL_ID);
detailsTabLayout.addComponent(vendorLabel);
if (type != null) {
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.dist.details.type"),
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.type"),
type);
typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
detailsTabLayout.addComponent(typeLabel);
}
final Label assignLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.assigned.type"),
final Label assignLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.assigned.type"),
HawkbitCommonUtil.trimAndNullIfEmpty(maxAssign) == null ? "" : maxAssign);
assignLabel.setId(UIComponentIdProvider.SWM_DTLS_MAX_ASSIGN);
detailsTabLayout.addComponent(assignLabel);
@@ -149,7 +149,7 @@ public class SoftwareModuleDetails extends AbstractNamedVersionedEntityTableDeta
@Override
protected String getDefaultCaption() {
return getI18n().get("upload.swModuleTable.header");
return getI18n().getMessage("upload.swModuleTable.header");
}
@Override

View File

@@ -26,7 +26,7 @@ import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.distributions.smtable.SwMetadataPopupLayout;
import org.eclipse.hawkbit.ui.push.SoftwareModuleUpdatedEventContainer;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -65,7 +65,7 @@ public class SoftwareModuleTable extends AbstractNamedVersionTable<SoftwareModul
private final SwMetadataPopupLayout swMetadataPopupLayout;
SoftwareModuleTable(final UIEventBus eventBus, final I18N i18n, final UINotification uiNotification,
SoftwareModuleTable(final UIEventBus eventBus, final VaadinMessageSource i18n, final UINotification uiNotification,
final ArtifactUploadState artifactUploadState, final SoftwareManagement softwareManagement,
final UploadViewClientCriterion uploadViewClientCriterion,
final SwMetadataPopupLayout swMetadataPopupLayout) {
@@ -224,7 +224,7 @@ public class SoftwareModuleTable extends AbstractNamedVersionTable<SoftwareModul
columnList.add(new TableColumn(SPUILabelDefinitions.METADATA_ICON, "", 0.1F));
return columnList;
}
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VENDOR, i18n.get("header.vendor"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VENDOR, i18n.getMessage("header.vendor"), 0.1F));
return columnList;
}
@@ -248,7 +248,7 @@ public class SoftwareModuleTable extends AbstractNamedVersionTable<SoftwareModul
UIComponentIdProvider.SW_TABLE_MANAGE_METADATA_ID + "." + nameVersionStr, "", "", null, false,
FontAwesome.LIST_ALT, SPUIButtonStyleSmallNoBorder.class);
manageMetadataBtn.addStyleName(SPUIStyleDefinitions.ARTIFACT_DTLS_ICON);
manageMetadataBtn.setDescription(i18n.get("tooltip.metadata.icon"));
manageMetadataBtn.setDescription(i18n.getMessage("tooltip.metadata.icon"));
return manageMetadataBtn;
}

View File

@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
import org.eclipse.hawkbit.ui.common.table.AbstractTableHeader;
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -35,7 +35,7 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
private final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
SoftwareModuleTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
SoftwareModuleTableHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
final ArtifactUploadState artifactUploadState,
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow) {
super(i18n, permChecker, eventbus, null, null, artifactUploadState);
@@ -51,7 +51,7 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
@Override
protected String getHeaderCaption() {
return i18n.get("upload.swModuleTable.header");
return i18n.getMessage("upload.swModuleTable.header");
}
@Override
@@ -154,7 +154,7 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
@Override
protected void addNewItem(final ClickEvent event) {
final Window addSoftwareModule = softwareModuleAddUpdateWindow.createAddSoftwareModuleWindow();
addSoftwareModule.setCaption(i18n.get("upload.caption.add.new.swmodule"));
addSoftwareModule.setCaption(i18n.getMessage("upload.caption.add.new.swmodule"));
UI.getCurrent().addWindow(addSoftwareModule);
addSoftwareModule.setVisible(Boolean.TRUE);
}

View File

@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
import org.eclipse.hawkbit.ui.dd.criteria.UploadViewClientCriterion;
import org.eclipse.hawkbit.ui.distributions.smtable.SwMetadataPopupLayout;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -26,7 +26,7 @@ public class SoftwareModuleTableLayout extends AbstractTableLayout<SoftwareModul
private static final long serialVersionUID = 6464291374980641235L;
public SoftwareModuleTableLayout(final I18N i18n, final SpPermissionChecker permChecker,
public SoftwareModuleTableLayout(final VaadinMessageSource i18n, final SpPermissionChecker permChecker,
final ArtifactUploadState artifactUploadState, final UINotification uiNotification,
final UIEventBus eventBus, final SoftwareManagement softwareManagement, final EntityFactory entityFactory,
final UploadViewClientCriterion uploadViewClientCriterion) {

View File

@@ -28,7 +28,7 @@ import org.eclipse.hawkbit.ui.common.builder.TextAreaBuilder;
import org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder;
import org.eclipse.hawkbit.ui.layouts.CreateUpdateTypeLayout;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -80,7 +80,7 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<Softw
* @param swTypeManagementService
* SoftwareManagement
*/
public CreateUpdateSoftwareTypeLayout(final I18N i18n, final TagManagement tagManagement,
public CreateUpdateSoftwareTypeLayout(final VaadinMessageSource i18n, final TagManagement tagManagement,
final EntityFactory entityFactory, final UIEventBus eventBus, final SpPermissionChecker permChecker,
final UINotification uiNotification, final SoftwareManagement swTypeManagementService) {
super(i18n, tagManagement, entityFactory, eventBus, permChecker, uiNotification);
@@ -98,8 +98,8 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<Softw
super.createRequiredComponents();
singleAssignStr = i18n.get("label.singleAssign.type");
multiAssignStr = i18n.get("label.multiAssign.type");
singleAssignStr = i18n.getMessage("label.singleAssign.type");
multiAssignStr = i18n.getMessage("label.multiAssign.type");
singleAssign = new LabelBuilder().name(singleAssignStr).buildLabel();
multiAssign = new LabelBuilder().name(multiAssignStr).buildLabel();
@@ -108,9 +108,9 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<Softw
typeKey = createTextField("textfield.key", SPUIDefinitions.TYPE_KEY, SPUIDefinitions.NEW_SOFTWARE_TYPE_KEY);
tagDesc = new TextAreaBuilder().caption(i18n.get("textfield.description"))
tagDesc = new TextAreaBuilder().caption(i18n.getMessage("textfield.description"))
.styleName(ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TYPE_DESC)
.prompt(i18n.get("textfield.description")).immediate(true).id(SPUIDefinitions.NEW_SOFTWARE_TYPE_DESC)
.prompt(i18n.getMessage("textfield.description")).immediate(true).id(SPUIDefinitions.NEW_SOFTWARE_TYPE_DESC)
.buildTextComponent();
tagDesc.setNullRepresentation(StringUtils.EMPTY);
@@ -131,8 +131,8 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<Softw
}
private TextField createTextField(final String in18Key, final String styleName, final String id) {
return new TextFieldBuilder().caption(i18n.get(in18Key)).styleName(ValoTheme.TEXTFIELD_TINY + " " + styleName)
.required(true).prompt(i18n.get(in18Key)).immediate(true).id(id).buildTextComponent();
return new TextFieldBuilder().caption(i18n.getMessage(in18Key)).styleName(ValoTheme.TEXTFIELD_TINY + " " + styleName)
.required(true).prompt(i18n.getMessage(in18Key)).immediate(true).id(id).buildTextComponent();
}
@Override
@@ -146,7 +146,7 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<Softw
@Override
protected String getWindowCaption() {
return i18n.get("caption.add.type");
return i18n.getMessage("caption.add.type");
}
/**
@@ -247,7 +247,7 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<Softw
@Override
protected String getDuplicateKeyErrorMessage(final SoftwareModuleType existingType) {
return i18n.get("message.type.key.swmodule.duplicate.check", new Object[] { existingType.getKey() });
return i18n.getMessage("message.type.key.swmodule.duplicate.check", new Object[] { existingType.getKey() });
}
private void createNewSWModuleType() {
@@ -267,11 +267,11 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<Softw
final SoftwareModuleType newSWType = swTypeManagementService.createSoftwareModuleType(
entityFactory.softwareModuleType().create().key(typeKeyValue).name(typeNameValue)
.description(typeDescValue).colour(colorPicked).maxAssignments(assignNumber));
uiNotification.displaySuccess(i18n.get("message.save.success", new Object[] { newSWType.getName() }));
uiNotification.displaySuccess(i18n.getMessage("message.save.success", new Object[] { newSWType.getName() }));
eventBus.publish(this,
new SoftwareModuleTypeEvent(SoftwareModuleTypeEnum.ADD_SOFTWARE_MODULE_TYPE, newSWType));
} else {
uiNotification.displayValidationError(i18n.get("message.error.missing.typenameorkey"));
uiNotification.displayValidationError(i18n.getMessage("message.error.missing.typenameorkey"));
}
}
@@ -279,7 +279,7 @@ public class CreateUpdateSoftwareTypeLayout extends CreateUpdateTypeLayout<Softw
swTypeManagementService.updateSoftwareModuleType(
entityFactory.softwareModuleType().update(existingType.getId()).description(tagDesc.getValue())
.colour(ColorPickerHelper.getColorPickedString(getColorPickerLayout().getSelPreview())));
uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { existingType.getName() }));
uiNotification.displaySuccess(i18n.getMessage("message.update.success", new Object[] { existingType.getName() }));
eventBus.publish(this,
new SoftwareModuleTypeEvent(SoftwareModuleTypeEnum.UPDATE_SOFTWARE_MODULE_TYPE, existingType));
}

View File

@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -36,7 +36,7 @@ public class SMTypeFilterHeader extends AbstractFilterHeader {
private final ArtifactUploadState artifactUploadState;
private final CreateUpdateSoftwareTypeLayout createUpdateSWTypeLayout;
SMTypeFilterHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
SMTypeFilterHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
final ArtifactUploadState artifactUploadState, final TagManagement tagManagement,
final EntityFactory entityFactory, final UINotification uiNotification,
final SoftwareManagement softwareManagement) {

View File

@@ -16,7 +16,7 @@ import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterLayout;
import org.eclipse.hawkbit.ui.dd.criteria.UploadViewClientCriterion;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -31,7 +31,7 @@ public class SMTypeFilterLayout extends AbstractFilterLayout {
private final ArtifactUploadState artifactUploadState;
public SMTypeFilterLayout(final ArtifactUploadState artifactUploadState, final I18N i18n,
public SMTypeFilterLayout(final ArtifactUploadState artifactUploadState, final VaadinMessageSource i18n,
final SpPermissionChecker permChecker, final UIEventBus eventBus, final TagManagement tagManagement,
final EntityFactory entityFactory, final UINotification uiNotification,
final SoftwareManagement softwareManagement, final UploadViewClientCriterion uploadViewClientCriterion) {

View File

@@ -32,7 +32,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleTiny;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -93,7 +93,7 @@ public class UploadConfirmationWindow implements Button.ClickListener {
private static final String ALREADY_EXISTS_MSG = "upload.artifact.alreadyExists";
private final I18N i18n;
private final VaadinMessageSource i18n;
private Window window;
@@ -204,9 +204,9 @@ public class UploadConfirmationWindow implements Button.ClickListener {
warningIconLabel.removeStyleName(SPUIStyleDefinitions.ERROR_LABEL);
redErrorLabelCount--;
}
warningIconLabel.setDescription(i18n.get(ALREADY_EXISTS_MSG));
warningIconLabel.setDescription(i18n.getMessage(ALREADY_EXISTS_MSG));
if (checkForDuplicate(fileName, itemId, baseSwId)) {
warningIconLabel.setDescription(i18n.get("message.duplicate.filename"));
warningIconLabel.setDescription(i18n.getMessage("message.duplicate.filename"));
warningIconLabel.addStyleName(SPUIStyleDefinitions.ERROR_LABEL);
redErrorLabelCount++;
}
@@ -214,7 +214,7 @@ public class UploadConfirmationWindow implements Button.ClickListener {
warningIconLabel.setVisible(false);
if (warningIconLabel.getStyleName().contains(SPUIStyleDefinitions.ERROR_LABEL)) {
warningIconLabel.removeStyleName(SPUIStyleDefinitions.ERROR_LABEL);
warningIconLabel.setDescription(i18n.get(ALREADY_EXISTS_MSG));
warningIconLabel.setDescription(i18n.getMessage(ALREADY_EXISTS_MSG));
redErrorLabelCount--;
}
}
@@ -343,7 +343,7 @@ public class UploadConfirmationWindow implements Button.ClickListener {
final Label warningLabel = (Label) layout.getComponent(1);
if (warningLabel.isVisible()) {
warningLabel.removeStyleName(SPUIStyleDefinitions.ERROR_LABEL);
warningLabel.setDescription(i18n.get(ALREADY_EXISTS_MSG));
warningLabel.setDescription(i18n.getMessage(ALREADY_EXISTS_MSG));
newItem.getItemProperty(WARNING_ICON).setValue(warningLabel);
redErrorLabelCount--;
break;
@@ -398,7 +398,7 @@ public class UploadConfirmationWindow implements Button.ClickListener {
final Label iconLabel = (Label) layout.getComponent(1);
if (!iconLabel.getStyleName().contains(SPUIStyleDefinitions.ERROR_LABEL)) {
iconLabel.setVisible(true);
iconLabel.setDescription(i18n.get("message.duplicate.filename"));
iconLabel.setDescription(i18n.getMessage("message.duplicate.filename"));
iconLabel.addStyleName(SPUIStyleDefinitions.ERROR_LABEL);
redErrorLabelCount++;
}
@@ -442,7 +442,7 @@ public class UploadConfirmationWindow implements Button.ClickListener {
final Optional<Artifact> artifactList = artifactManagement.findByFilenameAndSoftwareModule(oldFileName,
currentSwId);
errorLabel.removeStyleName(SPUIStyleDefinitions.ERROR_LABEL);
errorLabel.setDescription(i18n.get(ALREADY_EXISTS_MSG));
errorLabel.setDescription(i18n.getMessage(ALREADY_EXISTS_MSG));
if (!artifactList.isPresent()) {
errorLabel.setVisible(false);
}
@@ -480,12 +480,12 @@ public class UploadConfirmationWindow implements Button.ClickListener {
uploadDetailsTable.setContainerDataSource(tabelContainer);
uploadDetailsTable.setPageLength(10);
uploadDetailsTable.setColumnHeader(FILE_NAME_LAYOUT, i18n.get("upload.file.name"));
uploadDetailsTable.setColumnHeader(SW_MODULE_NAME, i18n.get("upload.swModuleTable.header"));
uploadDetailsTable.setColumnHeader(SHA1_CHECKSUM, i18n.get("upload.sha1"));
uploadDetailsTable.setColumnHeader(MD5_CHECKSUM, i18n.get("upload.md5"));
uploadDetailsTable.setColumnHeader(SIZE, i18n.get("upload.size"));
uploadDetailsTable.setColumnHeader(ACTION, i18n.get("upload.action"));
uploadDetailsTable.setColumnHeader(FILE_NAME_LAYOUT, i18n.getMessage("upload.file.name"));
uploadDetailsTable.setColumnHeader(SW_MODULE_NAME, i18n.getMessage("upload.swModuleTable.header"));
uploadDetailsTable.setColumnHeader(SHA1_CHECKSUM, i18n.getMessage("upload.sha1"));
uploadDetailsTable.setColumnHeader(MD5_CHECKSUM, i18n.getMessage("upload.md5"));
uploadDetailsTable.setColumnHeader(SIZE, i18n.getMessage("upload.size"));
uploadDetailsTable.setColumnHeader(ACTION, i18n.getMessage("upload.action"));
uploadDetailsTable.setColumnExpandRatio(FILE_NAME_LAYOUT, 0.25F);
uploadDetailsTable.setColumnExpandRatio(SW_MODULE_NAME, 0.17F);
@@ -516,7 +516,7 @@ public class UploadConfirmationWindow implements Button.ClickListener {
window.setDraggable(Boolean.TRUE);
window.setModal(true);
window.addCloseListener(event -> onPopupClose());
window.setCaption(i18n.get("header.caption.upload.details"));
window.setCaption(i18n.getMessage("header.caption.upload.details"));
window.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION);
}
@@ -614,7 +614,7 @@ public class UploadConfirmationWindow implements Button.ClickListener {
Page.getCurrent().getBrowserWindowHeight());
} else {
uploadLayout.getUINotification()
.displayValidationError(uploadLayout.getI18n().get("message.error.noProvidedName"));
.displayValidationError(uploadLayout.getI18n().getMessage("message.error.noProvidedName"));
}
}

View File

@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.ui.artifacts.event.UploadFileStatus;
import org.eclipse.hawkbit.ui.artifacts.event.UploadStatusEvent;
import org.eclipse.hawkbit.ui.artifacts.event.UploadStatusEvent.UploadStatusEventType;
import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -65,7 +65,7 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
private volatile boolean aborted;
private String failureReason;
private final I18N i18n;
private final VaadinMessageSource i18n;
private transient EventBus.UIEventBus eventBus;
private final SoftwareModule selectedSw;
private SoftwareModule selectedSwForUpload;
@@ -82,7 +82,7 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
this.upload = upload;
this.mimeType = mimeType;
this.selectedSw = selectedSw;
this.i18n = SpringContextHelper.getBean(I18N.class);
this.i18n = SpringContextHelper.getBean(VaadinMessageSource.class);
this.eventBus = SpringContextHelper.getBean(EventBus.UIEventBus.class);
this.artifactUploadState = SpringContextHelper.getBean(ArtifactUploadState.class);
eventBus.subscribe(this);
@@ -218,7 +218,7 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
new UploadFileStatus(event.getFilename(), 0, 0, selectedSwForUpload)));
}
} else {
failureReason = i18n.get("message.upload.failed");
failureReason = i18n.getMessage("message.upload.failed");
upload.interruptUpload();
// actual interrupt will happen a bit late so setting the below
// flag
@@ -248,13 +248,13 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
if (!uploadInterrupted) {
if (aborted) {
LOG.info("User aborted file upload for file : {}", fileName);
failureReason = i18n.get("message.uploadedfile.aborted");
failureReason = i18n.getMessage("message.uploadedfile.aborted");
interruptFileUpload();
return;
}
if (readBytes > maxSize || contentLength > maxSize) {
LOG.error("User tried to upload more than was allowed ({}).", maxSize);
failureReason = i18n.get("message.uploadedfile.size.exceeded", maxSize);
failureReason = i18n.getMessage("message.uploadedfile.size.exceeded", maxSize);
interruptFileUpload();
return;
}
@@ -273,13 +273,13 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene
public void onProgress(final StreamingProgressEvent event) {
if (aborted) {
LOG.info("User aborted the upload for file : {}", event.getFileName());
failureReason = i18n.get("message.uploadedfile.aborted");
failureReason = i18n.getMessage("message.uploadedfile.aborted");
interruptFileStreaming();
return;
}
if (event.getBytesReceived() > maxSize || event.getContentLength() > maxSize) {
LOG.error("User tried to upload more than was allowed ({}).", maxSize);
failureReason = i18n.get("message.uploadedfile.size.exceeded", maxSize);
failureReason = i18n.getMessage("message.uploadedfile.size.exceeded", maxSize);
interruptFileStreaming();
return;
}

View File

@@ -36,7 +36,7 @@ import org.eclipse.hawkbit.ui.dd.criteria.ServerItemIdClientCriterion;
import org.eclipse.hawkbit.ui.dd.criteria.ServerItemIdClientCriterion.Mode;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmall;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -82,7 +82,7 @@ public class UploadLayout extends VerticalLayout {
private final UploadStatusInfoWindow uploadInfoWindow;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final UINotification uiNotification;
@@ -115,7 +115,7 @@ public class UploadLayout extends VerticalLayout {
private final transient ArtifactManagement artifactManagement;
public UploadLayout(final I18N i18n, final UINotification uiNotification, final UIEventBus eventBus,
public UploadLayout(final VaadinMessageSource i18n, final UINotification uiNotification, final UIEventBus eventBus,
final ArtifactUploadState artifactUploadState, final MultipartConfigElement multipartConfigElement,
final ArtifactManagement artifactManagement) {
this.uploadInfoWindow = new UploadStatusInfoWindow(eventBus, artifactUploadState, i18n);
@@ -174,7 +174,7 @@ public class UploadLayout extends VerticalLayout {
final Upload upload = new Upload();
final UploadHandler uploadHandler = new UploadHandler(null, 0, this, multipartConfigElement.getMaxFileSize(),
upload, null, null);
upload.setButtonCaption(i18n.get("upload.file"));
upload.setButtonCaption(i18n.getMessage("upload.file"));
upload.setImmediate(true);
upload.setReceiver(uploadHandler);
upload.addSucceededListener(uploadHandler);
@@ -299,7 +299,7 @@ public class UploadLayout extends VerticalLayout {
if (compositeMessage.length() > 0) {
compositeMessage.append("<br>");
}
compositeMessage.append(i18n.get("message.no.directory.upload"));
compositeMessage.append(i18n.getMessage("message.no.directory.upload"));
}
if (!compositeMessage.toString().isEmpty()) {
uiNotification.displayValidationError(compositeMessage.toString());
@@ -393,10 +393,10 @@ public class UploadLayout extends VerticalLayout {
return out;
} catch (final FileNotFoundException e) {
LOG.error("Upload failed {}", e);
throw new ArtifactUploadFailedException(i18n.get("message.file.not.found"));
throw new ArtifactUploadFailedException(i18n.getMessage("message.file.not.found"));
} catch (final IOException e) {
LOG.error("Upload failed {}", e);
throw new ArtifactUploadFailedException(i18n.get("message.upload.failed"));
throw new ArtifactUploadFailedException(i18n.getMessage("message.upload.failed"));
}
}
@@ -405,7 +405,7 @@ public class UploadLayout extends VerticalLayout {
// check if drop is valid.If valid ,check if software module is
// selected.
if (!isFilesDropped(event)) {
uiNotification.displayValidationError(i18n.get("message.action.not.allowed"));
uiNotification.displayValidationError(i18n.getMessage("message.action.not.allowed"));
return false;
}
return checkIfSoftwareModuleIsSelected();
@@ -421,7 +421,7 @@ public class UploadLayout extends VerticalLayout {
Boolean checkIfSoftwareModuleIsSelected() {
if (!isSoftwareModuleSelected()) {
uiNotification.displayValidationError(i18n.get("message.error.noSwModuleSelected"));
uiNotification.displayValidationError(i18n.getMessage("message.error.noSwModuleSelected"));
return false;
}
return true;
@@ -494,10 +494,10 @@ public class UploadLayout extends VerticalLayout {
if (!duplicateFileNamesList.isEmpty()) {
final String fileNames = StringUtils.collectionToCommaDelimitedString(duplicateFileNamesList);
if (duplicateFileNamesList.size() == 1) {
message.append(i18n.get("message.no.duplicateFile") + fileNames);
message.append(i18n.getMessage("message.no.duplicateFile") + fileNames);
} else if (duplicateFileNamesList.size() > 1) {
message.append(i18n.get("message.no.duplicateFiles"));
message.append(i18n.getMessage("message.no.duplicateFiles"));
}
}
return message.toString();
@@ -550,7 +550,7 @@ public class UploadLayout extends VerticalLayout {
private void discardUploadData(final Button.ClickEvent event) {
if (event.getButton().equals(discardBtn)) {
if (artifactUploadState.getFileSelected().isEmpty()) {
uiNotification.displayValidationError(i18n.get("message.error.noFileSelected"));
uiNotification.displayValidationError(i18n.getMessage("message.error.noFileSelected"));
} else {
clearUploadedFileDetails();
}
@@ -621,7 +621,7 @@ public class UploadLayout extends VerticalLayout {
private void displayConfirmWindow(final Button.ClickEvent event) {
if (event.getComponent().getId().equals(UIComponentIdProvider.UPLOAD_PROCESS_BUTTON)) {
if (artifactUploadState.getFileSelected().isEmpty()) {
uiNotification.displayValidationError(i18n.get("message.error.noFileSelected"));
uiNotification.displayValidationError(i18n.getMessage("message.error.noFileSelected"));
} else {
currentUploadConfirmationwindow = new UploadConfirmationWindow(this, artifactUploadState, eventBus,
artifactManagement);
@@ -635,7 +635,7 @@ public class UploadLayout extends VerticalLayout {
/**
* @return
*/
I18N getI18n() {
VaadinMessageSource getI18n() {
return i18n;
}

View File

@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleTiny;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -51,7 +51,7 @@ public class UploadResultWindow implements Button.ClickListener {
private IndexedContainer tabelContainer;
private final I18N i18n;
private final VaadinMessageSource i18n;
private static final String FILE_NAME = "fileName";
@@ -71,7 +71,7 @@ public class UploadResultWindow implements Button.ClickListener {
* @param i18n
* I18N
*/
UploadResultWindow(final List<UploadStatus> uploadResultList, final I18N i18n, final EventBus.UIEventBus eventBus) {
UploadResultWindow(final List<UploadStatus> uploadResultList, final VaadinMessageSource i18n, final EventBus.UIEventBus eventBus) {
this.uploadResultList = uploadResultList;
this.i18n = i18n;
this.eventBus = eventBus;
@@ -110,11 +110,11 @@ public class UploadResultWindow implements Button.ClickListener {
.setValue(HawkbitCommonUtil.getFormatedLabel(uploadResult.getBaseSwModuleName()));
if (uploadResult.getUploadResult().equals(SPUILabelDefinitions.SUCCESS)) {
statusLabel = new Label(HawkbitCommonUtil.getFormatedLabel(i18n.get("upload.success")));
statusLabel = new Label(HawkbitCommonUtil.getFormatedLabel(i18n.getMessage("upload.success")));
statusLabel.addStyleName("validation-success");
newItem.getItemProperty(UPLOAD_RESULT).setValue(statusLabel);
} else {
statusLabel = new Label(HawkbitCommonUtil.getFormatedLabel(i18n.get("upload.failed")));
statusLabel = new Label(HawkbitCommonUtil.getFormatedLabel(i18n.getMessage("upload.failed")));
statusLabel.addStyleName("validation-failed");
newItem.getItemProperty(UPLOAD_RESULT).setValue(statusLabel);
}
@@ -138,10 +138,10 @@ public class UploadResultWindow implements Button.ClickListener {
uploadResultTable.setContainerDataSource(tabelContainer);
uploadResultTable.setPageLength(10);
uploadResultTable.setColumnHeader(FILE_NAME, i18n.get("upload.file.name"));
uploadResultTable.setColumnHeader(BASE_SW_MODULE, i18n.get("upload.swModuleTable.header"));
uploadResultTable.setColumnHeader(UPLOAD_RESULT, i18n.get("upload.result.status"));
uploadResultTable.setColumnHeader(REASON, i18n.get("upload.reason"));
uploadResultTable.setColumnHeader(FILE_NAME, i18n.getMessage("upload.file.name"));
uploadResultTable.setColumnHeader(BASE_SW_MODULE, i18n.getMessage("upload.swModuleTable.header"));
uploadResultTable.setColumnHeader(UPLOAD_RESULT, i18n.getMessage("upload.result.status"));
uploadResultTable.setColumnHeader(REASON, i18n.getMessage("upload.reason"));
uploadResultTable.setColumnExpandRatio(FILE_NAME, 0.2f);
uploadResultTable.setColumnExpandRatio(BASE_SW_MODULE, 0.2f);

View File

@@ -21,7 +21,7 @@ import org.eclipse.hawkbit.ui.common.ConfirmationDialog;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -59,7 +59,7 @@ public class UploadStatusInfoWindow extends Window {
private final ArtifactUploadState artifactUploadState;
private final I18N i18n;
private final VaadinMessageSource i18n;
private static final String PROGRESS = "Progress";
@@ -93,7 +93,7 @@ public class UploadStatusInfoWindow extends Window {
private ConfirmationDialog confirmDialog;
UploadStatusInfoWindow(final UIEventBus eventBus, final ArtifactUploadState artifactUploadState, final I18N i18n) {
UploadStatusInfoWindow(final UIEventBus eventBus, final ArtifactUploadState artifactUploadState, final VaadinMessageSource i18n) {
this.eventBus = eventBus;
this.artifactUploadState = artifactUploadState;
this.i18n = i18n;
@@ -193,7 +193,7 @@ public class UploadStatusInfoWindow extends Window {
grid.getColumn(PROGRESS).setRenderer(new ProgressBarRenderer());
grid.setColumnOrder(STATUS, PROGRESS, FILE_NAME, SPUILabelDefinitions.NAME_VERSION, REASON);
setColumnWidth();
grid.getColumn(SPUILabelDefinitions.NAME_VERSION).setHeaderCaption(i18n.get("upload.swModuleTable.header"));
grid.getColumn(SPUILabelDefinitions.NAME_VERSION).setHeaderCaption(i18n.getMessage("upload.swModuleTable.header"));
grid.setFrozenColumnCount(5);
}
@@ -466,8 +466,8 @@ public class UploadStatusInfoWindow extends Window {
}
private void createConfirmDialog() {
confirmDialog = new ConfirmationDialog(i18n.get("caption.confirm.abort.action"),
i18n.get("message.abort.upload"), i18n.get("button.ok"), i18n.get("button.cancel"), ok -> {
confirmDialog = new ConfirmationDialog(i18n.getMessage("caption.confirm.abort.action"),
i18n.getMessage("message.abort.upload"), i18n.getMessage("button.ok"), i18n.getMessage("button.cancel"), ok -> {
if (ok) {
eventBus.publish(this, UploadStatusEventType.ABORT_UPLOAD);
uploadAborted = true;

View File

@@ -24,7 +24,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.customrenderers.renderers.HtmlButtonRenderer;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -72,7 +72,7 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
private static final String KEY = "key";
protected I18N i18n;
protected VaadinMessageSource i18n;
private final UINotification uiNotification;
@@ -95,7 +95,7 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
private HorizontalLayout mainLayout;
protected SpPermissionChecker permChecker;
protected AbstractMetadataPopupLayout(final I18N i18n, final UINotification uiNotification,
protected AbstractMetadataPopupLayout(final VaadinMessageSource i18n, final UINotification uiNotification,
final UIEventBus eventBus, final SpPermissionChecker permChecker) {
this.i18n = i18n;
this.uiNotification = uiNotification;
@@ -230,8 +230,8 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
}
private TextField createKeyTextField() {
final TextField keyField = new TextFieldBuilder().caption(i18n.get("textfield.key")).required(true)
.prompt(i18n.get("textfield.key")).immediate(true).id(UIComponentIdProvider.METADATA_KEY_FIELD_ID)
final TextField keyField = new TextFieldBuilder().caption(i18n.getMessage("textfield.key")).required(true)
.prompt(i18n.getMessage("textfield.key")).immediate(true).id(UIComponentIdProvider.METADATA_KEY_FIELD_ID)
.maxLengthAllowed(128).buildTextComponent();
keyField.addTextChangeListener(this::onKeyChange);
keyField.setTextChangeEventMode(TextChangeEventMode.EAGER);
@@ -240,8 +240,8 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
}
private TextArea createValueTextField() {
valueTextArea = new TextAreaBuilder().caption(i18n.get("textfield.value")).required(true)
.prompt(i18n.get("textfield.value")).immediate(true).id(UIComponentIdProvider.METADATA_VALUE_ID)
valueTextArea = new TextAreaBuilder().caption(i18n.getMessage("textfield.value")).required(true)
.prompt(i18n.getMessage("textfield.value")).immediate(true).id(UIComponentIdProvider.METADATA_VALUE_ID)
.maxLengthAllowed(4000).buildTextComponent();
valueTextArea.setNullRepresentation(StringUtils.EMPTY);
valueTextArea.setSizeFull();
@@ -261,8 +261,8 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
metadataGrid.setSelectionMode(SelectionMode.SINGLE);
metadataGrid.setColumnReorderingAllowed(true);
metadataGrid.setContainerDataSource(getMetadataContainer());
metadataGrid.getColumn(KEY).setHeaderCaption(i18n.get("header.key"));
metadataGrid.getColumn(VALUE).setHeaderCaption(i18n.get("header.value"));
metadataGrid.getColumn(KEY).setHeaderCaption(i18n.getMessage("header.key"));
metadataGrid.getColumn(VALUE).setHeaderCaption(i18n.getMessage("header.value"));
metadataGrid.getColumn(VALUE).setHidden(true);
metadataGrid.addSelectionListener(this::onRowClick);
metadataGrid.getColumn(DELETE_BUTTON).setHeaderCaption("");
@@ -278,8 +278,8 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
final String value = (String) item.getItemProperty(VALUE).getValue();
final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.get("caption.metadata.delete.action.confirmbox"), i18n.get("message.confirm.delete.metadata", key),
i18n.get("button.ok"), i18n.get("button.cancel"), ok -> {
i18n.getMessage("caption.metadata.delete.action.confirmbox"), i18n.getMessage("message.confirm.delete.metadata", key),
i18n.getMessage("button.ok"), i18n.getMessage("button.cancel"), ok -> {
if (ok) {
handleOkDeleteMetadata(event, key, value);
}
@@ -290,7 +290,7 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
private void handleOkDeleteMetadata(final RendererClickEvent event, final String key, final String value) {
deleteMetadata(getSelectedEntity(), key, value);
uiNotification.displaySuccess(i18n.get("message.metadata.deleted.successfully", key));
uiNotification.displaySuccess(i18n.getMessage("message.metadata.deleted.successfully", key));
final Object selectedRow = metaDataGrid.getSelectedRow();
metaDataGrid.getContainerDataSource().removeItem(event.getItemId());
// force grid to refresh
@@ -320,14 +320,14 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
}
private Button createAddIcon() {
addIcon = SPUIComponentProvider.getButton(UIComponentIdProvider.METADTA_ADD_ICON_ID, i18n.get("button.save"),
addIcon = SPUIComponentProvider.getButton(UIComponentIdProvider.METADTA_ADD_ICON_ID, i18n.getMessage("button.save"),
null, null, false, FontAwesome.PLUS, SPUIButtonStyleSmallNoBorder.class);
addIcon.addClickListener(event -> onAdd());
return addIcon;
}
private Label createHeaderCaption() {
return new LabelBuilder().name(i18n.get("caption.metadata")).buildCaptionLabel();
return new LabelBuilder().name(i18n.getMessage("caption.metadata")).buildCaptionLabel();
}
private static IndexedContainer getMetadataContainer() {
@@ -387,7 +387,7 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
if (metaDataGrid.getSelectedRow() == null) {
if (!duplicateCheck(entity)) {
final M metadata = createMetadata(entity, key, value);
uiNotification.displaySuccess(i18n.get("message.metadata.saved", metadata.getKey()));
uiNotification.displaySuccess(i18n.getMessage("message.metadata.saved", metadata.getKey()));
addItemToGrid(metadata.getKey(), metadata.getValue());
metaDataGrid.scrollToEnd();
metaDataGrid.select(metadata.getKey());
@@ -399,7 +399,7 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
}
} else {
final M metadata = updateMetadata(entity, key, value);
uiNotification.displaySuccess(i18n.get("message.metadata.updated", metadata.getKey()));
uiNotification.displaySuccess(i18n.getMessage("message.metadata.updated", metadata.getKey()));
updateItemInGrid(metadata.getKey());
metaDataGrid.select(metadata.getKey());
addIcon.setEnabled(true);
@@ -410,11 +410,11 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
private boolean mandatoryCheck() {
if (keyTextField.getValue().isEmpty()) {
uiNotification.displayValidationError(i18n.get("message.key.missing"));
uiNotification.displayValidationError(i18n.getMessage("message.key.missing"));
return false;
}
if (valueTextArea.getValue().isEmpty()) {
uiNotification.displayValidationError(i18n.get("message.value.missing"));
uiNotification.displayValidationError(i18n.getMessage("message.value.missing"));
return false;
}
return true;
@@ -425,13 +425,13 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
return false;
}
uiNotification.displayValidationError(i18n.get("message.metadata.duplicate.check", keyTextField.getValue()));
uiNotification.displayValidationError(i18n.getMessage("message.metadata.duplicate.check", keyTextField.getValue()));
return true;
}
private String getMetadataCaption(final String nameVersionStr) {
final StringBuilder caption = new StringBuilder();
caption.append(HawkbitCommonUtil.DIV_DESCRIPTION_START + i18n.get("caption.metadata.popup") + " "
caption.append(HawkbitCommonUtil.DIV_DESCRIPTION_START + i18n.getMessage("caption.metadata.popup") + " "
+ HawkbitCommonUtil.getBoldHTMLText(nameVersionStr));
caption.append(HawkbitCommonUtil.DIV_DESCRIPTION_END);
return caption.toString();

View File

@@ -25,7 +25,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorderWithIcon;
import org.eclipse.hawkbit.ui.layouts.AbstractCreateUpdateTagLayout;
import org.eclipse.hawkbit.ui.management.targettable.TargetAddUpdateWindowLayout;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroupItemComponent;
@@ -97,7 +97,7 @@ public class CommonDialogWindow extends Window {
private List<AbstractField<?>> allComponents;
private final I18N i18n;
private final VaadinMessageSource i18n;
private transient SaveDialogCloseListener closeListener;
@@ -121,7 +121,7 @@ public class CommonDialogWindow extends Window {
*/
public CommonDialogWindow(final String caption, final Component content, final String helpLink,
final SaveDialogCloseListener closeListener, final ClickListener cancelButtonClickListener,
final AbstractLayout layout, final I18N i18n) {
final AbstractLayout layout, final VaadinMessageSource i18n) {
checkNotNull(closeListener);
this.caption = caption;
this.content = content;
@@ -428,7 +428,7 @@ public class CommonDialogWindow extends Window {
return;
}
final Label mandatoryLabel = new Label(i18n.get("label.mandatory.field"));
final Label mandatoryLabel = new Label(i18n.getMessage("label.mandatory.field"));
mandatoryLabel.addStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR + " " + ValoTheme.LABEL_TINY);
if (content instanceof TargetAddUpdateWindowLayout) {

View File

@@ -10,7 +10,7 @@ package org.eclipse.hawkbit.ui.common.builder;
import org.eclipse.hawkbit.ui.common.CommonDialogWindow;
import org.eclipse.hawkbit.ui.common.CommonDialogWindow.SaveDialogCloseListener;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -29,7 +29,7 @@ public class WindowBuilder {
private ClickListener cancelButtonClickListener;
private String helpLink;
private AbstractLayout layout;
private I18N i18n;
private VaadinMessageSource i18n;
private final String type;
private String id;
@@ -124,7 +124,7 @@ public class WindowBuilder {
* the i18n
* @return the window builder
*/
public WindowBuilder i18n(final I18N i18n) {
public WindowBuilder i18n(final VaadinMessageSource i18n) {
this.i18n = i18n;
return this;
}

View File

@@ -14,7 +14,7 @@ import java.util.Map.Entry;
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -44,11 +44,11 @@ public abstract class AbstractConfirmationWindowLayout extends VerticalLayout {
private String consolidatedMessage;
protected I18N i18n;
protected VaadinMessageSource i18n;
protected transient EventBus.UIEventBus eventBus;
protected AbstractConfirmationWindowLayout(final I18N i18n, final UIEventBus eventBus) {
protected AbstractConfirmationWindowLayout(final VaadinMessageSource i18n, final UIEventBus eventBus) {
this.i18n = i18n;
this.eventBus = eventBus;
}

View File

@@ -12,7 +12,7 @@ import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus.UIEventBus;
/**
@@ -24,7 +24,7 @@ public abstract class AbstractNamedVersionedEntityTableDetailsLayout<T extends N
private static final long serialVersionUID = 1L;
protected AbstractNamedVersionedEntityTableDetailsLayout(final I18N i18n, final UIEventBus eventBus,
protected AbstractNamedVersionedEntityTableDetailsLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
final SpPermissionChecker permissionChecker, final ManagementUIState managementUIState) {
super(i18n, eventBus, permissionChecker, managementUIState);
}

View File

@@ -21,7 +21,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -45,7 +45,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
private static final long serialVersionUID = 4862529368471627190L;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final SpPermissionChecker permissionChecker;
@@ -69,7 +69,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
protected final ManagementUIState managementUIState;
protected AbstractTableDetailsLayout(final I18N i18n, final UIEventBus eventBus,
protected AbstractTableDetailsLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
final SpPermissionChecker permissionChecker, final ManagementUIState managementUIState) {
this.i18n = i18n;
this.permissionChecker = permissionChecker;
@@ -87,7 +87,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
return permissionChecker;
}
protected I18N getI18n() {
protected VaadinMessageSource getI18n() {
return i18n;
}
@@ -131,7 +131,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
manageMetadataBtn = SPUIComponentProvider.getButton("", "", "", null, false, FontAwesome.LIST_ALT,
SPUIButtonStyleSmallNoBorder.class);
manageMetadataBtn.setId(getEditButtonId());
manageMetadataBtn.setDescription(i18n.get("tooltip.metadata.icon"));
manageMetadataBtn.setDescription(i18n.getMessage("tooltip.metadata.icon"));
manageMetadataBtn.addClickListener(this::showMetadata);
manageMetadataBtn.setEnabled(false);
@@ -214,7 +214,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
protected void populateLog() {
logLayout.removeAllComponents();
logLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.get("label.created.at"),
logLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.getMessage("label.created.at"),
SPDateTimeUtil.formatCreatedAt(selectedBaseEntity)));
logLayout.addComponent(SPUIComponentProvider.createCreatedByLabel(i18n, selectedBaseEntity));
@@ -223,7 +223,7 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
return;
}
logLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.get("label.modified.date"),
logLayout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.getMessage("label.modified.date"),
SPDateTimeUtil.formatLastModifiedAt(selectedBaseEntity)));
logLayout.addComponent(SPUIComponentProvider.createLastModifiedByLabel(i18n, selectedBaseEntity));
@@ -316,9 +316,9 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
private void populateDescription() {
if (selectedBaseEntity != null) {
updateDescriptionLayout(i18n.get("label.description"), selectedBaseEntity.getDescription());
updateDescriptionLayout(i18n.getMessage("label.description"), selectedBaseEntity.getDescription());
} else {
updateDescriptionLayout(i18n.get("label.description"), null);
updateDescriptionLayout(i18n.getMessage("label.description"), null);
}
}

View File

@@ -19,7 +19,7 @@ import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.distributions.dstable.DsMetadataPopupLayout;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -53,13 +53,13 @@ public class DistributionSetMetadatadetailslayout extends Table {
private final transient EntityFactory entityFactory;
private final I18N i18n;
private final VaadinMessageSource i18n;
private Long selectedDistSetId;
private final UINotification notification;
public DistributionSetMetadatadetailslayout(final I18N i18n, final SpPermissionChecker permissionChecker,
public DistributionSetMetadatadetailslayout(final VaadinMessageSource i18n, final SpPermissionChecker permissionChecker,
final DistributionSetManagement distributionSetManagement,
final DsMetadataPopupLayout dsMetadataPopupLayout, final EntityFactory entityFactory,
final UINotification notification) {
@@ -123,7 +123,7 @@ public class DistributionSetMetadatadetailslayout extends Table {
}
private void addDSMetadataTableHeader() {
setColumnHeader(METADATA_KEY, i18n.get("header.key"));
setColumnHeader(METADATA_KEY, i18n.getMessage("header.key"));
}
private void setDSMetadataProperties(final DistributionSetMetadata dsMetadata) {
@@ -153,7 +153,7 @@ public class DistributionSetMetadatadetailslayout extends Table {
private void showMetadataDetails(final Long selectedDistSetId, final String metadataKey) {
final Optional<DistributionSet> distSet = distributionSetManagement.findDistributionSetById(selectedDistSetId);
if (!distSet.isPresent()) {
notification.displayWarning(i18n.get("distributionset.not.exists"));
notification.displayWarning(i18n.getMessage("distributionset.not.exists"));
return;
}

View File

@@ -24,7 +24,7 @@ import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.slf4j.Logger;
@@ -65,7 +65,7 @@ public class SoftwareModuleDetailsTable extends Table {
private final transient DistributionSetManagement distributionSetManagement;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final transient EventBus.UIEventBus eventBus;
@@ -92,7 +92,7 @@ public class SoftwareModuleDetailsTable extends Table {
* @param uiNotification
* UINotification for displaying error and success notifications
*/
public SoftwareModuleDetailsTable(final I18N i18n, final boolean isUnassignSoftModAllowed,
public SoftwareModuleDetailsTable(final VaadinMessageSource i18n, final boolean isUnassignSoftModAllowed,
final SpPermissionChecker permissionChecker, final DistributionSetManagement distributionSetManagement,
final EventBus.UIEventBus eventBus, final ManageDistUIState manageDistUIState,
final UINotification uiNotification) {
@@ -133,8 +133,8 @@ public class SoftwareModuleDetailsTable extends Table {
private void addSWModuleTableHeader() {
setColumnHeader(SOFT_TYPE_MANDATORY, "");
setColumnHeader(SOFT_TYPE_NAME, i18n.get("header.caption.typename"));
setColumnHeader(SOFT_MODULE, i18n.get("header.caption.softwaremodule"));
setColumnHeader(SOFT_TYPE_NAME, i18n.getMessage("header.caption.typename"));
setColumnHeader(SOFT_MODULE, i18n.getMessage("header.caption.softwaremodule"));
}
/**
@@ -186,7 +186,7 @@ public class SoftwareModuleDetailsTable extends Table {
final Set<SoftwareModule> alreadyAssignedSwModules) {
final SoftwareModule unAssignedSw = getSoftwareModule(event.getButton().getId(), alreadyAssignedSwModules);
if (distributionSetManagement.isDistributionSetInUse(distributionSet.getId())) {
uiNotification.displayValidationError(i18n.get("message.error.notification.ds.target.assigned",
uiNotification.displayValidationError(i18n.getMessage("message.error.notification.ds.target.assigned",
distributionSet.getName(), distributionSet.getVersion()));
} else {
final DistributionSet newDistributionSet = distributionSetManagement
@@ -194,7 +194,7 @@ public class SoftwareModuleDetailsTable extends Table {
manageDistUIState.setLastSelectedEntity(newDistributionSet.getId());
eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.SELECTED_ENTITY, newDistributionSet));
eventBus.publish(this, DistributionsUIEvent.ORDER_BY_DISTRIBUTION);
uiNotification.displaySuccess(i18n.get("message.sw.unassigned", unAssignedSw.getName()));
uiNotification.displaySuccess(i18n.getMessage("message.sw.unassigned", unAssignedSw.getName()));
}
}

View File

@@ -18,7 +18,7 @@ import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.distributions.smtable.SwMetadataPopupLayout;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -49,7 +49,7 @@ public class SoftwareModuleMetadatadetailslayout extends Table {
private SwMetadataPopupLayout swMetadataPopupLayout;
private I18N i18n;
private VaadinMessageSource i18n;
private Long selectedSWModuleId;
@@ -69,7 +69,7 @@ public class SoftwareModuleMetadatadetailslayout extends Table {
* @param entityFactory
* the entity factory service
*/
public void init(final I18N i18n, final SpPermissionChecker permissionChecker,
public void init(final VaadinMessageSource i18n, final SpPermissionChecker permissionChecker,
final SoftwareManagement softwareManagement, final SwMetadataPopupLayout swMetadataPopupLayout,
final EntityFactory entityFactory) {
this.i18n = i18n;
@@ -143,7 +143,7 @@ public class SoftwareModuleMetadatadetailslayout extends Table {
}
private void addSMMetadataTableHeader() {
setColumnHeader(METADATA_KEY, i18n.get("header.key"));
setColumnHeader(METADATA_KEY, i18n.getMessage("header.key"));
}
private void setSWMetadataProperties(final SoftwareModuleMetadata swMetadata) {

View File

@@ -12,7 +12,7 @@ import java.util.List;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import com.vaadin.data.Container;
@@ -32,9 +32,9 @@ public class TargetFilterQueryDetailsTable extends Table {
private static final String TFQ_NAME = "name";
private static final String TFQ_QUERY = "query";
private final I18N i18n;
private final VaadinMessageSource i18n;
public TargetFilterQueryDetailsTable(final I18N i18n) {
public TargetFilterQueryDetailsTable(final VaadinMessageSource i18n) {
this.i18n = i18n;
createTable();
}
@@ -90,8 +90,8 @@ public class TargetFilterQueryDetailsTable extends Table {
}
private void addTableHeader() {
setColumnHeader(TFQ_NAME, i18n.get("header.target.filter.name"));
setColumnHeader(TFQ_QUERY, i18n.get("header.target.filter.query"));
setColumnHeader(TFQ_NAME, i18n.getMessage("header.target.filter.name"));
setColumnHeader(TFQ_QUERY, i18n.getMessage("header.target.filter.query"));
}
}

View File

@@ -12,7 +12,7 @@ import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -41,9 +41,9 @@ public abstract class AbstractFilterHeader extends VerticalLayout {
private Button hideIcon;
protected final I18N i18n;
protected final VaadinMessageSource i18n;
protected AbstractFilterHeader(final SpPermissionChecker permChecker, final UIEventBus eventBus, final I18N i18n) {
protected AbstractFilterHeader(final SpPermissionChecker permChecker, final UIEventBus eventBus, final VaadinMessageSource i18n) {
this.permChecker = permChecker;
this.eventBus = eventBus;
this.i18n = i18n;

View File

@@ -12,7 +12,7 @@ import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.common.builder.WindowBuilder;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmall;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -43,7 +43,7 @@ public abstract class AbstractDeleteActionsLayout extends VerticalLayout impleme
private static final long serialVersionUID = -6047975388519155509L;
protected I18N i18n;
protected VaadinMessageSource i18n;
protected SpPermissionChecker permChecker;
@@ -59,7 +59,7 @@ public abstract class AbstractDeleteActionsLayout extends VerticalLayout impleme
private Button bulkUploadStatusButton;
protected AbstractDeleteActionsLayout(final I18N i18n, final SpPermissionChecker permChecker,
protected AbstractDeleteActionsLayout(final VaadinMessageSource i18n, final SpPermissionChecker permChecker,
final UIEventBus eventBus, final UINotification notification) {
this.i18n = i18n;
this.permChecker = permChecker;
@@ -338,7 +338,7 @@ public abstract class AbstractDeleteActionsLayout extends VerticalLayout impleme
* @return the no actions label.
*/
protected String getNoActionsButtonLabel() {
return i18n.get("button.no.actions");
return i18n.getMessage("button.no.actions");
}
/**
@@ -347,7 +347,7 @@ public abstract class AbstractDeleteActionsLayout extends VerticalLayout impleme
* @return the actions label.
*/
protected String getActionsButtonLabel() {
return i18n.get("button.actions");
return i18n.getMessage("button.actions");
}
/**
@@ -356,7 +356,7 @@ public abstract class AbstractDeleteActionsLayout extends VerticalLayout impleme
* @return caption of the window.
*/
protected String getUnsavedActionsWindowCaption() {
return i18n.get("caption.save.window");
return i18n.getMessage("caption.save.window");
}
/**

View File

@@ -10,7 +10,7 @@ package org.eclipse.hawkbit.ui.common.grid;
import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.components.RefreshableContainer;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
import org.vaadin.spring.events.EventBus;
@@ -28,13 +28,13 @@ public abstract class AbstractGrid extends Grid implements RefreshableContainer
private static final long serialVersionUID = 4856562746502217630L;
protected final I18N i18n;
protected final VaadinMessageSource i18n;
protected final transient EventBus.UIEventBus eventBus;
protected final SpPermissionChecker permissionChecker;
protected AbstractGrid(final I18N i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker) {
protected AbstractGrid(final VaadinMessageSource i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker) {
this.i18n = i18n;
this.eventBus = eventBus;
this.permissionChecker = permissionChecker;

View File

@@ -14,7 +14,7 @@ import org.eclipse.hawkbit.ui.components.SPUIButton;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.rollout.state.RolloutUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -49,10 +49,10 @@ public abstract class AbstractGridHeader extends VerticalLayout {
protected final RolloutUIState rolloutUIState;
protected final I18N i18n;
protected final VaadinMessageSource i18n;
protected AbstractGridHeader(final SpPermissionChecker permissionChecker, final RolloutUIState rolloutUIState,
final I18N i18n) {
final VaadinMessageSource i18n) {
this.permissionChecker = permissionChecker;
this.rolloutUIState = rolloutUIState;
this.i18n = i18n;

View File

@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.ui.common.table;
import java.util.List;
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -33,7 +33,7 @@ public abstract class AbstractNamedVersionTable<E extends NamedVersionedEntity,
private static final long serialVersionUID = 780050712209750719L;
protected AbstractNamedVersionTable(final UIEventBus eventBus, final I18N i18n, final UINotification notification) {
protected AbstractNamedVersionTable(final UIEventBus eventBus, final VaadinMessageSource i18n, final UINotification notification) {
super(eventBus, i18n, notification);
setMultiSelect(true);
setSelectable(true);
@@ -44,7 +44,7 @@ public abstract class AbstractNamedVersionTable<E extends NamedVersionedEntity,
final List<TableColumn> columnList = super.getTableVisibleColumns();
final float versionColumnSize = isMaximized() ? 0.1F : 0.2F;
columnList
.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), versionColumnSize));
.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.getMessage("header.version"), versionColumnSize));
return columnList;
}

View File

@@ -22,7 +22,7 @@ import org.eclipse.hawkbit.ui.artifacts.event.UploadArtifactUIEvent;
import org.eclipse.hawkbit.ui.common.ManagmentEntityState;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.RefreshableContainer;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
@@ -64,11 +64,11 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table impl
protected transient EventBus.UIEventBus eventBus;
protected I18N i18n;
protected VaadinMessageSource i18n;
protected UINotification notification;
protected AbstractTable(final UIEventBus eventBus, final I18N i18n, final UINotification notification) {
protected AbstractTable(final UIEventBus eventBus, final VaadinMessageSource i18n, final UINotification notification) {
this.eventBus = eventBus;
this.i18n = i18n;
this.notification = notification;
@@ -320,17 +320,17 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table impl
protected List<TableColumn> getTableVisibleColumns() {
final List<TableColumn> columnList = new ArrayList<>();
if (!isMaximized()) {
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"),
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.getMessage("header.name"),
getColumnNameMinimizedSize()));
return columnList;
}
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.get("header.createdBy"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.getMessage("header.name"), 0.2F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.getMessage("header.createdBy"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.getMessage("header.createdDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.getMessage("header.modifiedBy"), 0.1F));
columnList.add(
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.get("header.description"), 0.2F));
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.getMessage("header.modifiedDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.getMessage("header.description"), 0.2F));
setItemDescriptionGenerator((source, itemId, propertyId) -> {
if (SPUILabelDefinitions.VAR_CREATED_BY.equals(propertyId)) {
@@ -395,7 +395,7 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table impl
private boolean validateDropList(final Set<?> droplist) {
if (droplist.isEmpty()) {
final String actionDidNotWork = i18n.get("message.action.did.not.work", new Object[] {});
final String actionDidNotWork = i18n.getMessage("message.action.did.not.work", new Object[] {});
notification.displayValidationError(actionDidNotWork);
return false;
}
@@ -407,7 +407,7 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table impl
final Component compsource = transferable.getSourceComponent();
if (!hasDropPermission()) {
notification.displayValidationError(i18n.get("message.permission.insufficient"));
notification.displayValidationError(i18n.getMessage("message.permission.insufficient"));
return false;
}
@@ -420,7 +420,7 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table impl
return validateDragAndDropWrapper((DragAndDropWrapper) compsource)
&& validateDropList(getDraggedTargetList(dragEvent));
}
notification.displayValidationError(i18n.get(ACTION_NOT_ALLOWED_MSG));
notification.displayValidationError(i18n.getMessage(ACTION_NOT_ALLOWED_MSG));
return false;
}

View File

@@ -18,7 +18,7 @@ import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.vaadin.spring.events.EventBus;
@@ -41,7 +41,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
private static final long serialVersionUID = 4881626370291837175L;
protected I18N i18n;
protected VaadinMessageSource i18n;
protected SpPermissionChecker permChecker;
@@ -67,7 +67,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
protected final ManageDistUIState manageDistUIstate;
protected final ArtifactUploadState artifactUploadState;
protected AbstractTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
protected AbstractTableHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
final ManagementUIState managementUIState, final ManageDistUIState manageDistUIstate,
final ArtifactUploadState artifactUploadState) {
this.i18n = i18n;

View File

@@ -18,7 +18,7 @@ import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
import org.eclipse.hawkbit.ui.common.table.BaseUIEntityEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -64,7 +64,7 @@ public abstract class AbstractTagToken<T extends BaseEntity> implements Serializ
protected SpPermissionChecker checker;
protected I18N i18n;
protected VaadinMessageSource i18n;
protected UINotification uinotification;
@@ -77,7 +77,7 @@ public abstract class AbstractTagToken<T extends BaseEntity> implements Serializ
@SuppressWarnings("squid:S1948")
protected T selectedEntity;
protected AbstractTagToken(final SpPermissionChecker checker, final I18N i18n, final UINotification uinotification,
protected AbstractTagToken(final SpPermissionChecker checker, final VaadinMessageSource i18n, final UINotification uinotification,
final UIEventBus eventBus, final ManagementUIState managementUIState) {
this.checker = checker;
this.i18n = i18n;

View File

@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.push.TargetTagCreatedEventContainer;
import org.eclipse.hawkbit.ui.push.TargetTagDeletedEventContainer;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -37,7 +37,7 @@ public abstract class AbstractTargetTagToken<T extends BaseEntity> extends Abstr
protected final transient TagManagement tagManagement;
protected AbstractTargetTagToken(final SpPermissionChecker checker, final I18N i18n,
protected AbstractTargetTagToken(final SpPermissionChecker checker, final VaadinMessageSource i18n,
final UINotification uinotification, final UIEventBus eventBus, final ManagementUIState managementUIState,
final TagManagement tagManagement) {
super(checker, i18n, uinotification, eventBus, managementUIState);

View File

@@ -24,7 +24,7 @@ import org.eclipse.hawkbit.ui.push.DistributionSetTagCreatedEventContainer;
import org.eclipse.hawkbit.ui.push.DistributionSetTagDeletedEventContainer;
import org.eclipse.hawkbit.ui.push.DistributionSetTagUpdatedEventContainer;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -48,7 +48,7 @@ public class DistributionTagToken extends AbstractTagToken<DistributionSet> {
// To Be Done : have to set this value based on view???
private static final Boolean NOTAGS_SELECTED = Boolean.FALSE;
public DistributionTagToken(final SpPermissionChecker checker, final I18N i18n, final UINotification uinotification,
public DistributionTagToken(final SpPermissionChecker checker, final VaadinMessageSource i18n, final UINotification uinotification,
final UIEventBus eventBus, final ManagementUIState managementUIState, final TagManagement tagManagement,
final DistributionSetManagement distributionSetManagement) {
super(checker, i18n, uinotification, eventBus, managementUIState);
@@ -63,7 +63,7 @@ public class DistributionTagToken extends AbstractTagToken<DistributionSet> {
@Override
protected String getTokenInputPrompt() {
return i18n.get("combo.type.tag.name");
return i18n.getMessage("combo.type.tag.name");
}
@Override
@@ -74,7 +74,7 @@ public class DistributionTagToken extends AbstractTagToken<DistributionSet> {
eventBus.publish(this, ManagementUIEvent.ASSIGN_DISTRIBUTION_TAG);
}
} else {
uinotification.displayValidationError(i18n.get("message.error.missing.tagname"));
uinotification.displayValidationError(i18n.getMessage("message.error.missing.tagname"));
}
}

View File

@@ -21,7 +21,7 @@ import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.springframework.data.domain.PageRequest;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -44,7 +44,7 @@ public class TargetTagToken extends AbstractTargetTagToken<Target> {
private final transient TargetManagement targetManagement;
public TargetTagToken(final SpPermissionChecker checker, final I18N i18n, final UINotification uinotification,
public TargetTagToken(final SpPermissionChecker checker, final VaadinMessageSource i18n, final UINotification uinotification,
final UIEventBus eventBus, final ManagementUIState managementUIState, final TagManagement tagManagement,
final TargetManagement targetManagement) {
super(checker, i18n, uinotification, eventBus, managementUIState, tagManagement);
@@ -58,7 +58,7 @@ public class TargetTagToken extends AbstractTargetTagToken<Target> {
@Override
protected String getTokenInputPrompt() {
return i18n.get("combo.type.tag.name");
return i18n.getMessage("combo.type.tag.name");
}
@Override
@@ -69,7 +69,7 @@ public class TargetTagToken extends AbstractTargetTagToken<Target> {
eventBus.publish(this, ManagementUIEvent.ASSIGN_TARGET_TAG);
}
} else {
uinotification.displayValidationError(i18n.get("message.error.missing.tagname"));
uinotification.displayValidationError(i18n.getMessage("message.error.missing.tagname"));
}
}

View File

@@ -10,7 +10,7 @@ package org.eclipse.hawkbit.ui.components;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
import com.vaadin.ui.Label;
@@ -55,10 +55,10 @@ public class DistributionSetInfoPanel extends Panel {
*/
private void decorate(final DistributionSet distributionSet, final String caption, final String style1,
final String style2) {
final I18N i18n = SpringContextHelper.getBean(I18N.class);
final VaadinMessageSource i18n = SpringContextHelper.getBean(VaadinMessageSource.class);
final VerticalLayout layout = new VerticalLayout();
// Display distribution set name
layout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.get("label.dist.details.name"),
layout.addComponent(SPUIComponentProvider.createNameValueLabel(i18n.getMessage("label.dist.details.name"),
distributionSet.getName(), distributionSet.getVersion()));
/* Module info */

View File

@@ -19,7 +19,7 @@ import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -103,9 +103,9 @@ public class HawkbitUIErrorHandler extends DefaultErrorHandler {
final String errorMessage = extractMessageFrom(ex);
final I18N i18n = SpringContextHelper.getBean(I18N.class);
return new HawkbitErrorNotificationMessage(STYLE, i18n.get("caption.error"),
i18n.get("message.error.temp", errorMessage), false);
final VaadinMessageSource i18n = SpringContextHelper.getBean(VaadinMessageSource.class);
return new HawkbitErrorNotificationMessage(STYLE, i18n.getMessage("caption.error"),
i18n.getMessage("message.error.temp", errorMessage), false);
}
private String extractMessageFrom(final Throwable ex) {

View File

@@ -12,7 +12,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.hawkbit.ui.push.EventContainer;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.springframework.beans.factory.annotation.Autowired;
@@ -48,7 +48,7 @@ public class NotificationUnreadButton extends Button {
private AbstractNotificationView currentView;
private Window notificationsWindow;
private transient Map<Class<?>, NotificationUnreadValue> unreadNotifications;
private transient I18N i18n;
private transient VaadinMessageSource i18n;
/**
* Constructor.
@@ -57,7 +57,7 @@ public class NotificationUnreadButton extends Button {
* i18n
*/
@Autowired
NotificationUnreadButton(final I18N i18n) {
NotificationUnreadButton(final VaadinMessageSource i18n) {
this.i18n = i18n;
this.unreadNotifications = new ConcurrentHashMap<>();
setIcon(FontAwesome.BELL);
@@ -76,7 +76,7 @@ public class NotificationUnreadButton extends Button {
notificationsLayout.setMargin(true);
notificationsLayout.setSpacing(true);
final Label title = new Label(i18n.get(TITLE));
final Label title = new Label(i18n.getMessage(TITLE));
title.addStyleName(ValoTheme.LABEL_H3);
title.addStyleName(ValoTheme.LABEL_NO_MARGIN);
notificationsLayout.addComponent(title);
@@ -118,7 +118,7 @@ public class NotificationUnreadButton extends Button {
private void createNotification(final VerticalLayout notificationsLayout,
final NotificationUnreadValue notificationUnreadValue) {
final Label contentLabel = new Label(notificationUnreadValue.getUnreadNotifications() + " "
+ i18n.get(notificationUnreadValue.getUnreadNotificationMessageKey()));
+ i18n.getMessage(notificationUnreadValue.getUnreadNotificationMessageKey()));
notificationsLayout.addComponent(contentLabel);
}
@@ -172,7 +172,7 @@ public class NotificationUnreadButton extends Button {
setEnabled(true);
setCaption("<div class='" + STYLE_UNREAD_COUNTER + "'>" + unreadNotificationCounter + "</div>");
}
setDescription(i18n.get(DESCRIPTION, new Object[] { unreadNotificationCounter }));
setDescription(i18n.getMessage(DESCRIPTION, new Object[] { unreadNotificationCounter }));
}
private static class NotificationUnreadValue {

View File

@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.ui.components;
import java.util.Map;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
@@ -45,8 +45,8 @@ public class SPTargetAttributesLayout {
* @param controllerAttibs
*/
private void decorate(final Map<String, String> controllerAttibs) {
final I18N i18n = SpringContextHelper.getBean(I18N.class);
final Label title = new Label(i18n.get("label.target.controller.attrs"), ContentMode.HTML);
final VaadinMessageSource i18n = SpringContextHelper.getBean(VaadinMessageSource.class);
final Label title = new Label(i18n.getMessage("label.target.controller.attrs"), ContentMode.HTML);
title.addStyleName(SPUIDefinitions.TEXT_STYLE);
targetAttributesLayout.addComponent(title);
if (HawkbitCommonUtil.isNotNullOrEmpty(controllerAttibs)) {

View File

@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonDecorator;
import org.eclipse.hawkbit.ui.decorators.SPUIComboBoxDecorator;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -231,8 +231,8 @@ public final class SPUIComponentProvider {
* the entity
* @return the label
*/
public static Label createCreatedByLabel(final I18N i18n, final BaseEntity baseEntity) {
return createUsernameLabel(i18n.get("label.created.by"),
public static Label createCreatedByLabel(final VaadinMessageSource i18n, final BaseEntity baseEntity) {
return createUsernameLabel(i18n.getMessage("label.created.by"),
baseEntity == null ? StringUtils.EMPTY : baseEntity.getCreatedBy());
}
@@ -246,8 +246,8 @@ public final class SPUIComponentProvider {
* the entity
* @return the label
*/
public static Label createLastModifiedByLabel(final I18N i18n, final BaseEntity baseEntity) {
return createUsernameLabel(i18n.get("label.modified.by"),
public static Label createLastModifiedByLabel(final VaadinMessageSource i18n, final BaseEntity baseEntity) {
return createUsernameLabel(i18n.getMessage("label.modified.by"),
baseEntity == null ? StringUtils.EMPTY : baseEntity.getLastModifiedBy());
}

View File

@@ -40,7 +40,7 @@ import org.eclipse.hawkbit.ui.push.DistributionCreatedEventContainer;
import org.eclipse.hawkbit.ui.push.DistributionDeletedEventContainer;
import org.eclipse.hawkbit.ui.push.SoftwareModuleCreatedEventContainer;
import org.eclipse.hawkbit.ui.push.SoftwareModuleDeletedEventContainer;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.springframework.beans.factory.annotation.Autowired;
@@ -69,7 +69,7 @@ public class DistributionsView extends AbstractNotificationView implements Brows
private final SpPermissionChecker permChecker;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final UINotification uiNotification;
@@ -90,7 +90,7 @@ public class DistributionsView extends AbstractNotificationView implements Brows
private GridLayout mainLayout;
@Autowired
DistributionsView(final SpPermissionChecker permChecker, final UIEventBus eventBus, final I18N i18n,
DistributionsView(final SpPermissionChecker permChecker, final UIEventBus eventBus, final VaadinMessageSource i18n,
final UINotification uiNotification, final ManageDistUIState manageDistUIState,
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement,
final TargetManagement targetManagement, final EntityFactory entityFactory,
@@ -228,7 +228,7 @@ public class DistributionsView extends AbstractNotificationView implements Brows
private void checkNoDataAvaialble() {
if (manageDistUIState.isNoDataAvilableSwModule() && manageDistUIState.isNoDataAvailableDist()) {
uiNotification.displayValidationError(i18n.get("message.no.data"));
uiNotification.displayValidationError(i18n.getMessage("message.no.data"));
}
}

View File

@@ -33,7 +33,7 @@ import org.eclipse.hawkbit.ui.distributions.event.DistributionSetTypeEvent;
import org.eclipse.hawkbit.ui.distributions.event.DistributionSetTypeEvent.DistributionSetTypeEnum;
import org.eclipse.hawkbit.ui.layouts.CreateUpdateTypeLayout;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -103,7 +103,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
* @param distributionSetManagement
* DistributionSetManagement
*/
public CreateUpdateDistSetTypeLayout(final I18N i18n, final TagManagement tagManagement,
public CreateUpdateDistSetTypeLayout(final VaadinMessageSource i18n, final TagManagement tagManagement,
final EntityFactory entityFactory, final UIEventBus eventBus, final SpPermissionChecker permChecker,
final UINotification uiNotification, final SoftwareManagement softwareManagement,
final DistributionSetManagement distributionSetManagement) {
@@ -123,16 +123,16 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
typeKey = createTextField("textfield.key", SPUIDefinitions.DIST_SET_TYPE_KEY,
SPUIDefinitions.NEW_DISTRIBUTION_TYPE_KEY);
tagDesc = new TextAreaBuilder().caption(i18n.get("textfield.description"))
tagDesc = new TextAreaBuilder().caption(i18n.getMessage("textfield.description"))
.styleName(ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.DIST_SET_TYPE_DESC)
.prompt(i18n.get("textfield.description")).immediate(true)
.prompt(i18n.getMessage("textfield.description")).immediate(true)
.id(SPUIDefinitions.NEW_DISTRIBUTION_TYPE_DESC).buildTextComponent();
tagDesc.setNullRepresentation(StringUtils.EMPTY);
}
private TextField createTextField(final String in18Key, final String styleName, final String id) {
return new TextFieldBuilder().caption(i18n.get(in18Key)).styleName(ValoTheme.TEXTFIELD_TINY + " " + styleName)
.required(true).prompt(i18n.get(in18Key)).immediate(true).id(id).buildTextComponent();
return new TextFieldBuilder().caption(i18n.getMessage(in18Key)).styleName(ValoTheme.TEXTFIELD_TINY + " " + styleName)
.required(true).prompt(i18n.getMessage(in18Key)).immediate(true).id(id).buildTextComponent();
}
@Override
@@ -215,7 +215,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
addTooltTipToSelectedTable();
selectedTable.setImmediate(true);
selectedTable.setVisibleColumns(DIST_TYPE_NAME, DIST_TYPE_MANDATORY);
selectedTable.setColumnHeaders(i18n.get("header.dist.twintable.selected"), STAR);
selectedTable.setColumnHeaders(i18n.getMessage("header.dist.twintable.selected"), STAR);
selectedTable.setColumnExpandRatio(DIST_TYPE_NAME, 0.75F);
selectedTable.setColumnExpandRatio(DIST_TYPE_MANDATORY, 0.25F);
selectedTable.setRequired(true);
@@ -231,9 +231,9 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
final Item item = selectedTable.getItem(itemId);
final String description = (String) (item.getItemProperty(DIST_TYPE_DESCRIPTION).getValue());
if (DIST_TYPE_NAME.equals(propertyId) && HawkbitCommonUtil.trimAndNullIfEmpty(description) != null) {
return i18n.get("label.description") + description;
return i18n.getMessage("label.description") + description;
} else if (DIST_TYPE_MANDATORY.equals(propertyId)) {
return i18n.get("tooltip.check.for.mandatory");
return i18n.getMessage("tooltip.check.for.mandatory");
}
return null;
}
@@ -263,7 +263,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
sourceTable.setContainerDataSource(sourceTableContainer);
sourceTable.setVisibleColumns(new Object[] { DIST_TYPE_NAME });
sourceTable.setColumnHeaders(i18n.get("header.dist.twintable.available"));
sourceTable.setColumnHeaders(i18n.getMessage("header.dist.twintable.available"));
sourceTable.setColumnExpandRatio(DIST_TYPE_NAME, 1.0F);
getSourceTableData();
addTooltip();
@@ -335,7 +335,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
final Item item = sourceTable.getItem(itemId);
final String description = (String) item.getItemProperty(DIST_TYPE_DESCRIPTION).getValue();
if (DIST_TYPE_NAME.equals(propertyId) && HawkbitCommonUtil.trimAndNullIfEmpty(description) != null) {
return i18n.get("label.description") + description;
return i18n.getMessage("label.description") + description;
}
return null;
}
@@ -400,11 +400,11 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
final DistributionSetType newDistType = distributionSetManagement.createDistributionSetType(
entityFactory.distributionSetType().create().key(typeKeyValue).name(typeNameValue)
.description(typeDescValue).colour(colorPicked).mandatory(mandatory).optional(optional));
uiNotification.displaySuccess(i18n.get("message.save.success", new Object[] { newDistType.getName() }));
uiNotification.displaySuccess(i18n.getMessage("message.save.success", new Object[] { newDistType.getName() }));
eventBus.publish(this,
new DistributionSetTypeEvent(DistributionSetTypeEnum.ADD_DIST_SET_TYPE, newDistType));
} else {
uiNotification.displayValidationError(i18n.get("message.error.missing.typenameorkey"));
uiNotification.displayValidationError(i18n.getMessage("message.error.missing.typenameorkey"));
}
}
@@ -439,7 +439,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
final DistributionSetType updateDistSetType = distributionSetManagement.updateDistributionSetType(update);
uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { updateDistSetType.getName() }));
uiNotification.displaySuccess(i18n.getMessage("message.update.success", new Object[] { updateDistSetType.getName() }));
eventBus.publish(this,
new DistributionSetTypeEvent(DistributionSetTypeEnum.UPDATE_DIST_SET_TYPE, updateDistSetType));
@@ -534,7 +534,7 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
selectedTable.setEnabled(true);
} else {
uiNotification.displayValidationError(
selectedTypeTag.getName() + " " + i18n.get("message.error.dist.set.type.update"));
selectedTypeTag.getName() + " " + i18n.getMessage("message.error.dist.set.type.update"));
distTypeSelectLayout.setEnabled(false);
selectedTable.setEnabled(false);
}
@@ -592,12 +592,12 @@ public class CreateUpdateDistSetTypeLayout extends CreateUpdateTypeLayout<Distri
@Override
protected String getDuplicateKeyErrorMessage(final DistributionSetType existingType) {
return i18n.get("message.type.key.duplicate.check", new Object[] { existingType.getKey() });
return i18n.getMessage("message.type.key.duplicate.check", new Object[] { existingType.getKey() });
}
@Override
protected String getWindowCaption() {
return i18n.get("caption.add.type");
return i18n.getMessage("caption.add.type");
}
@Override

View File

@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.ui.common.CommonDialogWindow;
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -37,7 +37,7 @@ public class DSTypeFilterHeader extends AbstractFilterHeader {
private final CreateUpdateDistSetTypeLayout createUpdateDistSetTypeLayout;
DSTypeFilterHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
DSTypeFilterHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
final ManageDistUIState manageDistUIState, final TagManagement tagManagement,
final EntityFactory entityFactory, final UINotification uiNotification,
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement) {

View File

@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterLayout;
import org.eclipse.hawkbit.ui.dd.criteria.DistributionsViewClientCriterion;
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -32,7 +32,7 @@ public class DSTypeFilterLayout extends AbstractFilterLayout {
private final ManageDistUIState manageDistUIState;
public DSTypeFilterLayout(final ManageDistUIState manageDistUIState, final I18N i18n,
public DSTypeFilterLayout(final ManageDistUIState manageDistUIState, final VaadinMessageSource i18n,
final SpPermissionChecker permChecker, final UIEventBus eventBus, final TagManagement tagManagement,
final EntityFactory entityFactory, final UINotification uiNotification,
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement,

View File

@@ -39,7 +39,7 @@ import org.eclipse.hawkbit.ui.management.dstable.DistributionAddUpdateWindowLayo
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -90,7 +90,7 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
private Map<String, StringBuilder> assignedSWModule;
DistributionSetDetails(final I18N i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
DistributionSetDetails(final VaadinMessageSource i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
final ManageDistUIState manageDistUIState, final ManagementUIState managementUIState,
final DistributionAddUpdateWindowLayout distributionAddUpdateWindowLayout,
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement,
@@ -295,7 +295,7 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
detailsTabLayout.removeAllComponents();
if (type != null) {
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.dist.details.type"),
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.type"),
type);
typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
detailsTabLayout.addComponent(typeLabel);
@@ -303,15 +303,15 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
if (isMigrationRequired != null) {
detailsTabLayout.addComponent(SPUIComponentProvider.createNameValueLabel(
getI18n().get("checkbox.dist.migration.required"),
isMigrationRequired.equals(Boolean.TRUE) ? getI18n().get("label.yes") : getI18n().get("label.no")));
getI18n().getMessage("checkbox.dist.migration.required"),
isMigrationRequired.equals(Boolean.TRUE) ? getI18n().getMessage("label.yes") : getI18n().getMessage("label.no")));
}
}
@Override
protected void onEdit(final ClickEvent event) {
final Window newDistWindow = distributionAddUpdateWindowLayout.getWindow(getSelectedBaseEntityId());
newDistWindow.setCaption(getI18n().get(UIComponentIdProvider.DIST_UPDATE_CAPTION));
newDistWindow.setCaption(getI18n().getMessage(UIComponentIdProvider.DIST_UPDATE_CAPTION));
UI.getCurrent().addWindow(newDistWindow);
newDistWindow.setVisible(Boolean.TRUE);
}
@@ -334,18 +334,18 @@ public class DistributionSetDetails extends AbstractNamedVersionedEntityTableDet
@Override
protected String getDefaultCaption() {
return getI18n().get("distribution.details.header");
return getI18n().getMessage("distribution.details.header");
}
@Override
protected void addTabs(final TabSheet detailsTab) {
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
detailsTab.addTab(createSoftwareModuleTab(), getI18n().get("caption.softwares.distdetail.tab"), null);
detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.tab"), null);
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
detailsTab.addTab(dsMetadataTable, getI18n().get("caption.metadata"), null);
detailsTab.addTab(tfqDetailsTable, getI18n().get("caption.auto.assignment.ds"), null);
detailsTab.addTab(createDetailsLayout(), getI18n().getMessage("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().getMessage("caption.tab.description"), null);
detailsTab.addTab(createSoftwareModuleTab(), getI18n().getMessage("caption.softwares.distdetail.tab"), null);
detailsTab.addTab(createTagsLayout(), getI18n().getMessage("caption.tags.tab"), null);
detailsTab.addTab(createLogLayout(), getI18n().getMessage("caption.logs.tab"), null);
detailsTab.addTab(dsMetadataTable, getI18n().getMessage("caption.metadata"), null);
detailsTab.addTab(tfqDetailsTable, getI18n().getMessage("caption.auto.assignment.ds"), null);
}
@Override

View File

@@ -40,7 +40,7 @@ import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
import org.eclipse.hawkbit.ui.management.event.DistributionTableFilterEvent;
import org.eclipse.hawkbit.ui.push.DistributionSetUpdatedEventContainer;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -90,7 +90,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
private final DsMetadataPopupLayout dsMetadataPopupLayout;
DistributionSetTable(final UIEventBus eventBus, final I18N i18n, final UINotification notification,
DistributionSetTable(final UIEventBus eventBus, final VaadinMessageSource i18n, final UINotification notification,
final SpPermissionChecker permissionChecker, final ManageDistUIState manageDistUIState,
final DistributionSetManagement distributionSetManagement, final SoftwareManagement softwareManagement,
final DistributionsViewClientCriterion distributionsViewClientCriterion,
@@ -236,7 +236,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
protected boolean isDropValid(final DragAndDropEvent dragEvent) {
final Component compsource = dragEvent.getTransferable().getSourceComponent();
if (!(compsource instanceof Table)) {
notification.displayValidationError(i18n.get(ACTION_NOT_ALLOWED_MSG));
notification.displayValidationError(i18n.getMessage(ACTION_NOT_ALLOWED_MSG));
return false;
}
return super.isDropValid(dragEvent);
@@ -247,7 +247,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
.findDistributionSetById((Long) distId);
if (!distributionSet.isPresent()) {
notification.displayWarning(i18n.get("distributionset.not.exists"));
notification.displayWarning(i18n.getMessage("distributionset.not.exists"));
return;
}
@@ -335,7 +335,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
}
if (distributionSetManagement.isDistributionSetInUse(ds.get().getId())) {
notification.displayValidationError(i18n.get("message.error.notification.ds.target.assigned",
notification.displayValidationError(i18n.getMessage("message.error.notification.ds.target.assigned",
ds.get().getName(), ds.get().getVersion()));
return false;
}
@@ -345,14 +345,14 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
private boolean validateSoftwareModule(final SoftwareModule sm, final DistributionSet ds) {
if (targetManagement.countTargetByFilters(null, null, null, ds.getId(), Boolean.FALSE, new String[] {}) > 0) {
/* Distribution is already assigned */
notification.displayValidationError(i18n.get("message.dist.inuse",
notification.displayValidationError(i18n.getMessage("message.dist.inuse",
HawkbitCommonUtil.concatStrings(":", ds.getName(), ds.getVersion())));
return false;
}
if (ds.getModules().contains(sm)) {
/* Already has software module */
notification.displayValidationError(i18n.get("message.software.dist.already.assigned",
notification.displayValidationError(i18n.getMessage("message.software.dist.already.assigned",
HawkbitCommonUtil.concatStrings(":", ds.getName(), ds.getVersion()),
HawkbitCommonUtil.concatStrings(":", sm.getName(), sm.getVersion())));
return false;
@@ -360,7 +360,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
if (!ds.getType().containsModuleType(sm.getType())) {
/* Invalid type of the software module */
notification.displayValidationError(i18n.get("message.software.dist.type.notallowed",
notification.displayValidationError(i18n.getMessage("message.software.dist.type.notallowed",
HawkbitCommonUtil.concatStrings(":", sm.getName(), sm.getVersion()),
HawkbitCommonUtil.concatStrings(":", ds.getName(), ds.getVersion())));
return false;
@@ -377,7 +377,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
final Set<SoftwareModuleIdName> swModuleIdNames = entry.getValue();
for (final SoftwareModuleIdName swModuleIdName : swModuleIdNames) {
if ((sm.getName().concat(":" + sm.getVersion())).equals(swModuleIdName.getName())) {
notification.displayValidationError(i18n.get("message.software.already.dragged",
notification.displayValidationError(i18n.getMessage("message.software.already.dragged",
HawkbitCommonUtil.concatStrings(":", sm.getName(), sm.getVersion())));
return false;
}
@@ -488,7 +488,7 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
UIComponentIdProvider.DS_TABLE_MANAGE_METADATA_ID + "." + nameVersionStr, "", "", null, false,
FontAwesome.LIST_ALT, SPUIButtonStyleSmallNoBorder.class);
manageMetadataBtn.addStyleName(SPUIStyleDefinitions.ARTIFACT_DTLS_ICON);
manageMetadataBtn.setDescription(i18n.get("tooltip.metadata.icon"));
manageMetadataBtn.setDescription(i18n.getMessage("tooltip.metadata.icon"));
return manageMetadataBtn;
}

View File

@@ -16,7 +16,7 @@ import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.management.dstable.DistributionAddUpdateWindowLayout;
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
import org.eclipse.hawkbit.ui.management.event.DistributionTableFilterEvent;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -36,7 +36,7 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
private final DistributionAddUpdateWindowLayout addUpdateWindowLayout;
DistributionSetTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
DistributionSetTableHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
final ManageDistUIState manageDistUIstate, final DistributionAddUpdateWindowLayout addUpdateWindowLayout) {
super(i18n, permChecker, eventbus, null, manageDistUIstate, null);
this.addUpdateWindowLayout = addUpdateWindowLayout;
@@ -51,7 +51,7 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
@Override
protected String getHeaderCaption() {
return i18n.get("header.dist.table");
return i18n.getMessage("header.dist.table");
}
@Override
@@ -152,7 +152,7 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
@Override
protected void addNewItem(final ClickEvent event) {
final Window newDistWindow = addUpdateWindowLayout.getWindow(null);
newDistWindow.setCaption(i18n.get(UIComponentIdProvider.DIST_ADD_CAPTION));
newDistWindow.setCaption(i18n.getMessage(UIComponentIdProvider.DIST_ADD_CAPTION));
UI.getCurrent().addWindow(newDistWindow);
newDistWindow.setVisible(Boolean.TRUE);
}

View File

@@ -19,7 +19,7 @@ import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
import org.eclipse.hawkbit.ui.dd.criteria.DistributionsViewClientCriterion;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.management.dstable.DistributionAddUpdateWindowLayout;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -30,7 +30,7 @@ public class DistributionSetTableLayout extends AbstractTableLayout<Distribution
private static final long serialVersionUID = 6464291374980641235L;
public DistributionSetTableLayout(final I18N i18n, final UIEventBus eventBus,
public DistributionSetTableLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
final SpPermissionChecker permissionChecker, final ManageDistUIState manageDistUIState,
final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement,
final TargetManagement targetManagement, final EntityFactory entityFactory,

View File

@@ -18,7 +18,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSetMetadata;
import org.eclipse.hawkbit.repository.model.MetaData;
import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.common.AbstractMetadataPopupLayout;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.springframework.data.domain.PageRequest;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -36,7 +36,7 @@ public class DsMetadataPopupLayout extends AbstractMetadataPopupLayout<Distribut
private final transient EntityFactory entityFactory;
public DsMetadataPopupLayout(final I18N i18n, final UINotification uiNotification, final UIEventBus eventBus,
public DsMetadataPopupLayout(final VaadinMessageSource i18n, final UINotification uiNotification, final UIEventBus eventBus,
final DistributionSetManagement distributionSetManagement, final EntityFactory entityFactory,
final SpPermissionChecker permChecker) {
super(i18n, uiNotification, eventBus, permChecker);

View File

@@ -29,7 +29,7 @@ import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -61,7 +61,7 @@ public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
private final DistributionsViewClientCriterion distributionsViewClientCriterion;
public DSDeleteActionsLayout(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
public DSDeleteActionsLayout(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
final UINotification notification, final SystemManagement systemManagement,
final ManageDistUIState manageDistUIState,
final DistributionsViewClientCriterion distributionsViewClientCriterion,
@@ -106,7 +106,7 @@ public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
@Override
protected String getDeleteAreaLabel() {
return i18n.get("label.components.drop.area");
return i18n.getMessage("label.components.drop.area");
}
@Override
@@ -146,9 +146,9 @@ public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
SPUIDefinitions.DISTRIBUTION_SET_TYPE_ID_PREFIXS);
if (isDsTypeSelected(distTypeName)) {
notification
.displayValidationError(i18n.get("message.dist.type.check.delete", new Object[] { distTypeName }));
.displayValidationError(i18n.getMessage("message.dist.type.check.delete", new Object[] { distTypeName }));
} else if (isDefaultDsType(distTypeName)) {
notification.displayValidationError(i18n.get("message.cannot.delete.default.dstype"));
notification.displayValidationError(i18n.getMessage("message.cannot.delete.default.dstype"));
} else {
manageDistUIState.getSelectedDeleteDistSetTypes().add(distTypeName);
updateDSActionCount();
@@ -174,7 +174,7 @@ public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
&& manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType().get().getName()
.equalsIgnoreCase(swModuleTypeName)) {
notification.displayValidationError(
i18n.get("message.swmodule.type.check.delete", new Object[] { swModuleTypeName }));
i18n.getMessage("message.swmodule.type.check.delete", new Object[] { swModuleTypeName }));
} else {
manageDistUIState.getSelectedDeleteSWModuleTypes().add(swModuleTypeName);
updateDSActionCount();
@@ -189,7 +189,7 @@ public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
.findDistributionSetAllById(ids);
if (findDistributionSetAllById.isEmpty()) {
notification.displayWarning(i18n.get("distributionsets.not.exists"));
notification.displayWarning(i18n.getMessage("distributionsets.not.exists"));
return;
}
@@ -200,9 +200,9 @@ public class DSDeleteActionsLayout extends AbstractDeleteActionsLayout {
manageDistUIState.getDeletedDistributionList().addAll(distributionIdNameSet);
final int newDeletedDistributionsSize = manageDistUIState.getDeletedDistributionList().size();
if (newDeletedDistributionsSize == existingDeletedDistributionsSize) {
notification.displayValidationError(i18n.get("message.targets.already.deleted"));
notification.displayValidationError(i18n.getMessage("message.targets.already.deleted"));
} else if (newDeletedDistributionsSize - existingDeletedDistributionsSize != distributionIdNameSet.size()) {
notification.displayValidationError(i18n.get("message.dist.deleted.pending"));
notification.displayValidationError(i18n.getMessage("message.dist.deleted.pending"));
}
}

View File

@@ -29,7 +29,7 @@ import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -83,7 +83,7 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
private final ManageDistUIState manageDistUIState;
DistributionsConfirmationWindowLayout(final I18N i18n, final UIEventBus eventBus,
DistributionsConfirmationWindowLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
final DistributionSetManagement dsManagement, final SoftwareManagement softwareManagement,
final ManageDistUIState manageDistUIState) {
super(i18n, eventBus);
@@ -97,27 +97,27 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
final Map<String, ConfirmationTab> tabs = Maps.newHashMapWithExpectedSize(5);
/* Create tab for SW Modules delete */
if (!manageDistUIState.getDeleteSofwareModulesList().isEmpty()) {
tabs.put(i18n.get("caption.delete.swmodule.accordion.tab"), createSMDeleteConfirmationTab());
tabs.put(i18n.getMessage("caption.delete.swmodule.accordion.tab"), createSMDeleteConfirmationTab());
}
/* Create tab for SW Module Type delete */
if (!manageDistUIState.getSelectedDeleteSWModuleTypes().isEmpty()) {
tabs.put(i18n.get("caption.delete.sw.module.type.accordion.tab"), createSMtypeDeleteConfirmationTab());
tabs.put(i18n.getMessage("caption.delete.sw.module.type.accordion.tab"), createSMtypeDeleteConfirmationTab());
}
/* Create tab for Distributions delete */
if (!manageDistUIState.getDeletedDistributionList().isEmpty()) {
tabs.put(i18n.get("caption.delete.dist.accordion.tab"), createDistDeleteConfirmationTab());
tabs.put(i18n.getMessage("caption.delete.dist.accordion.tab"), createDistDeleteConfirmationTab());
}
/* Create tab for Distribution Set Types delete */
if (!manageDistUIState.getSelectedDeleteDistSetTypes().isEmpty()) {
tabs.put(i18n.get("caption.delete.dist.set.type.accordion.tab"), createDistSetTypeDeleteConfirmationTab());
tabs.put(i18n.getMessage("caption.delete.dist.set.type.accordion.tab"), createDistSetTypeDeleteConfirmationTab());
}
/* Create tab for Assign Software Module */
if (!manageDistUIState.getAssignedList().isEmpty()) {
tabs.put(i18n.get("caption.assign.dist.accordion.tab"), createAssignSWModuleConfirmationTab());
tabs.put(i18n.getMessage("caption.assign.dist.accordion.tab"), createAssignSWModuleConfirmationTab());
}
return tabs;
@@ -129,10 +129,10 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
tab.getConfirmAll().setId(UIComponentIdProvider.SW_DELETE_ALL);
tab.getConfirmAll().setIcon(FontAwesome.TRASH_O);
tab.getConfirmAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().addClickListener(event -> deleteSMAll(tab));
tab.getDiscardAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().addClickListener(event -> discardSMAll(tab));
/* Add items container to the table. */
@@ -145,8 +145,8 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
});
tab.getTable().setVisibleColumns(SW_MODULE_NAME_MSG, SW_DISCARD_CHGS);
tab.getTable().setColumnHeaders(i18n.get("upload.swModuleTable.header"),
i18n.get("header.second.deletetarget.table"));
tab.getTable().setColumnHeaders(i18n.getMessage("upload.swModuleTable.header"),
i18n.getMessage("header.second.deletetarget.table"));
tab.getTable().setColumnExpandRatio(SW_MODULE_NAME_MSG, SPUIDefinitions.TARGET_DISTRIBUTION_COLUMN_WIDTH);
tab.getTable().setColumnExpandRatio(SW_DISCARD_CHGS, SPUIDefinitions.DISCARD_COLUMN_WIDTH);
@@ -165,10 +165,10 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
eventBus.publish(this, new SoftwareModuleEvent(BaseEntityEventType.REMOVE_ENTITY, swmoduleIds));
addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.swModule.deleted", swmoduleIds.size()));
+ i18n.getMessage("message.swModule.deleted", swmoduleIds.size()));
manageDistUIState.getDeleteSofwareModulesList().clear();
removeCurrentTab(tab);
setActionMessage(i18n.get("message.software.delete.success"));
setActionMessage(i18n.getMessage("message.software.delete.success"));
eventBus.publish(this, SaveActionWindowEvent.DELETE_ALL_SOFWARE);
}
@@ -194,7 +194,7 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
private void discardSMAll(final ConfirmationTab tab) {
removeCurrentTab(tab);
manageDistUIState.getDeleteSofwareModulesList().clear();
setActionMessage(i18n.get("message.software.discard.success"));
setActionMessage(i18n.getMessage("message.software.discard.success"));
eventBus.publish(this, SaveActionWindowEvent.DISCARD_ALL_SOFTWARE);
}
@@ -239,10 +239,10 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
tab.getConfirmAll().setId(UIComponentIdProvider.SAVE_DELETE_SW_MODULE_TYPE);
tab.getConfirmAll().setIcon(FontAwesome.TRASH_O);
tab.getConfirmAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().addClickListener(event -> deleteSMtypeAll(tab));
tab.getDiscardAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().setId(UIComponentIdProvider.DISCARD_SW_MODULE_TYPE);
tab.getDiscardAll().addClickListener(event -> discardSMtypeAll(tab));
@@ -264,8 +264,8 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
});
tab.getTable().setVisibleColumns(SW_MODULE_TYPE_NAME, DISCARD);
tab.getTable().setColumnHeaders(i18n.get("header.first.delete.swmodule.type.table"),
i18n.get("header.second.delete.swmodule.type.table"));
tab.getTable().setColumnHeaders(i18n.getMessage("header.first.delete.swmodule.type.table"),
i18n.getMessage("header.second.delete.swmodule.type.table"));
tab.getTable().setColumnExpandRatio(SW_MODULE_TYPE_NAME, 2);
tab.getTable().setColumnExpandRatio(SW_DISCARD_CHGS, SPUIDefinitions.DISCARD_COLUMN_WIDTH);
@@ -281,17 +281,17 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
.ifPresent(softwareManagement::deleteSoftwareModuleType);
}
addToConsolitatedMsg(FontAwesome.TASKS.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.sw.module.type.delete", new Object[] { deleteSWModuleTypeCount }));
+ i18n.getMessage("message.sw.module.type.delete", new Object[] { deleteSWModuleTypeCount }));
manageDistUIState.getSelectedDeleteSWModuleTypes().clear();
removeCurrentTab(tab);
setActionMessage(i18n.get("message.software.type.delete.success"));
setActionMessage(i18n.getMessage("message.software.type.delete.success"));
eventBus.publish(this, SaveActionWindowEvent.SAVED_DELETE_SW_MODULE_TYPES);
}
private void discardSMtypeAll(final ConfirmationTab tab) {
removeCurrentTab(tab);
manageDistUIState.getSelectedDeleteSWModuleTypes().clear();
setActionMessage(i18n.get("message.software.type.discard.success"));
setActionMessage(i18n.getMessage("message.software.type.discard.success"));
eventBus.publish(this, SaveActionWindowEvent.DISCARD_ALL_DELETE_SW_MODULE_TYPES);
}
@@ -331,10 +331,10 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
tab.getConfirmAll().setId(UIComponentIdProvider.DIST_DELETE_ALL);
tab.getConfirmAll().setIcon(FontAwesome.TRASH_O);
tab.getConfirmAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().addClickListener(event -> deleteDistAll(tab));
tab.getDiscardAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().addClickListener(event -> discardDistAll(tab));
/* Add items container to the table. */
@@ -348,8 +348,8 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
});
tab.getTable().setVisibleColumns(DIST_NAME, DISCARD);
tab.getTable().setColumnHeaders(i18n.get("header.one.deletedist.table"),
i18n.get("header.second.deletedist.table"));
tab.getTable().setColumnHeaders(i18n.getMessage("header.one.deletedist.table"),
i18n.getMessage("header.second.deletedist.table"));
tab.getTable().setColumnExpandRatio(DIST_NAME, SPUIDefinitions.TARGET_DISTRIBUTION_COLUMN_WIDTH);
tab.getTable().setColumnExpandRatio(DISCARD, SPUIDefinitions.DISCARD_COLUMN_WIDTH);
@@ -375,7 +375,7 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
dsManagement.deleteDistributionSet(Lists.newArrayList(deletedIds));
addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.dist.deleted", deletedIds.length));
+ i18n.getMessage("message.dist.deleted", deletedIds.length));
manageDistUIState.getDeletedDistributionList()
.forEach(deletedIdname -> manageDistUIState.getAssignedList().remove(deletedIdname));
@@ -387,7 +387,7 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
private void discardDistAll(final ConfirmationTab tab) {
removeCurrentTab(tab);
manageDistUIState.getDeletedDistributionList().clear();
setActionMessage(i18n.get("message.dist.discard.success"));
setActionMessage(i18n.getMessage("message.dist.discard.success"));
eventBus.publish(this, SaveActionWindowEvent.DISCARD_ALL_DISTRIBUTIONS);
}
@@ -429,10 +429,10 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
tab.getConfirmAll().setId(UIComponentIdProvider.SAVE_DELETE_DIST_SET_TYPE);
tab.getConfirmAll().setIcon(FontAwesome.TRASH_O);
tab.getConfirmAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().addClickListener(event -> deleteDistSetTypeAll(tab));
tab.getDiscardAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().setId(UIComponentIdProvider.DISCARD_DIST_SET_TYPE);
tab.getDiscardAll().addClickListener(event -> discardDistSetTypeAll(tab));
@@ -448,8 +448,8 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
});
tab.getTable().setVisibleColumns(DIST_SET_NAME, DISCARD);
tab.getTable().setColumnHeaders(i18n.get("header.first.delete.dist.type.table"),
i18n.get("header.second.delete.dist.type.table"));
tab.getTable().setColumnHeaders(i18n.getMessage("header.first.delete.dist.type.table"),
i18n.getMessage("header.second.delete.dist.type.table"));
tab.getTable().setColumnExpandRatio(DIST_SET_NAME, 2);
tab.getTable().setColumnExpandRatio(DISCARD, SPUIDefinitions.DISCARD_COLUMN_WIDTH);
@@ -465,17 +465,17 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
.forEach(dsManagement::deleteDistributionSetType);
addToConsolitatedMsg(FontAwesome.TASKS.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.dist.type.delete", new Object[] { deleteDistTypeCount }));
+ i18n.getMessage("message.dist.type.delete", new Object[] { deleteDistTypeCount }));
manageDistUIState.getSelectedDeleteDistSetTypes().clear();
removeCurrentTab(tab);
setActionMessage(i18n.get("message.dist.set.type.deleted.success"));
setActionMessage(i18n.getMessage("message.dist.set.type.deleted.success"));
eventBus.publish(this, SaveActionWindowEvent.SAVED_DELETE_DIST_SET_TYPES);
}
private void discardDistSetTypeAll(final ConfirmationTab tab) {
removeCurrentTab(tab);
manageDistUIState.getSelectedDeleteDistSetTypes().clear();
setActionMessage(i18n.get("message.dist.type.discard.success"));
setActionMessage(i18n.getMessage("message.dist.type.discard.success"));
eventBus.publish(this, SaveActionWindowEvent.DISCARD_ALL_DELETE_DIST_SET_TYPES);
}
@@ -517,10 +517,10 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
assignmnetTab.getConfirmAll().setId(UIComponentIdProvider.SAVE_ASSIGNMENT);
assignmnetTab.getConfirmAll().setIcon(FontAwesome.SAVE);
assignmnetTab.getConfirmAll().setCaption(i18n.get("button.assign.all"));
assignmnetTab.getConfirmAll().setCaption(i18n.getMessage("button.assign.all"));
assignmnetTab.getConfirmAll().addClickListener(event -> saveAllAssignments(assignmnetTab));
assignmnetTab.getDiscardAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
assignmnetTab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
assignmnetTab.getDiscardAll().setId(UIComponentIdProvider.DISCARD_ASSIGNMENT);
assignmnetTab.getDiscardAll().addClickListener(event -> discardAllSWAssignments(assignmnetTab));
@@ -542,8 +542,8 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
});
assignmnetTab.getTable().setVisibleColumns(DIST_NAME, SOFTWARE_MODULE_NAME, DISCARD);
assignmnetTab.getTable().setColumnHeaders(i18n.get("header.dist.first.assignment.table"),
i18n.get("header.dist.second.assignment.table"), i18n.get("header.third.assignment.table"));
assignmnetTab.getTable().setColumnHeaders(i18n.getMessage("header.dist.first.assignment.table"),
i18n.getMessage("header.dist.second.assignment.table"), i18n.getMessage("header.third.assignment.table"));
assignmnetTab.getTable().setColumnExpandRatio(DIST_NAME, 2);
assignmnetTab.getTable().setColumnExpandRatio(SOFTWARE_MODULE_NAME, 2);
@@ -593,7 +593,7 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
count += entry.getValue().size();
}
addToConsolitatedMsg(FontAwesome.TASKS.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.software.assignment", new Object[] { count }));
+ i18n.getMessage("message.software.assignment", new Object[] { count }));
manageDistUIState.getAssignedList().clear();
manageDistUIState.getConsolidatedDistSoftwarewList().clear();
removeCurrentTab(tab);
@@ -604,7 +604,7 @@ public class DistributionsConfirmationWindowLayout extends AbstractConfirmationW
removeCurrentTab(tab);
manageDistUIState.getAssignedList().clear();
manageDistUIState.getConsolidatedDistSoftwarewList().clear();
setActionMessage(i18n.get("message.assign.discard.success"));
setActionMessage(i18n.getMessage("message.assign.discard.success"));
eventBus.publish(this, SaveActionWindowEvent.DISCARD_ALL_ASSIGNMENTS);
}

View File

@@ -20,7 +20,7 @@ import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.common.AbstractMetadataPopupLayout;
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent;
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent.MetadataUIEvent;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -35,7 +35,7 @@ public class SwMetadataPopupLayout extends AbstractMetadataPopupLayout<SoftwareM
private final transient EntityFactory entityFactory;
public SwMetadataPopupLayout(final I18N i18n, final UINotification uiNotification, final UIEventBus eventBus,
public SwMetadataPopupLayout(final VaadinMessageSource i18n, final UINotification uiNotification, final UIEventBus eventBus,
final SoftwareManagement softwareManagement, final EntityFactory entityFactory,
final SpPermissionChecker permChecker) {
super(i18n, uiNotification, eventBus, permChecker);

View File

@@ -22,7 +22,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.distributions.event.MetadataEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -53,7 +53,7 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
private final SoftwareModuleMetadatadetailslayout swmMetadataTable;
SwModuleDetails(final I18N i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
SwModuleDetails(final VaadinMessageSource i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow,
final ManageDistUIState manageDistUIState, final SoftwareManagement softwareManagement,
final SwMetadataPopupLayout swMetadataPopupLayout, final EntityFactory entityFactory) {
@@ -101,7 +101,7 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
protected void onEdit(final ClickEvent event) {
final Window addSoftwareModule = softwareModuleAddUpdateWindow
.createUpdateSoftwareModuleWindow(getSelectedBaseEntityId());
addSoftwareModule.setCaption(getI18n().get("upload.caption.update.swmodule"));
addSoftwareModule.setCaption(getI18n().getMessage("upload.caption.update.swmodule"));
UI.getCurrent().addWindow(addSoftwareModule);
addSoftwareModule.setVisible(Boolean.TRUE);
}
@@ -113,15 +113,15 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
@Override
protected void addTabs(final TabSheet detailsTab) {
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
detailsTab.addTab(swmMetadataTable, getI18n().get("caption.metadata"), null);
detailsTab.addTab(createDetailsLayout(), getI18n().getMessage("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().getMessage("caption.tab.description"), null);
detailsTab.addTab(createLogLayout(), getI18n().getMessage("caption.logs.tab"), null);
detailsTab.addTab(swmMetadataTable, getI18n().getMessage("caption.metadata"), null);
}
@Override
protected String getDefaultCaption() {
return getI18n().get("upload.swModuleTable.header");
return getI18n().getMessage("upload.swModuleTable.header");
}
@Override
@@ -148,9 +148,9 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
if (getSelectedBaseEntity() != null) {
String maxAssign;
if (getSelectedBaseEntity().getType().getMaxAssignments() == 1) {
maxAssign = getI18n().get("label.singleAssign.type");
maxAssign = getI18n().getMessage("label.singleAssign.type");
} else {
maxAssign = getI18n().get("label.multiAssign.type");
maxAssign = getI18n().getMessage("label.multiAssign.type");
}
updateSwModuleDetailsLayout(getSelectedBaseEntity().getType().getName(),
getSelectedBaseEntity().getVendor(), maxAssign);
@@ -164,19 +164,19 @@ public class SwModuleDetails extends AbstractNamedVersionedEntityTableDetailsLay
final VerticalLayout detailsTabLayout = getDetailsLayout();
detailsTabLayout.removeAllComponents();
final Label vendorLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.dist.details.vendor"),
final Label vendorLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.vendor"),
HawkbitCommonUtil.trimAndNullIfEmpty(vendor) == null ? "" : vendor);
vendorLabel.setId(UIComponentIdProvider.DETAILS_VENDOR_LABEL_ID);
detailsTabLayout.addComponent(vendorLabel);
if (type != null) {
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.dist.details.type"),
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.type"),
type);
typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
detailsTabLayout.addComponent(typeLabel);
}
final Label assignLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.assigned.type"),
final Label assignLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.assigned.type"),
HawkbitCommonUtil.trimAndNullIfEmpty(maxAssign) == null ? "" : maxAssign);
assignLabel.setId(UIComponentIdProvider.SWM_DTLS_MAX_ASSIGN);
detailsTabLayout.addComponent(assignLabel);

View File

@@ -32,7 +32,7 @@ import org.eclipse.hawkbit.ui.distributions.event.SaveActionWindowEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.push.SoftwareModuleUpdatedEventContainer;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -79,7 +79,7 @@ public class SwModuleTable extends AbstractNamedVersionTable<SoftwareModule, Lon
private final SwMetadataPopupLayout swMetadataPopupLayout;
SwModuleTable(final UIEventBus eventBus, final I18N i18n, final UINotification uiNotification,
SwModuleTable(final UIEventBus eventBus, final VaadinMessageSource i18n, final UINotification uiNotification,
final ManageDistUIState manageDistUIState, final SoftwareManagement softwareManagement,
final DistributionsViewClientCriterion distributionsViewClientCriterion,
final ArtifactManagement artifactManagement, final SwMetadataPopupLayout swMetadataPopupLayout,
@@ -271,7 +271,7 @@ public class SwModuleTable extends AbstractNamedVersionTable<SoftwareModule, Lon
protected List<TableColumn> getTableVisibleColumns() {
final List<TableColumn> columnList = super.getTableVisibleColumns();
if (isMaximized()) {
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VENDOR, i18n.get("header.vendor"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VENDOR, i18n.getMessage("header.vendor"), 0.1F));
} else {
columnList.add(new TableColumn(SPUILabelDefinitions.ARTIFACT_ICON, "", 0.1F));
}
@@ -346,7 +346,7 @@ public class SwModuleTable extends AbstractNamedVersionTable<SoftwareModule, Lon
UIComponentIdProvider.SW_TABLE_ATRTIFACT_DETAILS_ICON + "." + nameVersionStr, "", "", null, false,
FontAwesome.FILE_O, SPUIButtonStyleSmallNoBorder.class);
showArtifactDtlsBtn.addStyleName(SPUIStyleDefinitions.ARTIFACT_DTLS_ICON);
showArtifactDtlsBtn.setDescription(i18n.get("tooltip.artifact.icon"));
showArtifactDtlsBtn.setDescription(i18n.getMessage("tooltip.artifact.icon"));
return showArtifactDtlsBtn;
}
@@ -355,7 +355,7 @@ public class SwModuleTable extends AbstractNamedVersionTable<SoftwareModule, Lon
UIComponentIdProvider.SW_TABLE_MANAGE_METADATA_ID + "." + nameVersionStr, "", "", null, false,
FontAwesome.LIST_ALT, SPUIButtonStyleSmallNoBorder.class);
manageMetadataBtn.addStyleName(SPUIStyleDefinitions.ARTIFACT_DTLS_ICON);
manageMetadataBtn.setDescription(i18n.get("tooltip.metadata.icon"));
manageMetadataBtn.setDescription(i18n.getMessage("tooltip.metadata.icon"));
return manageMetadataBtn;
}

View File

@@ -16,7 +16,7 @@ import org.eclipse.hawkbit.ui.common.table.AbstractTableHeader;
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -37,7 +37,7 @@ public class SwModuleTableHeader extends AbstractTableHeader {
private final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow;
SwModuleTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
SwModuleTableHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
final ManageDistUIState manageDistUIstate,
final SoftwareModuleAddUpdateWindow softwareModuleAddUpdateWindow) {
super(i18n, permChecker, eventbus, null, manageDistUIstate, null);
@@ -53,7 +53,7 @@ public class SwModuleTableHeader extends AbstractTableHeader {
@Override
protected String getHeaderCaption() {
return i18n.get("upload.swModuleTable.header");
return i18n.getMessage("upload.swModuleTable.header");
}
@Override
@@ -149,7 +149,7 @@ public class SwModuleTableHeader extends AbstractTableHeader {
@Override
protected void addNewItem(final ClickEvent event) {
final Window addSoftwareModule = softwareModuleAddUpdateWindow.createAddSoftwareModuleWindow();
addSoftwareModule.setCaption(i18n.get("upload.caption.add.new.swmodule"));
addSoftwareModule.setCaption(i18n.getMessage("upload.caption.add.new.swmodule"));
UI.getCurrent().addWindow(addSoftwareModule);
addSoftwareModule.setVisible(Boolean.TRUE);
}

View File

@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.ui.artifacts.state.ArtifactUploadState;
import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
import org.eclipse.hawkbit.ui.dd.criteria.DistributionsViewClientCriterion;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -28,7 +28,7 @@ public class SwModuleTableLayout extends AbstractTableLayout<SwModuleTable> {
private static final long serialVersionUID = 6464291374980641235L;
public SwModuleTableLayout(final I18N i18n, final UINotification uiNotification, final UIEventBus eventBus,
public SwModuleTableLayout(final VaadinMessageSource i18n, final UINotification uiNotification, final UIEventBus eventBus,
final SoftwareManagement softwareManagement, final EntityFactory entityFactory,
final ManageDistUIState manageDistUIState, final SpPermissionChecker permChecker,
final DistributionsViewClientCriterion distributionsViewClientCriterion,

View File

@@ -16,7 +16,7 @@ import org.eclipse.hawkbit.ui.artifacts.smtype.CreateUpdateSoftwareTypeLayout;
import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -36,7 +36,7 @@ public class DistSMTypeFilterHeader extends AbstractFilterHeader {
private final ManageDistUIState manageDistUIState;
private final CreateUpdateSoftwareTypeLayout createUpdateSWTypeLayout;
DistSMTypeFilterHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
DistSMTypeFilterHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
final ManageDistUIState manageDistUIState, final TagManagement tagManagement,
final EntityFactory entityFactory, final UINotification uiNotification,
final SoftwareManagement swTypeManagementService) {

View File

@@ -16,7 +16,7 @@ import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterLayout;
import org.eclipse.hawkbit.ui.dd.criteria.DistributionsViewClientCriterion;
import org.eclipse.hawkbit.ui.distributions.event.DistributionsUIEvent;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -31,7 +31,7 @@ public class DistSMTypeFilterLayout extends AbstractFilterLayout {
private final ManageDistUIState manageDistUIState;
public DistSMTypeFilterLayout(final UIEventBus eventBus, final I18N i18n, final SpPermissionChecker permChecker,
public DistSMTypeFilterLayout(final UIEventBus eventBus, final VaadinMessageSource i18n, final SpPermissionChecker permChecker,
final ManageDistUIState manageDistUIState, final TagManagement tagManagement,
final EntityFactory entityFactory, final UINotification uiNotification,
final SoftwareManagement softwareManagement,

View File

@@ -22,7 +22,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -57,7 +57,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private static final String BREADCRUMB_CUSTOM_FILTERS = "breadcrumb.target.filter.custom.filters";
private final I18N i18n;
private final VaadinMessageSource i18n;
private final transient EventBus.UIEventBus eventBus;
@@ -105,7 +105,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private LayoutClickListener nameLayoutClickListner;
CreateOrUpdateFilterHeader(final I18N i18n, final UIEventBus eventBus,
CreateOrUpdateFilterHeader(final VaadinMessageSource i18n, final UIEventBus eventBus,
final FilterManagementUIState filterManagementUIState,
final TargetFilterQueryManagement targetFilterQueryManagement, final SpPermissionChecker permissionChecker,
final UINotification notification, final UiProperties uiProperties, final EntityFactory entityFactory,
@@ -193,16 +193,16 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
final Button createFilterViewLink = SPUIComponentProvider.getButton(null, "", "", null, false, null,
SPUIButtonStyleSmallNoBorder.class);
createFilterViewLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links");
createFilterViewLink.setDescription(i18n.get(BREADCRUMB_CUSTOM_FILTERS));
createFilterViewLink.setCaption(i18n.get(BREADCRUMB_CUSTOM_FILTERS));
createFilterViewLink.setDescription(i18n.getMessage(BREADCRUMB_CUSTOM_FILTERS));
createFilterViewLink.setCaption(i18n.getMessage(BREADCRUMB_CUSTOM_FILTERS));
createFilterViewLink.addClickListener(value -> showCustomFiltersView());
return createFilterViewLink;
}
private TextField createNameTextField() {
final TextField nameField = new TextFieldBuilder().caption(i18n.get("textfield.customfiltername"))
.prompt(i18n.get("textfield.customfiltername")).immediate(true)
final TextField nameField = new TextFieldBuilder().caption(i18n.getMessage("textfield.customfiltername"))
.prompt(i18n.getMessage("textfield.customfiltername")).immediate(true)
.id(UIComponentIdProvider.CUSTOM_FILTER_ADD_NAME).buildTextComponent();
nameField.setPropertyDataSource(nameLabel);
nameField.addTextChangeListener(this::onFilterNameChange);
@@ -241,7 +241,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private void buildLayout() {
captionLayout = new HorizontalLayout();
captionLayout.setDescription(i18n.get("tooltip.click.to.edit"));
captionLayout.setDescription(i18n.getMessage("tooltip.click.to.edit"));
captionLayout.setId(UIComponentIdProvider.TARGET_FILTER_QUERY_NAME_LAYOUT_ID);
titleFilterIconsLayout = new HorizontalLayout();
@@ -371,7 +371,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement.createTargetFilterQuery(entityFactory
.targetFilterQuery().create().name(nameTextField.getValue()).query(queryTextField.getValue()));
notification.displaySuccess(
i18n.get("message.create.filter.success", new Object[] { targetFilterQuery.getName() }));
i18n.getMessage("message.create.filter.success", new Object[] { targetFilterQuery.getName() }));
eventBus.publish(this, CustomFilterUIEvent.CREATE_TARGET_FILTER_QUERY);
}
@@ -387,7 +387,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
filterManagementUIState.setTfQuery(updatedTargetFilter);
oldFilterName = nameTextField.getValue();
oldFilterQuery = queryTextField.getValue();
notification.displaySuccess(i18n.get("message.update.filter.success"));
notification.displaySuccess(i18n.getMessage("message.update.filter.success"));
eventBus.publish(this, CustomFilterUIEvent.UPDATED_TARGET_FILTER_QUERY);
}
@@ -401,7 +401,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private boolean doesAlreadyExists() {
if (targetFilterQueryManagement.findTargetFilterQueryByName(nameTextField.getValue()).isPresent()) {
notification.displayValidationError(i18n.get("message.target.filter.duplicate", nameTextField.getValue()));
notification.displayValidationError(i18n.getMessage("message.target.filter.duplicate", nameTextField.getValue()));
return true;
}
return false;
@@ -410,7 +410,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private boolean manadatoryFieldsPresent() {
if (Strings.isNullOrEmpty(nameTextField.getValue())
|| Strings.isNullOrEmpty(filterManagementUIState.getFilterQueryValue())) {
notification.displayValidationError(i18n.get("message.target.filter.validation"));
notification.displayValidationError(i18n.getMessage("message.target.filter.validation"));
return false;
}
return true;

View File

@@ -19,7 +19,7 @@ import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.AssignInstalledDSTooltipGenerator;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -53,7 +53,7 @@ public class CreateOrUpdateFilterTable extends Table {
private static final long serialVersionUID = 6887304217281629713L;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final FilterManagementUIState filterManagementUIState;
@@ -67,7 +67,7 @@ public class CreateOrUpdateFilterTable extends Table {
private static final String INSTALL_DIST_SET = "installedDistributionSet";
CreateOrUpdateFilterTable(final I18N i18n, final UIEventBus eventBus,
CreateOrUpdateFilterTable(final VaadinMessageSource i18n, final UIEventBus eventBus,
final FilterManagementUIState filterManagementUIState) {
this.i18n = i18n;
this.filterManagementUIState = filterManagementUIState;
@@ -180,14 +180,14 @@ public class CreateOrUpdateFilterTable extends Table {
private List<TableColumn> getVisbleColumns() {
final List<TableColumn> columnList = Lists.newArrayListWithExpectedSize(7);
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.get("header.name"), 0.15F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.get("header.createdBy"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.getMessage("header.name"), 0.15F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.getMessage("header.createdBy"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.getMessage("header.createdDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.getMessage("header.modifiedBy"), 0.1F));
columnList.add(
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.get("header.description"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.STATUS_ICON, i18n.get("header.status"), 0.1F));
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.getMessage("header.modifiedDate"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.getMessage("header.description"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.STATUS_ICON, i18n.getMessage("header.status"), 0.1F));
return columnList;
}
@@ -207,7 +207,7 @@ public class CreateOrUpdateFilterTable extends Table {
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE);
label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml());
} else if (targetStatus == TargetUpdateStatus.ERROR) {
label.setDescription(i18n.get("label.error"));
label.setDescription(i18n.getMessage("label.error"));
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_RED);
label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
} else if (targetStatus == TargetUpdateStatus.IN_SYNC) {
@@ -216,7 +216,7 @@ public class CreateOrUpdateFilterTable extends Table {
label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
} else if (targetStatus == TargetUpdateStatus.UNKNOWN) {
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE);
label.setDescription(i18n.get("label.unknown"));
label.setDescription(i18n.getMessage("label.unknown"));
label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml());
}
return label;

View File

@@ -24,7 +24,7 @@ import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.ProxyTarget;
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
@@ -48,7 +48,7 @@ public class CustomTargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
private Sort sort = new Sort(Direction.ASC, "id");
private transient TargetManagement targetManagement;
private FilterManagementUIState filterManagementUIState;
private transient I18N i18N;
private transient VaadinMessageSource i18N;
private String filterQuery;
/**
@@ -159,9 +159,9 @@ public class CustomTargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
return filterManagementUIState;
}
private I18N getI18N() {
private VaadinMessageSource getI18N() {
if (i18N == null) {
i18N = SpringContextHelper.getBean(I18N.class);
i18N = SpringContextHelper.getBean(VaadinMessageSource.class);
}
return i18N;
}

View File

@@ -17,7 +17,7 @@ import org.eclipse.hawkbit.repository.event.remote.DistributionSetDeletedEvent;
import org.eclipse.hawkbit.repository.event.remote.entity.DistributionSetCreatedEvent;
import org.eclipse.hawkbit.ui.distributions.dstable.ManageDistBeanQuery;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn;
@@ -40,13 +40,13 @@ public class DistributionSetSelectTable extends Table {
private static final long serialVersionUID = -4307487829435471759L;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final ManageDistUIState manageDistUIState;
private Container container;
DistributionSetSelectTable(final I18N i18n, final UIEventBus eventBus, final ManageDistUIState manageDistUIState) {
DistributionSetSelectTable(final VaadinMessageSource i18n, final UIEventBus eventBus, final ManageDistUIState manageDistUIState) {
this.i18n = i18n;
this.manageDistUIState = manageDistUIState;
setStyleName("sp-table");
@@ -98,8 +98,8 @@ public class DistributionSetSelectTable extends Table {
private List<TableColumn> getVisbleColumns() {
final List<TableColumn> columnList = new ArrayList<>(2);
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.get("header.name"), 0.6F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.4F));
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.getMessage("header.name"), 0.6F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.getMessage("header.version"), 0.4F));
return columnList;
}

View File

@@ -21,7 +21,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorderWithIcon;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.vaadin.spring.events.EventBus;
@@ -48,7 +48,7 @@ public class DistributionSetSelectWindow
private static final long serialVersionUID = 4752345414134989396L;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final DistributionSetSelectTable dsTable;
@@ -62,7 +62,7 @@ public class DistributionSetSelectWindow
private CheckBox checkBox;
private Long tfqId;
DistributionSetSelectWindow(final I18N i18n, final UIEventBus eventBus, final TargetManagement targetManagement,
DistributionSetSelectWindow(final VaadinMessageSource i18n, final UIEventBus eventBus, final TargetManagement targetManagement,
final TargetFilterQueryManagement targetFilterQueryManagement, final ManageDistUIState manageDistUIState) {
this.i18n = i18n;
this.dsTable = new DistributionSetSelectTable(i18n, eventBus, manageDistUIState);
@@ -72,9 +72,9 @@ public class DistributionSetSelectWindow
}
private void initLocal() {
final Label label = new Label(i18n.get("label.auto.assign.description"));
final Label label = new Label(i18n.getMessage("label.auto.assign.description"));
checkBox = new CheckBox(i18n.get("label.auto.assign.enable"));
checkBox = new CheckBox(i18n.getMessage("label.auto.assign.enable"));
checkBox.setId(UIComponentIdProvider.DIST_SET_SELECT_ENABLE_ID);
checkBox.setImmediate(true);
checkBox.addValueChangeListener(this);
@@ -85,7 +85,7 @@ public class DistributionSetSelectWindow
verticalLayout.addComponent(dsTable);
window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW)
.caption(i18n.get("caption.select.auto.assign.dist")).content(verticalLayout).layout(verticalLayout)
.caption(i18n.getMessage("caption.select.auto.assign.dist")).content(verticalLayout).layout(verticalLayout)
.i18n(i18n).saveDialogCloseListener(this).buildCommonDialogWindow();
window.setId(UIComponentIdProvider.DIST_SET_SELECT_WINDOW_ID);
}
@@ -212,7 +212,7 @@ public class DistributionSetSelectWindow
public ConfirmConsequencesDialog(final TargetFilterQuery targetFilterQuery, final Long dsId,
final ConfirmCallback callback) {
super(i18n.get("caption.confirm.assign.consequences"));
super(i18n.getMessage("caption.confirm.assign.consequences"));
this.callback = callback;
this.targetFilterQuery = targetFilterQuery;
@@ -236,10 +236,10 @@ public class DistributionSetSelectWindow
targetFilterQuery.getQuery());
Label mainTextLabel;
if (targetsCount == 0) {
mainTextLabel = new Label(i18n.get("message.confirm.assign.consequences.none"));
mainTextLabel = new Label(i18n.getMessage("message.confirm.assign.consequences.none"));
} else {
mainTextLabel = new Label(
i18n.get("message.confirm.assign.consequences.text", new Object[] { targetsCount }));
i18n.getMessage("message.confirm.assign.consequences.text", new Object[] { targetsCount }));
}
layout.addComponent(mainTextLabel);
@@ -250,7 +250,7 @@ public class DistributionSetSelectWindow
buttonsLayout.addStyleName("actionButtonsMargin");
layout.addComponent(buttonsLayout);
okButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SAVE_BUTTON, i18n.get("button.ok"), "", "",
okButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SAVE_BUTTON, i18n.getMessage("button.ok"), "", "",
true, FontAwesome.SAVE, SPUIButtonStyleNoBorderWithIcon.class);
okButton.setSizeUndefined();
okButton.addStyleName("default-color");
@@ -260,7 +260,7 @@ public class DistributionSetSelectWindow
buttonsLayout.setExpandRatio(okButton, 1.0F);
final Button cancelButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CANCEL_BUTTON,
i18n.get("button.cancel"), "", "", true, FontAwesome.TIMES, SPUIButtonStyleNoBorderWithIcon.class);
i18n.getMessage("button.cancel"), "", "", true, FontAwesome.TIMES, SPUIButtonStyleNoBorderWithIcon.class);
cancelButton.setSizeUndefined();
cancelButton.addStyleName("default-color");
cancelButton.addClickListener(this);

View File

@@ -21,7 +21,7 @@ import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.filtermanagement.footer.TargetFilterCountMessageLabel;
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.springframework.beans.factory.annotation.Autowired;
@@ -65,7 +65,7 @@ public class FilterManagementView extends VerticalLayout implements View {
private final transient EventBus.UIEventBus eventBus;
@Autowired
FilterManagementView(final I18N i18n, final UIEventBus eventBus,
FilterManagementView(final VaadinMessageSource i18n, final UIEventBus eventBus,
final FilterManagementUIState filterManagementUIState,
final TargetFilterQueryManagement targetFilterQueryManagement, final SpPermissionChecker permissionChecker,
final UINotification notification, final UiProperties uiProperties, final EntityFactory entityFactory,

View File

@@ -22,7 +22,7 @@ import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn;
@@ -55,7 +55,7 @@ public class TargetFilterTable extends Table {
private static final long serialVersionUID = -4307487829435474759L;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final UINotification notification;
@@ -71,7 +71,7 @@ public class TargetFilterTable extends Table {
private static final int PROPERTY_DEPT = 3;
public TargetFilterTable(final I18N i18n, final UINotification notification, final UIEventBus eventBus,
public TargetFilterTable(final VaadinMessageSource i18n, final UINotification notification, final UIEventBus eventBus,
final FilterManagementUIState filterManagementUIState,
final TargetFilterQueryManagement targetFilterQueryManagement, final ManageDistUIState manageDistUIState,
final TargetManagement targetManagement) {
@@ -140,14 +140,14 @@ public class TargetFilterTable extends Table {
private List<TableColumn> getVisbleColumns() {
final List<TableColumn> columnList = new ArrayList<>(7);
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.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.2F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.2F));
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.getMessage("header.name"), 0.2F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_USER, i18n.getMessage("header.createdBy"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.getMessage("header.createdDate"), 0.2F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_MODIFIED_BY, i18n.getMessage("header.modifiedBy"), 0.1F));
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_MODIFIED_DATE, i18n.getMessage("header.modifiedDate"), 0.2F));
columnList.add(new TableColumn(SPUILabelDefinitions.AUTO_ASSIGN_DISTRIBUTION_SET,
i18n.get("header.auto.assignment.ds"), 0.1F));
columnList.add(new TableColumn(SPUIDefinitions.CUSTOM_FILTER_DELETE, i18n.get("header.delete"), 0.1F));
i18n.getMessage("header.auto.assignment.ds"), 0.1F));
columnList.add(new TableColumn(SPUIDefinitions.CUSTOM_FILTER_DELETE, i18n.getMessage("header.delete"), 0.1F));
return columnList;
}
@@ -175,8 +175,8 @@ public class TargetFilterTable extends Table {
private void onDelete(final ClickEvent event) {
/* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.filter.delete.confirmbox"),
i18n.get("message.delete.filter.confirm"), i18n.get("button.ok"), i18n.get("button.cancel"), ok -> {
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.getMessage("caption.filter.delete.confirmbox"),
i18n.getMessage("message.delete.filter.confirm"), i18n.getMessage("button.ok"), i18n.getMessage("button.cancel"), ok -> {
if (ok) {
final Long rowId = (Long) ((Button) event.getComponent()).getData();
final String deletedFilterName = targetFilterQueryManagement.findTargetFilterQueryById(rowId)
@@ -189,7 +189,7 @@ public class TargetFilterTable extends Table {
*/
notification.displaySuccess(
i18n.get("message.delete.filter.success", new Object[] { deletedFilterName }));
i18n.getMessage("message.delete.filter.success", new Object[] { deletedFilterName }));
refreshContainer();
}
});
@@ -228,11 +228,11 @@ public class TargetFilterTable extends Table {
final String buttonId = "distSetButton";
Button updateIcon;
if (distSet == null) {
updateIcon = SPUIComponentProvider.getButton(buttonId, i18n.get("button.no.auto.assignment"),
i18n.get("button.auto.assignment.desc"), null, false, null, SPUIButtonStyleSmallNoBorder.class);
updateIcon = SPUIComponentProvider.getButton(buttonId, i18n.getMessage("button.no.auto.assignment"),
i18n.getMessage("button.auto.assignment.desc"), null, false, null, SPUIButtonStyleSmallNoBorder.class);
} else {
updateIcon = SPUIComponentProvider.getButton(buttonId, distSet.getNameVersion(),
i18n.get("button.auto.assignment.desc"), null, false, null, SPUIButtonStyleSmallNoBorder.class);
i18n.getMessage("button.auto.assignment.desc"), null, false, null, SPUIButtonStyleSmallNoBorder.class);
}
updateIcon.addClickListener(this::onClickOfDistributionSetButton);

View File

@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.ui.filtermanagement.footer;
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -36,9 +36,9 @@ public class TargetFilterCountMessageLabel extends Label {
private final FilterManagementUIState filterManagementUIState;
private final I18N i18n;
private final VaadinMessageSource i18n;
public TargetFilterCountMessageLabel(final FilterManagementUIState filterManagementUIState, final I18N i18n,
public TargetFilterCountMessageLabel(final FilterManagementUIState filterManagementUIState, final VaadinMessageSource i18n,
final UIEventBus eventBus) {
this.filterManagementUIState = filterManagementUIState;
this.i18n = i18n;
@@ -70,11 +70,11 @@ public class TargetFilterCountMessageLabel extends Label {
if (null != filterManagementUIState.getFilterQueryValue()) {
totalTargets = filterManagementUIState.getTargetsCountAll().get();
}
final StringBuilder targetMessage = new StringBuilder(i18n.get("label.target.filtered.total"));
final StringBuilder targetMessage = new StringBuilder(i18n.getMessage("label.target.filtered.total"));
if (filterManagementUIState.getTargetsTruncated() != null) {
// set the icon
setIcon(FontAwesome.INFO_CIRCLE);
setDescription(i18n.get("label.target.filter.truncated", filterManagementUIState.getTargetsTruncated(),
setDescription(i18n.getMessage("label.target.filter.truncated", filterManagementUIState.getTargetsTruncated(),
SPUIDefinitions.MAX_TABLE_ENTRIES));
} else {
@@ -85,7 +85,7 @@ public class TargetFilterCountMessageLabel extends Label {
if (totalTargets > SPUIDefinitions.MAX_TABLE_ENTRIES) {
targetMessage.append(HawkbitCommonUtil.SP_STRING_PIPE);
targetMessage.append(i18n.get("label.filter.shown"));
targetMessage.append(i18n.getMessage("label.filter.shown"));
targetMessage.append(SPUIDefinitions.MAX_TABLE_ENTRIES);
}

View File

@@ -34,7 +34,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.management.event.DistributionSetTagTableEvent;
import org.eclipse.hawkbit.ui.management.event.TargetTagTableEvent;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -77,7 +77,7 @@ public abstract class AbstractCreateUpdateTagLayout<E extends NamedEntity> exten
protected static final String TAG_DYNAMIC_STYLE = "tag-color-preview";
protected static final String MESSAGE_ERROR_MISSING_TAGNAME = "message.error.missing.tagname";
protected I18N i18n;
protected VaadinMessageSource i18n;
protected transient TagManagement tagManagement;
@@ -130,7 +130,7 @@ public abstract class AbstractCreateUpdateTagLayout<E extends NamedEntity> exten
* @param uiNotification
* UINotification
*/
public AbstractCreateUpdateTagLayout(final I18N i18n, final TagManagement tagManagement,
public AbstractCreateUpdateTagLayout(final VaadinMessageSource i18n, final TagManagement tagManagement,
final EntityFactory entityFactory, final UIEventBus eventBus, final SpPermissionChecker permChecker,
final UINotification uiNotification) {
this.i18n = i18n;
@@ -196,26 +196,26 @@ public abstract class AbstractCreateUpdateTagLayout<E extends NamedEntity> exten
protected void createRequiredComponents() {
createTagStr = i18n.get("label.create.tag");
updateTagStr = i18n.get("label.update.tag");
comboLabel = new LabelBuilder().name(i18n.get("label.choose.tag")).buildLabel();
colorLabel = new LabelBuilder().name(i18n.get("label.choose.tag.color")).buildLabel();
createTagStr = i18n.getMessage("label.create.tag");
updateTagStr = i18n.getMessage("label.update.tag");
comboLabel = new LabelBuilder().name(i18n.getMessage("label.choose.tag")).buildLabel();
colorLabel = new LabelBuilder().name(i18n.getMessage("label.choose.tag.color")).buildLabel();
colorLabel.addStyleName(SPUIDefinitions.COLOR_LABEL_STYLE);
tagName = new TextFieldBuilder().caption(i18n.get("textfield.name"))
tagName = new TextFieldBuilder().caption(i18n.getMessage("textfield.name"))
.styleName(ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_NAME).required(true)
.prompt(i18n.get("textfield.name")).immediate(true).id(SPUIDefinitions.NEW_TARGET_TAG_NAME)
.prompt(i18n.getMessage("textfield.name")).immediate(true).id(SPUIDefinitions.NEW_TARGET_TAG_NAME)
.buildTextComponent();
tagDesc = new TextAreaBuilder().caption(i18n.get("textfield.description"))
tagDesc = new TextAreaBuilder().caption(i18n.getMessage("textfield.description"))
.styleName(ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_DESC)
.prompt(i18n.get("textfield.description")).immediate(true).id(SPUIDefinitions.NEW_TARGET_TAG_DESC)
.prompt(i18n.getMessage("textfield.description")).immediate(true).id(SPUIDefinitions.NEW_TARGET_TAG_DESC)
.buildTextComponent();
tagDesc.setNullRepresentation(StringUtils.EMPTY);
tagNameComboBox = SPUIComponentProvider.getComboBox(null, "", null, null, false, "",
i18n.get("label.combobox.tag"));
i18n.getMessage("label.combobox.tag"));
tagNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE);
tagNameComboBox.setImmediate(true);
tagNameComboBox.setId(UIComponentIdProvider.DIST_TAG_COMBO);
@@ -587,12 +587,12 @@ public abstract class AbstractCreateUpdateTagLayout<E extends NamedEntity> exten
eventBus.publish(this, new DistributionSetTagTableEvent(BaseEntityEventType.UPDATED_ENTITY,
(DistributionSetTag) targetObj));
}
uiNotification.displaySuccess(i18n.get("message.update.success", new Object[] { targetObj.getName() }));
uiNotification.displaySuccess(i18n.getMessage("message.update.success", new Object[] { targetObj.getName() }));
}
protected void displaySuccess(final String tagName) {
uiNotification.displaySuccess(i18n.get("message.save.success", new Object[] { tagName }));
uiNotification.displaySuccess(i18n.getMessage("message.save.success", new Object[] { tagName }));
}
protected void displayValidationError(final String errorMessage) {
@@ -610,7 +610,7 @@ public abstract class AbstractCreateUpdateTagLayout<E extends NamedEntity> exten
private boolean isDuplicateByName() {
final Optional<E> existingType = findEntityByName();
existingType.ifPresent(type -> uiNotification
.displayValidationError(i18n.get("message.tag.duplicate.check", new Object[] { type.getName() })));
.displayValidationError(i18n.getMessage("message.tag.duplicate.check", new Object[] { type.getName() })));
return existingType.isPresent();
}

View File

@@ -19,7 +19,7 @@ import org.eclipse.hawkbit.ui.colorpicker.ColorPickerHelper;
import org.eclipse.hawkbit.ui.common.builder.LabelBuilder;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -47,7 +47,7 @@ public abstract class CreateUpdateTypeLayout<E extends NamedEntity> extends Abst
private static final String TYPE_NAME_DYNAMIC_STYLE = "new-tag-name";
private static final String TYPE_DESC_DYNAMIC_STYLE = "new-tag-desc";
public CreateUpdateTypeLayout(final I18N i18n, final TagManagement tagManagement, final EntityFactory entityFactory,
public CreateUpdateTypeLayout(final VaadinMessageSource i18n, final TagManagement tagManagement, final EntityFactory entityFactory,
final UIEventBus eventBus, final SpPermissionChecker permChecker, final UINotification uiNotification) {
super(i18n, tagManagement, entityFactory, eventBus, permChecker, uiNotification);
}
@@ -61,14 +61,14 @@ public abstract class CreateUpdateTypeLayout<E extends NamedEntity> extends Abst
@Override
protected void createRequiredComponents() {
createTagStr = i18n.get("label.create.type");
updateTagStr = i18n.get("label.update.type");
comboLabel = new LabelBuilder().name(i18n.get("label.choose.type")).buildLabel();
colorLabel = new LabelBuilder().name(i18n.get("label.choose.type.color")).buildLabel();
createTagStr = i18n.getMessage("label.create.type");
updateTagStr = i18n.getMessage("label.update.type");
comboLabel = new LabelBuilder().name(i18n.getMessage("label.choose.type")).buildLabel();
colorLabel = new LabelBuilder().name(i18n.getMessage("label.choose.type.color")).buildLabel();
colorLabel.addStyleName(SPUIDefinitions.COLOR_LABEL_STYLE);
tagNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.type"), "", null, null, false, "",
i18n.get("label.combobox.type"));
tagNameComboBox = SPUIComponentProvider.getComboBox(i18n.getMessage("label.combobox.type"), "", null, null, false, "",
i18n.getMessage("label.combobox.type"));
tagNameComboBox.setId(SPUIDefinitions.NEW_DISTRIBUTION_SET_TYPE_NAME_COMBO);
tagNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE);
tagNameComboBox.setImmediate(true);

View File

@@ -18,7 +18,7 @@ import org.eclipse.hawkbit.im.authentication.MultitenancyIndicator;
import org.eclipse.hawkbit.im.authentication.TenantUserPasswordAuthenticationToken;
import org.eclipse.hawkbit.ui.UiProperties;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -71,7 +71,7 @@ public class LoginView extends VerticalLayout implements View {
private final transient VaadinSecurity vaadinSecurity;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final UiProperties uiProperties;
@@ -86,7 +86,7 @@ public class LoginView extends VerticalLayout implements View {
private Button signin;
@Autowired
LoginView(final VaadinSecurity vaadinSecurity, final I18N i18n, final UiProperties uiProperties,
LoginView(final VaadinSecurity vaadinSecurity, final VaadinMessageSource i18n, final UiProperties uiProperties,
final MultitenancyIndicator multiTenancyIndicator) {
this.vaadinSecurity = vaadinSecurity;
this.i18n = i18n;
@@ -95,8 +95,8 @@ public class LoginView extends VerticalLayout implements View {
}
void loginAuthenticationFailedNotification() {
final Notification notification = new Notification(i18n.get("notification.login.failed.title"));
notification.setDescription(i18n.get("notification.login.failed.description"));
final Notification notification = new Notification(i18n.getMessage("notification.login.failed.title"));
notification.setDescription(i18n.getMessage("notification.login.failed.description"));
notification.setHtmlContentAllowed(true);
notification.setStyleName("error closable");
notification.setPosition(Position.BOTTOM_CENTER);
@@ -106,8 +106,8 @@ public class LoginView extends VerticalLayout implements View {
void loginCredentialsExpiredNotification() {
final Notification notification = new Notification(
i18n.get("notification.login.failed.credentialsexpired.title"));
notification.setDescription(i18n.get("notification.login.failed.credentialsexpired.description"));
i18n.getMessage("notification.login.failed.credentialsexpired.title"));
notification.setDescription(i18n.getMessage("notification.login.failed.credentialsexpired.description"));
notification.setDelayMsec(10000);
notification.setHtmlContentAllowed(true);
notification.setStyleName("error closeable");
@@ -225,7 +225,7 @@ public class LoginView extends VerticalLayout implements View {
}
private void buildSignInButton() {
signin = new Button(i18n.get("button.login.signin"));
signin = new Button(i18n.getMessage("button.login.signin"));
signin.addStyleName(ValoTheme.BUTTON_PRIMARY + " " + ValoTheme.BUTTON_SMALL + " " + "login-button");
signin.setClickShortcut(KeyCode.ENTER);
signin.focus();
@@ -233,7 +233,7 @@ public class LoginView extends VerticalLayout implements View {
}
private void buildPasswordField() {
password = new PasswordField(i18n.get("label.login.password"));
password = new PasswordField(i18n.getMessage("label.login.password"));
password.setIcon(FontAwesome.LOCK);
password.addStyleName(
ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
@@ -241,7 +241,7 @@ public class LoginView extends VerticalLayout implements View {
}
private void buildUserField() {
username = new TextField(i18n.get("label.login.username"));
username = new TextField(i18n.getMessage("label.login.username"));
username.setIcon(FontAwesome.USER);
username.addStyleName(
ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
@@ -250,7 +250,7 @@ public class LoginView extends VerticalLayout implements View {
private void buildTenantField() {
if (multiTenancyIndicator.isMultiTenancySupported()) {
tenant = new TextField(i18n.get("label.login.tenant"));
tenant = new TextField(i18n.getMessage("label.login.tenant"));
tenant.setIcon(FontAwesome.DATABASE);
tenant.addStyleName(
ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
@@ -268,7 +268,7 @@ public class LoginView extends VerticalLayout implements View {
if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
final Link docuLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DOCUMENTATION,
i18n.get("link.documentation.name"), uiProperties.getLinks().getDocumentation().getRoot(),
i18n.getMessage("link.documentation.name"), uiProperties.getLinks().getDocumentation().getRoot(),
FontAwesome.QUESTION_CIRCLE, "_blank", linkStyle);
links.addComponent(docuLink);
docuLink.addStyleName(ValoTheme.LINK_SMALL);
@@ -276,14 +276,14 @@ public class LoginView extends VerticalLayout implements View {
if (!uiProperties.getDemo().getUser().isEmpty()) {
final Link demoLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DEMO,
i18n.get("link.demo.name"), "?demo", FontAwesome.DESKTOP, "_top", linkStyle);
i18n.getMessage("link.demo.name"), "?demo", FontAwesome.DESKTOP, "_top", linkStyle);
links.addComponent(demoLink);
demoLink.addStyleName(ValoTheme.LINK_SMALL);
}
if (!uiProperties.getLinks().getRequestAccount().isEmpty()) {
final Link requestAccountLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_REQUESTACCOUNT,
i18n.get("link.requestaccount.name"), uiProperties.getLinks().getRequestAccount(),
i18n.getMessage("link.requestaccount.name"), uiProperties.getLinks().getRequestAccount(),
FontAwesome.SHOPPING_CART, "", linkStyle);
links.addComponent(requestAccountLink);
requestAccountLink.addStyleName(ValoTheme.LINK_SMALL);
@@ -291,7 +291,7 @@ public class LoginView extends VerticalLayout implements View {
if (!uiProperties.getLinks().getUserManagement().isEmpty()) {
final Link userManagementLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_USERMANAGEMENT,
i18n.get("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
i18n.getMessage("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
FontAwesome.USERS, "_blank", linkStyle);
links.addComponent(userManagementLink);
userManagementLink.addStyleName(ValoTheme.LINK_SMALL);
@@ -301,7 +301,7 @@ public class LoginView extends VerticalLayout implements View {
}
private Component buildUnsupportedMessage() {
final Label label = new Label(i18n.get("label.unsupported.browser.ie"));
final Label label = new Label(i18n.getMessage("label.unsupported.browser.ie"));
label.addStyleName(ValoTheme.LABEL_FAILURE);
return label;
}

View File

@@ -52,7 +52,7 @@ import org.eclipse.hawkbit.ui.push.TargetDeletedEventContainer;
import org.eclipse.hawkbit.ui.push.TargetTagCreatedEventContainer;
import org.eclipse.hawkbit.ui.push.TargetTagDeletedEventContainer;
import org.eclipse.hawkbit.ui.push.TargetTagUpdatedEventContainer;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.springframework.beans.factory.annotation.Autowired;
@@ -83,7 +83,7 @@ public class DeploymentView extends AbstractNotificationView implements BrowserW
private final SpPermissionChecker permChecker;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final UINotification uiNotification;
@@ -106,7 +106,7 @@ public class DeploymentView extends AbstractNotificationView implements BrowserW
private final DeploymentViewMenuItem deploymentViewMenuItem;
@Autowired
DeploymentView(final UIEventBus eventbus, final SpPermissionChecker permChecker, final I18N i18n,
DeploymentView(final UIEventBus eventbus, final SpPermissionChecker permChecker, final VaadinMessageSource i18n,
final UINotification uiNotification, final ManagementUIState managementUIState,
final DeploymentManagement deploymentManagement, final UIEventBus eventBus,
final DistributionTableFilters distFilterParameters,
@@ -347,7 +347,7 @@ public class DeploymentView extends AbstractNotificationView implements BrowserW
private void checkNoDataAvaialble() {
if (managementUIState.isNoDataAvilableTarget() && managementUIState.isNoDataAvailableDistribution()) {
uiNotification.displayValidationError(i18n.get("message.no.data"));
uiNotification.displayValidationError(i18n.getMessage("message.no.data"));
}
}

View File

@@ -13,7 +13,7 @@ import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -34,7 +34,7 @@ public class ActionHistoryComponent extends VerticalLayout {
private final ActionHistoryHeader actionHistoryHeader;
private final ActionHistoryTable actionHistoryTable;
public ActionHistoryComponent(final I18N i18n, final DeploymentManagement deploymentManagement,
public ActionHistoryComponent(final VaadinMessageSource i18n, final DeploymentManagement deploymentManagement,
final UIEventBus eventBus, final UINotification notification, final ManagementUIState managementUIState) {
this.actionHistoryHeader = new ActionHistoryHeader(eventBus, managementUIState);
this.actionHistoryTable = new ActionHistoryTable(i18n, deploymentManagement, eventBus, notification,

View File

@@ -31,7 +31,7 @@ import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
import org.eclipse.hawkbit.ui.management.event.PinUnpinEvent;
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -75,7 +75,7 @@ public class ActionHistoryTable extends TreeTable {
private static final String BUTTON_CANCEL = "button.cancel";
private static final String BUTTON_OK = "button.ok";
private final I18N i18n;
private final VaadinMessageSource i18n;
private final transient DeploymentManagement deploymentManagement;
private final transient EventBus.UIEventBus eventBus;
private final UINotification notification;
@@ -86,7 +86,7 @@ public class ActionHistoryTable extends TreeTable {
private Target target;
ActionHistoryTable(final I18N i18n, final DeploymentManagement deploymentManagement, final UIEventBus eventBus,
ActionHistoryTable(final VaadinMessageSource i18n, final DeploymentManagement deploymentManagement, final UIEventBus eventBus,
final UINotification notification, final ManagementUIState managementUIState) {
this.i18n = i18n;
this.deploymentManagement = deploymentManagement;
@@ -388,20 +388,20 @@ public class ActionHistoryTable extends TreeTable {
final boolean isActionActive = target != null && SPUIDefinitions.ACTIVE.equals(activeValue);
final Button actionCancel = SPUIComponentProvider.getButton(
UIComponentIdProvider.ACTION_HISTORY_TABLE_CANCEL_ID, "", i18n.get("message.cancel.action"),
UIComponentIdProvider.ACTION_HISTORY_TABLE_CANCEL_ID, "", i18n.getMessage("message.cancel.action"),
ValoTheme.BUTTON_TINY, true, FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
actionCancel.setEnabled(isActionActive && !actionWithActiveStatus.isCancelingOrCanceled());
actionCancel.addClickListener(event -> confirmAndCancelAction(actionId));
final Button actionForce = SPUIComponentProvider.getButton(UIComponentIdProvider.ACTION_HISTORY_TABLE_FORCE_ID,
"", i18n.get("message.force.action"), ValoTheme.BUTTON_TINY, true, FontAwesome.BOLT,
"", i18n.getMessage("message.force.action"), ValoTheme.BUTTON_TINY, true, FontAwesome.BOLT,
SPUIButtonStyleSmallNoBorder.class);
actionForce.setEnabled(
isActionActive && !actionWithActiveStatus.isForce() && !actionWithActiveStatus.isCancelingOrCanceled());
actionForce.addClickListener(event -> confirmAndForceAction(actionId));
final Button actionForceQuit = SPUIComponentProvider.getButton(
UIComponentIdProvider.ACTION_HISTORY_TABLE_FORCE_QUIT_ID, "", i18n.get("message.forcequit.action"),
UIComponentIdProvider.ACTION_HISTORY_TABLE_FORCE_QUIT_ID, "", i18n.getMessage("message.forcequit.action"),
ValoTheme.BUTTON_TINY + " redicon", true, FontAwesome.TIMES, SPUIButtonStyleSmallNoBorder.class);
actionForceQuit.setEnabled(isActionActive && actionWithActiveStatus.isCancelingOrCanceled());
actionForceQuit.addClickListener(event -> confirmAndForceQuitAction(actionId));
@@ -520,7 +520,7 @@ public class ActionHistoryTable extends TreeTable {
return label;
}
label.setDescription(i18n.get(mapping.getDescriptionI18N()));
label.setDescription(i18n.getMessage(mapping.getDescriptionI18N()));
label.setStyleName(mapping.getStyleName());
label.setValue(mapping.getIcon().getHtml());
return label;
@@ -653,7 +653,7 @@ public class ActionHistoryTable extends TreeTable {
}
} else {
/* Messages are not available */
updateStatusMessages.append(i18n.get("message.no.available"));
updateStatusMessages.append(i18n.getMessage("message.no.available"));
}
textArea.setValue(updateStatusMessages.toString());
textArea.setReadOnly(Boolean.TRUE);
@@ -696,14 +696,14 @@ public class ActionHistoryTable extends TreeTable {
*/
private void confirmAndForceAction(final Long actionId) {
/* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.force.action.confirmbox"),
i18n.get("message.force.action.confirm"), i18n.get(BUTTON_OK), i18n.get(BUTTON_CANCEL), ok -> {
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.getMessage("caption.force.action.confirmbox"),
i18n.getMessage("message.force.action.confirm"), i18n.getMessage(BUTTON_OK), i18n.getMessage(BUTTON_CANCEL), ok -> {
if (!ok) {
return;
}
deploymentManagement.forceTargetAction(actionId);
populateAndupdateTargetDetails(target);
notification.displaySuccess(i18n.get("message.force.action.success"));
notification.displaySuccess(i18n.getMessage("message.force.action.success"));
});
UI.getCurrent().addWindow(confirmDialog.getWindow());
@@ -712,17 +712,17 @@ public class ActionHistoryTable extends TreeTable {
private void confirmAndForceQuitAction(final Long actionId) {
/* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.forcequit.action.confirmbox"),
i18n.get("message.forcequit.action.confirm"), i18n.get(BUTTON_OK), i18n.get(BUTTON_CANCEL), ok -> {
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.getMessage("caption.forcequit.action.confirmbox"),
i18n.getMessage("message.forcequit.action.confirm"), i18n.getMessage(BUTTON_OK), i18n.getMessage(BUTTON_CANCEL), ok -> {
if (!ok) {
return;
}
final boolean cancelResult = forceQuitActiveAction(actionId);
if (cancelResult) {
populateAndupdateTargetDetails(target);
notification.displaySuccess(i18n.get("message.forcequit.action.success"));
notification.displaySuccess(i18n.getMessage("message.forcequit.action.success"));
} else {
notification.displayValidationError(i18n.get("message.forcequit.action.failed"));
notification.displayValidationError(i18n.getMessage("message.forcequit.action.failed"));
}
}, FontAwesome.WARNING);
UI.getCurrent().addWindow(confirmDialog.getWindow());
@@ -741,17 +741,17 @@ public class ActionHistoryTable extends TreeTable {
return;
}
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.get("caption.cancel.action.confirmbox"),
i18n.get("message.cancel.action.confirm"), i18n.get(BUTTON_OK), i18n.get(BUTTON_CANCEL), ok -> {
final ConfirmationDialog confirmDialog = new ConfirmationDialog(i18n.getMessage("caption.cancel.action.confirmbox"),
i18n.getMessage("message.cancel.action.confirm"), i18n.getMessage(BUTTON_OK), i18n.getMessage(BUTTON_CANCEL), ok -> {
if (!ok) {
return;
}
final boolean cancelResult = cancelActiveAction(actionId);
if (cancelResult) {
populateAndupdateTargetDetails(target);
notification.displaySuccess(i18n.get("message.cancel.action.success"));
notification.displaySuccess(i18n.getMessage("message.cancel.action.success"));
} else {
notification.displayValidationError(i18n.get("message.cancel.action.failed"));
notification.displayValidationError(i18n.getMessage("message.cancel.action.failed"));
}
});
UI.getCurrent().addWindow(confirmDialog.getWindow());

View File

@@ -30,7 +30,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.distributions.dstable.DistributionSetTable;
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -58,7 +58,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
private static final long serialVersionUID = -5602182034230568435L;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final UINotification notificationMessage;
private final transient EventBus.UIEventBus eventBus;
private final transient DistributionSetManagement distributionSetManagement;
@@ -95,7 +95,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
* @param distributionSetTable
* DistributionSetTable
*/
public DistributionAddUpdateWindowLayout(final I18N i18n, final UINotification notificationMessage,
public DistributionAddUpdateWindowLayout(final VaadinMessageSource i18n, final UINotification notificationMessage,
final UIEventBus eventBus, final DistributionSetManagement distributionSetManagement,
final SystemManagement systemManagement, final EntityFactory entityFactory,
final DistributionSetTable distributionSetTable) {
@@ -142,7 +142,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
entityFactory.distributionSet().update(editDistId).name(distNameTextField.getValue())
.description(descTextArea.getValue()).version(distVersionTextField.getValue())
.requiredMigrationStep(isMigStepReq).type(type));
notificationMessage.displaySuccess(i18n.get("message.new.dist.save.success",
notificationMessage.displaySuccess(i18n.getMessage("message.new.dist.save.success",
new Object[] { currentDS.getName(), currentDS.getVersion() }));
// update table row+details layout
eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.UPDATED_ENTITY, currentDS));
@@ -170,7 +170,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.ADD_ENTITY, newDist));
notificationMessage.displaySuccess(i18n.get("message.new.dist.save.success",
notificationMessage.displaySuccess(i18n.getMessage("message.new.dist.save.success",
new Object[] { newDist.getName(), newDist.getVersion() }));
distributionSetTable.setValue(Sets.newHashSet(newDist.getId()));
@@ -192,7 +192,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
if (existingDs.isPresent() && !existingDs.get().getId().equals(editDistId)) {
distNameTextField.addStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_LAYOUT_ERROR_HIGHTLIGHT);
distVersionTextField.addStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_LAYOUT_ERROR_HIGHTLIGHT);
notificationMessage.displayValidationError(i18n.get("message.duplicate.dist",
notificationMessage.displayValidationError(i18n.getMessage("message.duplicate.dist",
new Object[] { existingDs.get().getName(), existingDs.get().getVersion() }));
return true;
@@ -226,26 +226,26 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
distNameTextField = createTextField("textfield.name", UIComponentIdProvider.DIST_ADD_NAME);
distVersionTextField = createTextField("textfield.version", UIComponentIdProvider.DIST_ADD_VERSION);
distsetTypeNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.type"), "", null, "",
false, "", i18n.get("label.combobox.type"));
distsetTypeNameComboBox = SPUIComponentProvider.getComboBox(i18n.getMessage("label.combobox.type"), "", null, "",
false, "", i18n.getMessage("label.combobox.type"));
distsetTypeNameComboBox.setImmediate(true);
distsetTypeNameComboBox.setNullSelectionAllowed(false);
distsetTypeNameComboBox.setId(UIComponentIdProvider.DIST_ADD_DISTSETTYPE);
descTextArea = new TextAreaBuilder().caption(i18n.get("textfield.description")).style("text-area-style")
.prompt(i18n.get("textfield.description")).immediate(true).id(UIComponentIdProvider.DIST_ADD_DESC)
descTextArea = new TextAreaBuilder().caption(i18n.getMessage("textfield.description")).style("text-area-style")
.prompt(i18n.getMessage("textfield.description")).immediate(true).id(UIComponentIdProvider.DIST_ADD_DESC)
.buildTextComponent();
descTextArea.setNullRepresentation(StringUtils.EMPTY);
reqMigStepCheckbox = SPUIComponentProvider.getCheckBox(i18n.get("checkbox.dist.required.migration.step"),
reqMigStepCheckbox = SPUIComponentProvider.getCheckBox(i18n.getMessage("checkbox.dist.required.migration.step"),
"dist-checkbox-style", null, false, "");
reqMigStepCheckbox.addStyleName(ValoTheme.CHECKBOX_SMALL);
reqMigStepCheckbox.setId(UIComponentIdProvider.DIST_ADD_MIGRATION_CHECK);
}
private TextField createTextField(final String in18Key, final String id) {
final TextField buildTextField = new TextFieldBuilder().caption(i18n.get(in18Key)).required(true)
.prompt(i18n.get(in18Key)).immediate(true).id(id).buildTextComponent();
final TextField buildTextField = new TextFieldBuilder().caption(i18n.getMessage(in18Key)).required(true)
.prompt(i18n.getMessage(in18Key)).immediate(true).id(id).buildTextComponent();
buildTextField.setNullRepresentation(StringUtils.EMPTY);
return buildTextField;
}
@@ -323,7 +323,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
populateDistSetTypeNameCombo();
populateValuesOfDistribution(editDistId);
return new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW)
.caption(i18n.get(UIComponentIdProvider.DIST_ADD_CAPTION)).content(this).layout(formLayout).i18n(i18n)
.caption(i18n.getMessage(UIComponentIdProvider.DIST_ADD_CAPTION)).content(this).layout(formLayout).i18n(i18n)
.saveDialogCloseListener(new SaveOnCloseDialogListener()).buildCommonDialogWindow();
}

View File

@@ -23,7 +23,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.distributions.dstable.DsMetadataPopupLayout;
import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -55,7 +55,7 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
private final UINotification notificationMessage;
DistributionDetails(final I18N i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
DistributionDetails(final VaadinMessageSource i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
final ManagementUIState managementUIState, final DistributionSetManagement distributionSetManagement,
final DsMetadataPopupLayout dsMetadataPopupLayout, final EntityFactory entityFactory,
final UINotification notificationMessage, final TagManagement tagManagement,
@@ -86,23 +86,23 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
@Override
protected String getDefaultCaption() {
return getI18n().get("distribution.details.header");
return getI18n().getMessage("distribution.details.header");
}
@Override
protected void addTabs(final TabSheet detailsTab) {
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
detailsTab.addTab(createSoftwareModuleTab(), getI18n().get("caption.softwares.distdetail.tab"), null);
detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.tab"), null);
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
detailsTab.addTab(dsMetadataTable, getI18n().get("caption.metadata"), null);
detailsTab.addTab(createDetailsLayout(), getI18n().getMessage("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().getMessage("caption.tab.description"), null);
detailsTab.addTab(createSoftwareModuleTab(), getI18n().getMessage("caption.softwares.distdetail.tab"), null);
detailsTab.addTab(createTagsLayout(), getI18n().getMessage("caption.tags.tab"), null);
detailsTab.addTab(createLogLayout(), getI18n().getMessage("caption.logs.tab"), null);
detailsTab.addTab(dsMetadataTable, getI18n().getMessage("caption.metadata"), null);
}
@Override
protected void onEdit(final ClickEvent event) {
final Window newDistWindow = distributionAddUpdateWindowLayout.getWindow(getSelectedBaseEntityId());
newDistWindow.setCaption(getI18n().get(UIComponentIdProvider.DIST_UPDATE_CAPTION));
newDistWindow.setCaption(getI18n().getMessage(UIComponentIdProvider.DIST_UPDATE_CAPTION));
UI.getCurrent().addWindow(newDistWindow);
newDistWindow.setVisible(Boolean.TRUE);
}
@@ -159,7 +159,7 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
detailsTabLayout.removeAllComponents();
if (type != null) {
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.dist.details.type"),
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.type"),
type);
typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
detailsTabLayout.addComponent(typeLabel);
@@ -167,8 +167,8 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
if (isMigrationRequired != null) {
detailsTabLayout.addComponent(SPUIComponentProvider.createNameValueLabel(
getI18n().get("checkbox.dist.migration.required"),
isMigrationRequired.equals(Boolean.TRUE) ? getI18n().get("label.yes") : getI18n().get("label.no")));
getI18n().getMessage("checkbox.dist.migration.required"),
isMigrationRequired.equals(Boolean.TRUE) ? getI18n().getMessage("label.yes") : getI18n().getMessage("label.no")));
}
}
@@ -200,7 +200,7 @@ public class DistributionDetails extends AbstractNamedVersionedEntityTableDetail
final Optional<DistributionSet> ds = distributionSetManagement
.findDistributionSetById(getSelectedBaseEntityId());
if (!ds.isPresent()) {
notificationMessage.displayWarning(getI18n().get("distributionset.not.exists"));
notificationMessage.displayWarning(getI18n().getMessage("distributionset.not.exists"));
return;
}
UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds.get(), null));

View File

@@ -42,7 +42,7 @@ import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.management.targettable.TargetTable;
import org.eclipse.hawkbit.ui.push.DistributionSetUpdatedEventContainer;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -87,7 +87,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
private boolean isDistPinned;
private Button distributinPinnedBtn;
DistributionTable(final UIEventBus eventBus, final I18N i18n, final SpPermissionChecker permissionChecker,
DistributionTable(final UIEventBus eventBus, final VaadinMessageSource i18n, final SpPermissionChecker permissionChecker,
final UINotification notification, final ManagementUIState managementUIState,
final ManagementViewClientCriterion managementViewClientCriterion, final TargetManagement targetService,
final DsMetadataPopupLayout dsMetadataPopupLayout,
@@ -99,7 +99,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
this.targetService = targetService;
this.dsMetadataPopupLayout = dsMetadataPopupLayout;
this.distributionSetManagement = distributionSetManagement;
notAllowedMsg = i18n.get("message.action.not.allowed");
notAllowedMsg = i18n.getMessage("message.action.not.allowed");
addNewContainerDS();
setColumnProperties();
@@ -285,7 +285,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
FontAwesome.LIST_ALT, SPUIButtonStyleSmallNoBorder.class);
manageMetadataBtn.addStyleName(SPUIStyleDefinitions.ARTIFACT_DTLS_ICON);
manageMetadataBtn.addStyleName(SPUIStyleDefinitions.DS_METADATA_ICON);
manageMetadataBtn.setDescription(i18n.get("tooltip.metadata.icon"));
manageMetadataBtn.setDescription(i18n.getMessage("tooltip.metadata.icon"));
return manageMetadataBtn;
}
@@ -399,7 +399,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
if (!assignedTargets.isEmpty()) {
assignTargetToDs(getItem(distItemId), assignedTargets);
} else {
notification.displaySuccess(i18n.get("message.no.targets.assiged.fortag", new Object[] { targetTagName }));
notification.displaySuccess(i18n.getMessage("message.no.targets.assiged.fortag", new Object[] { targetTagName }));
}
}
@@ -421,7 +421,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
}
if (targetDetailsList.isEmpty()) {
getNotification().displayWarning(i18n.get("targets.not.exists"));
getNotification().displayWarning(i18n.getMessage("targets.not.exists"));
return;
}
@@ -429,7 +429,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
final Optional<DistributionSet> findDistributionSetById = distributionSetManagement
.findDistributionSetById(distId);
if (!findDistributionSetById.isPresent()) {
notification.displayWarning(i18n.get("distributionset.not.exists"));
notification.displayWarning(i18n.getMessage("distributionset.not.exists"));
return;
}
@@ -461,7 +461,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
private Boolean isNoTagButton(final String tagData, final String targetNoTagData) {
if (tagData.equals(targetNoTagData)) {
notification.displayValidationError(
i18n.get("message.tag.cannot.be.assigned", new Object[] { i18n.get("label.no.tag.assigned") }));
i18n.getMessage("message.tag.cannot.be.assigned", new Object[] { i18n.getMessage("label.no.tag.assigned") }));
return true;
}
return false;
@@ -487,9 +487,9 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
private String getPendingActionMessage(final String message, final String controllerId,
final String distNameVersion) {
String pendActionMsg = i18n.get("message.target.assigned.pending");
String pendActionMsg = i18n.getMessage("message.target.assigned.pending");
if (null == message) {
pendActionMsg = i18n.get("message.dist.pending.action", new Object[] { controllerId, distNameVersion });
pendActionMsg = i18n.getMessage("message.dist.pending.action", new Object[] { controllerId, distNameVersion });
}
return pendActionMsg;
}
@@ -721,7 +721,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
private void showMetadataDetails(final Object itemId) {
final Optional<DistributionSet> ds = distributionSetManagement.findDistributionSetById((Long) itemId);
if (!ds.isPresent()) {
notification.displayWarning(i18n.get("distributionset.not.exists"));
notification.displayWarning(i18n.getMessage("distributionset.not.exists"));
return;
}
UI.getCurrent().addWindow(dsMetadataPopupLayout.getWindow(ds.get(), null));

View File

@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.ui.management.event.DistributionTableEvent;
import org.eclipse.hawkbit.ui.management.event.DistributionTableFilterEvent;
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -31,7 +31,7 @@ import com.vaadin.ui.Button.ClickEvent;
public class DistributionTableHeader extends AbstractTableHeader {
private static final long serialVersionUID = 7597766804650170127L;
DistributionTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
DistributionTableHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
final ManagementUIState managementUIState) {
super(i18n, permChecker, eventbus, managementUIState, null, null);
}
@@ -47,7 +47,7 @@ public class DistributionTableHeader extends AbstractTableHeader {
@Override
protected String getHeaderCaption() {
return i18n.get("header.dist.table");
return i18n.getMessage("header.dist.table");
}
@Override

View File

@@ -18,7 +18,7 @@ import org.eclipse.hawkbit.ui.common.table.AbstractTableLayout;
import org.eclipse.hawkbit.ui.dd.criteria.ManagementViewClientCriterion;
import org.eclipse.hawkbit.ui.distributions.dstable.DsMetadataPopupLayout;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -29,7 +29,7 @@ public class DistributionTableLayout extends AbstractTableLayout<DistributionTab
private static final long serialVersionUID = 6464291374980641235L;
public DistributionTableLayout(final I18N i18n, final UIEventBus eventBus,
public DistributionTableLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
final SpPermissionChecker permissionChecker, final ManagementUIState managementUIState,
final DistributionSetManagement distributionSetManagement,
final ManagementViewClientCriterion managementViewClientCriterion, final EntityFactory entityFactory,

View File

@@ -25,7 +25,7 @@ import org.eclipse.hawkbit.ui.components.RefreshableContainer;
import org.eclipse.hawkbit.ui.layouts.AbstractCreateUpdateTagLayout;
import org.eclipse.hawkbit.ui.management.event.DistributionSetTagTableEvent;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -44,7 +44,7 @@ public class CreateUpdateDistributionTagLayoutWindow extends AbstractCreateUpdat
private static final String TARGET_TAG_NAME_DYNAMIC_STYLE = "new-target-tag-name";
private static final String MSG_TEXTFIELD_NAME = "textfield.name";
CreateUpdateDistributionTagLayoutWindow(final I18N i18n, final TagManagement tagManagement,
CreateUpdateDistributionTagLayoutWindow(final VaadinMessageSource i18n, final TagManagement tagManagement,
final EntityFactory entityFactory, final UIEventBus eventBus, final SpPermissionChecker permChecker,
final UINotification uiNotification) {
super(i18n, tagManagement, entityFactory, eventBus, permChecker, uiNotification);
@@ -101,7 +101,7 @@ public class CreateUpdateDistributionTagLayoutWindow extends AbstractCreateUpdat
displaySuccess(newDistTag.getName());
resetDistTagValues();
} else {
displayValidationError(i18n.get(SPUILabelDefinitions.MISSING_TAG_NAME));
displayValidationError(i18n.getMessage(SPUILabelDefinitions.MISSING_TAG_NAME));
}
}
@@ -121,7 +121,7 @@ public class CreateUpdateDistributionTagLayoutWindow extends AbstractCreateUpdat
tagName.removeStyleName(TARGET_TAG_NAME_DYNAMIC_STYLE);
tagName.addStyleName(SPUIDefinitions.NEW_TARGET_TAG_NAME);
tagName.setValue("");
tagName.setInputPrompt(i18n.get(MSG_TEXTFIELD_NAME));
tagName.setInputPrompt(i18n.getMessage(MSG_TEXTFIELD_NAME));
setColor(ColorPickerConstants.START_COLOR);
getWindow().setVisible(false);
tagPreviewBtnClicked = false;
@@ -166,7 +166,7 @@ public class CreateUpdateDistributionTagLayoutWindow extends AbstractCreateUpdat
@Override
protected String getWindowCaption() {
return i18n.get("caption.add.tag");
return i18n.getMessage("caption.add.tag");
}
@Override

View File

@@ -22,7 +22,7 @@ import org.eclipse.hawkbit.ui.management.state.DistributionTableFilters;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.management.tag.TagIdName;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -48,7 +48,7 @@ public class DistributionTagButtons extends AbstractFilterButtons implements Ref
private final transient EntityFactory entityFactory;
DistributionTagButtons(final UIEventBus eventBus, final ManagementUIState managementUIState,
final EntityFactory entityFactory, final I18N i18n, final UINotification notification,
final EntityFactory entityFactory, final VaadinMessageSource i18n, final UINotification notification,
final SpPermissionChecker permChecker, final DistributionTableFilters distFilterParameters,
final DistributionSetManagement distributionSetManagement,
final ManagementViewClientCriterion managementViewClientCriterion) {

View File

@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.ui.common.filterlayout.AbstractFilterHeader;
import org.eclipse.hawkbit.ui.components.RefreshableContainer;
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -35,7 +35,7 @@ public class DistributionTagHeader extends AbstractFilterHeader implements Refre
private final ManagementUIState managementUIState;
private final CreateUpdateDistributionTagLayoutWindow createORUpdateDistributionTagLayout;
DistributionTagHeader(final I18N i18n, final ManagementUIState managementUIState,
DistributionTagHeader(final VaadinMessageSource i18n, final ManagementUIState managementUIState,
final SpPermissionChecker permChecker, final UIEventBus eventBus, final TagManagement tagManagement,
final EntityFactory entityFactory, final UINotification uiNotification) {
super(permChecker, eventBus, i18n);
@@ -59,7 +59,7 @@ public class DistributionTagHeader extends AbstractFilterHeader implements Refre
@Override
protected String getTitle() {
return i18n.get("header.filter.tag", new Object[] {});
return i18n.getMessage("header.filter.tag", new Object[] {});
}
@Override

View File

@@ -22,7 +22,7 @@ import org.eclipse.hawkbit.ui.management.event.DistributionSetTagTableEvent;
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
import org.eclipse.hawkbit.ui.management.state.DistributionTableFilters;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
@@ -38,7 +38,7 @@ public class DistributionTagLayout extends AbstractFilterLayout implements Refre
private final ManagementUIState managementUIState;
public DistributionTagLayout(final UIEventBus eventbus, final ManagementUIState managementUIState, final I18N i18n,
public DistributionTagLayout(final UIEventBus eventbus, final ManagementUIState managementUIState, final VaadinMessageSource i18n,
final SpPermissionChecker permChecker, final UIEventBus eventBus, final TagManagement tagManagement,
final EntityFactory entityFactory, final UINotification uiNotification,
final DistributionTableFilters distFilterParameters,

View File

@@ -18,7 +18,7 @@ import org.eclipse.hawkbit.ui.common.table.AbstractTable;
import org.eclipse.hawkbit.ui.dd.criteria.ManagementViewClientCriterion;
import org.eclipse.hawkbit.ui.management.state.DistributionTableFilters;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -42,7 +42,7 @@ public class DistributionTagDropEvent implements DropHandler {
private static final long serialVersionUID = 7338133229709850212L;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final UINotification notification;
@@ -56,7 +56,7 @@ public class DistributionTagDropEvent implements DropHandler {
private final ManagementViewClientCriterion managementViewClientCriterion;
public DistributionTagDropEvent(final I18N i18n, final UINotification notification,
public DistributionTagDropEvent(final VaadinMessageSource i18n, final UINotification notification,
final SpPermissionChecker permChecker, final DistributionTableFilters distFilterParameters,
final DistributionSetManagement distributionSetManagement, final UIEventBus eventBus,
final ManagementViewClientCriterion managementViewClientCriterion) {
@@ -86,7 +86,7 @@ public class DistributionTagDropEvent implements DropHandler {
final String tagName = ((DragAndDropWrapper) (event.getTargetDetails().getTarget())).getData().toString();
if (tagName.equals(SPUIDefinitions.DISTRIBUTION_TAG_BUTTON)) {
notification.displayValidationError(
i18n.get("message.tag.cannot.be.assigned", new Object[] { i18n.get("label.no.tag.assigned") }));
i18n.getMessage("message.tag.cannot.be.assigned", new Object[] { i18n.getMessage("label.no.tag.assigned") }));
return false;
}
return true;
@@ -96,7 +96,7 @@ public class DistributionTagDropEvent implements DropHandler {
final Component compsource = event.getTransferable().getSourceComponent();
if (!(compsource instanceof Table)) {
notification.displayValidationError(i18n.get(SPUILabelDefinitions.ACTION_NOT_ALLOWED));
notification.displayValidationError(i18n.getMessage(SPUILabelDefinitions.ACTION_NOT_ALLOWED));
return false;
} else {
final Table source = ((TableTransferable) event.getTransferable()).getSourceComponent();
@@ -111,7 +111,7 @@ public class DistributionTagDropEvent implements DropHandler {
private boolean checkForDSUpdatePermission() {
if (!permChecker.hasUpdateDistributionPermission()) {
notification.displayValidationError(i18n.get("message.permission.insufficient"));
notification.displayValidationError(i18n.getMessage("message.permission.insufficient"));
return false;
}
@@ -120,7 +120,7 @@ public class DistributionTagDropEvent implements DropHandler {
private boolean validateIfSourceIsDs(final Table source) {
if (!source.getId().equals(UIComponentIdProvider.DIST_TABLE_ID)) {
notification.displayValidationError(i18n.get(SPUILabelDefinitions.ACTION_NOT_ALLOWED));
notification.displayValidationError(i18n.getMessage(SPUILabelDefinitions.ACTION_NOT_ALLOWED));
return false;
}
return true;

View File

@@ -13,7 +13,8 @@ import java.util.Date;
import java.util.TimeZone;
import org.eclipse.hawkbit.repository.model.Action.ActionType;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroup;
@@ -38,13 +39,13 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
private static final long serialVersionUID = -5624576558669213864L;
private static final String STYLE_DIST_WINDOW_ACTIONTYPE = "dist-window-actiontype";
private final I18N i18n;
private final VaadinMessageSource i18n;
private FlexibleOptionGroup actionTypeOptionGroup;
private DateField forcedTimeDateField;
public ActionTypeOptionGroupLayout(final I18N i18n) {
public ActionTypeOptionGroupLayout(final VaadinMessageSource i18n) {
this.i18n = i18n;
createOptionGroup();
@@ -87,7 +88,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
forceLabel.setStyleName("statusIconPending");
forceLabel.setIcon(FontAwesome.BOLT);
forceLabel.setCaption("Forced");
forceLabel.setDescription(i18n.get("tooltip.forced.item"));
forceLabel.setDescription(i18n.getMessage("tooltip.forced.item"));
forceLabel.setStyleName("padding-right-style");
addComponent(forceLabel);
@@ -98,7 +99,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
final Label softLabel = new Label();
softLabel.setSizeFull();
softLabel.setCaption("Soft");
softLabel.setDescription(i18n.get("tooltip.soft.item"));
softLabel.setDescription(i18n.getMessage("tooltip.soft.item"));
softLabel.setStyleName("padding-right-style");
addComponent(softLabel);
@@ -112,7 +113,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
autoForceLabel.setStyleName("statusIconPending");
autoForceLabel.setIcon(FontAwesome.HISTORY);
autoForceLabel.setCaption("Time Forced");
autoForceLabel.setDescription(i18n.get("tooltip.timeforced.item"));
autoForceLabel.setDescription(i18n.getMessage("tooltip.timeforced.item"));
autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
addComponent(autoForceLabel);
@@ -127,7 +128,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant()));
forcedTimeDateField.setImmediate(true);
forcedTimeDateField.setTimeZone(tz);
forcedTimeDateField.setLocale(i18n.getLocale());
forcedTimeDateField.setLocale(HawkbitCommonUtil.getLocale());
forcedTimeDateField.setResolution(Resolution.MINUTE);
forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL);
addComponent(forcedTimeDateField);

View File

@@ -21,7 +21,7 @@ import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.management.state.TargetTableFilters;
import org.eclipse.hawkbit.ui.management.targettable.TargetTable;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -43,7 +43,7 @@ public class CountMessageLabel extends Label {
private final transient TargetManagement targetManagement;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final ManagementUIState managementUIState;
@@ -63,7 +63,7 @@ public class CountMessageLabel extends Label {
* @param targetTable
* TargetTable
*/
public CountMessageLabel(final UIEventBus eventBus, final TargetManagement targetManagement, final I18N i18n,
public CountMessageLabel(final UIEventBus eventBus, final TargetManagement targetManagement, final VaadinMessageSource i18n,
final ManagementUIState managementUIState, final TargetTable targetTable) {
this.targetManagement = targetManagement;
this.i18n = i18n;
@@ -128,20 +128,20 @@ public class CountMessageLabel extends Label {
if (targFilParams.hasFilter()) {
message.append(HawkbitCommonUtil.SP_STRING_PIPE);
message.append(i18n.get("label.filter.targets"));
message.append(i18n.getMessage("label.filter.targets"));
if (managementUIState.getTargetsTruncated() != null) {
message.append(targetTable.size() + managementUIState.getTargetsTruncated());
} else {
message.append(targetTable.size());
}
message.append(HawkbitCommonUtil.SP_STRING_PIPE);
final String status = i18n.get("label.filter.status");
final String overdue = i18n.get("label.filter.overdue");
final String tags = i18n.get("label.filter.tags");
final String text = i18n.get("label.filter.text");
final String dists = i18n.get("label.filter.dist");
final String custom = i18n.get("label.filter.custom");
final StringBuilder filterMesgBuf = new StringBuilder(i18n.get("label.filter"));
final String status = i18n.getMessage("label.filter.status");
final String overdue = i18n.getMessage("label.filter.overdue");
final String tags = i18n.getMessage("label.filter.tags");
final String text = i18n.getMessage("label.filter.text");
final String dists = i18n.getMessage("label.filter.dist");
final String custom = i18n.getMessage("label.filter.custom");
final StringBuilder filterMesgBuf = new StringBuilder(i18n.getMessage("label.filter"));
filterMesgBuf.append(StringUtils.SPACE);
filterMesgBuf.append(getStatusMsg(targFilParams.getClickedStatusTargetTags(), status));
filterMesgBuf.append(getOverdueStateMsg(targFilParams.isOverdueFilterEnabled(), overdue));
@@ -161,7 +161,7 @@ public class CountMessageLabel extends Label {
if ((targetTable.size() + Optional.fromNullable(managementUIState.getTargetsTruncated())
.or(0L)) > SPUIDefinitions.MAX_TABLE_ENTRIES) {
message.append(HawkbitCommonUtil.SP_STRING_PIPE);
message.append(i18n.get("label.filter.shown"));
message.append(i18n.getMessage("label.filter.shown"));
message.append(SPUIDefinitions.MAX_TABLE_ENTRIES);
}
@@ -172,14 +172,14 @@ public class CountMessageLabel extends Label {
if (managementUIState.getTargetsTruncated() != null) {
// set the icon
setIcon(FontAwesome.INFO_CIRCLE);
setDescription(i18n.get("label.target.filter.truncated", managementUIState.getTargetsTruncated(),
setDescription(i18n.getMessage("label.target.filter.truncated", managementUIState.getTargetsTruncated(),
SPUIDefinitions.MAX_TABLE_ENTRIES));
} else {
setIcon(null);
setDescription(null);
}
final StringBuilder message = new StringBuilder(i18n.get("label.target.filter.count"));
final StringBuilder message = new StringBuilder(i18n.getMessage("label.target.filter.count"));
message.append(managementUIState.getTargetsCountAll());
return message;
@@ -194,11 +194,11 @@ public class CountMessageLabel extends Label {
private void displayCountLabel(final Long distId) {
final Long targetsWithAssigedDsCount = targetManagement.countTargetByAssignedDistributionSet(distId);
final Long targetsWithInstalledDsCount = targetManagement.countTargetByInstalledDistributionSet(distId);
final StringBuilder message = new StringBuilder(i18n.get("label.target.count"));
final StringBuilder message = new StringBuilder(i18n.getMessage("label.target.count"));
message.append("<span class=\"assigned-count-message\">");
message.append(i18n.get("label.assigned.count", new Object[] { targetsWithAssigedDsCount }));
message.append(i18n.getMessage("label.assigned.count", new Object[] { targetsWithAssigedDsCount }));
message.append("</span>, <span class=\"installed-count-message\"> ");
message.append(i18n.get("label.installed.count", new Object[] { targetsWithInstalledDsCount }));
message.append(i18n.getMessage("label.installed.count", new Object[] { targetsWithInstalledDsCount }));
message.append("</span>");
setValue(message.toString());
}

View File

@@ -38,7 +38,7 @@ import org.eclipse.hawkbit.ui.management.event.TargetTagTableEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.management.targettable.TargetTable;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -77,7 +77,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
private final transient DistributionSetManagement distributionSetManagement;
public DeleteActionsLayout(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
public DeleteActionsLayout(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventBus,
final UINotification notification, final TagManagement tagManagementService,
final ManagementViewClientCriterion managementViewClientCriterion,
final ManagementUIState managementUIState, final TargetManagement targetManagement,
@@ -156,7 +156,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
@Override
protected String getDeleteAreaLabel() {
return i18n.get("label.components.drop.area");
return i18n.getMessage("label.components.drop.area");
}
@Override
@@ -173,7 +173,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
protected void processDroppedComponent(final DragAndDropEvent event) {
final Component source = event.getTransferable().getSourceComponent();
if (!DeleteActionsLayoutHelper.isComponentDeletable(source)) {
notification.displayValidationError(i18n.get("message.cannot.delete"));
notification.displayValidationError(i18n.getMessage("message.cannot.delete"));
} else {
processDeletion(event, source);
}
@@ -197,7 +197,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
private boolean tagNotInUSeInBulkUpload(final Component source) {
final String tagName = HawkbitCommonUtil.removePrefix(source.getId(), SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
if (managementUIState.getTargetTableFilters().getBulkUpload().getAssignedTagNames().contains(tagName)) {
notification.displayValidationError(i18n.get("message.tag.use.bulk.upload", tagName));
notification.displayValidationError(i18n.getMessage("message.tag.use.bulk.upload", tagName));
return false;
}
return true;
@@ -243,7 +243,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
final String tagName = HawkbitCommonUtil.removePrefix(source.getId(),
SPUIDefinitions.DISTRIBUTION_TAG_ID_PREFIXS);
if (managementUIState.getDistributionTableFilters().getDistSetTags().contains(tagName)) {
notification.displayValidationError(i18n.get("message.tag.delete", new Object[] { tagName }));
notification.displayValidationError(i18n.getMessage("message.tag.delete", new Object[] { tagName }));
} else {
tagManagementService.deleteDistributionSetTag(tagName);
@@ -253,14 +253,14 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
new DistributionSetTagTableEvent(BaseEntityEventType.REMOVE_ENTITY, Arrays.asList(id)));
}
notification.displaySuccess(i18n.get("message.delete.success", new Object[] { tagName }));
notification.displaySuccess(i18n.getMessage("message.delete.success", new Object[] { tagName }));
}
}
private void deleteTargetTag(final Component source) {
final String tagName = HawkbitCommonUtil.removePrefix(source.getId(), SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
if (managementUIState.getTargetTableFilters().getClickedTargetTags().contains(tagName)) {
notification.displayValidationError(i18n.get("message.tag.delete", new Object[] { tagName }));
notification.displayValidationError(i18n.getMessage("message.tag.delete", new Object[] { tagName }));
} else {
tagManagementService.deleteTargetTag(tagName);
@@ -269,7 +269,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
eventBus.publish(this, new TargetTagTableEvent(BaseEntityEventType.REMOVE_ENTITY, Arrays.asList(id)));
}
notification.displaySuccess(i18n.get("message.delete.success", new Object[] { tagName }));
notification.displaySuccess(i18n.getMessage("message.delete.success", new Object[] { tagName }));
}
}
@@ -291,7 +291,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
.findDistributionSetAllById(ids);
if (findDistributionSetAllById.isEmpty()) {
notification.displayWarning(i18n.get("distributionsets.not.exists"));
notification.displayWarning(i18n.getMessage("distributionsets.not.exists"));
return;
}
@@ -317,7 +317,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
if (newDeletedSize - existingDeletedSize == currentValues.size()) {
return;
}
notification.displayValidationError(i18n.get(messageKey));
notification.displayValidationError(i18n.getMessage(messageKey));
}
private void showAlreadyDeletedDistributionSetNotfication(final int existingDeletedSize, final int newDeletedSize,
@@ -326,7 +326,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
if (newDeletedSize != existingDeletedSize) {
return;
}
notification.displayValidationError(i18n.get(messageKey));
notification.displayValidationError(i18n.getMessage(messageKey));
}
private boolean isDsInUseInBulkUpload(final Set<Long> distributionIdNameSet, final Long dsInBulkUpload) {
@@ -334,10 +334,10 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
final Optional<DistributionSet> distributionSet = distributionSetManagement
.findDistributionSetById(dsInBulkUpload);
if (!distributionSet.isPresent()) {
notification.displayWarning(i18n.get("distributionset.not.exists"));
notification.displayWarning(i18n.getMessage("distributionset.not.exists"));
return true;
}
notification.displayValidationError(i18n.get("message.tag.use.bulk.upload", HawkbitCommonUtil
notification.displayValidationError(i18n.getMessage("message.tag.use.bulk.upload", HawkbitCommonUtil
.getFormattedNameVersion(distributionSet.get().getName(), distributionSet.get().getVersion())));
return true;
}
@@ -350,7 +350,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
final Set<Long> targetIdSet = targetTable.getDeletedEntityByTransferable(transferable);
final Collection<Target> findTargetAllById = targetManagement.findTargetAllById(targetIdSet);
if (findTargetAllById.isEmpty()) {
notification.displayWarning(i18n.get("targets.not.exists"));
notification.displayWarning(i18n.getMessage("targets.not.exists"));
return;
}
@@ -379,7 +379,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
private Boolean canTargetBeDeleted() {
if (!permChecker.hasDeleteTargetPermission()) {
notification.displayValidationError(i18n.get("message.permission.insufficient"));
notification.displayValidationError(i18n.getMessage("message.permission.insufficient"));
return false;
}
return true;
@@ -387,7 +387,7 @@ public class DeleteActionsLayout extends AbstractDeleteActionsLayout {
private Boolean canDSBeDeleted() {
if (!permChecker.hasDeleteDistributionPermission()) {
notification.displayValidationError(i18n.get("message.permission.insufficient"));
notification.displayValidationError(i18n.getMessage("message.permission.insufficient"));
return false;
}
return true;

View File

@@ -36,7 +36,7 @@ import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
import org.eclipse.hawkbit.ui.management.footer.ActionTypeOptionGroupLayout.ActionTypeOption;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -80,7 +80,7 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
private ConfirmationTab assignmnetTab;
public ManangementConfirmationWindowLayout(final I18N i18n, final UIEventBus eventBus,
public ManangementConfirmationWindowLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
final ManagementUIState managementUIState, final TargetManagement targetManagement,
final DeploymentManagement deploymentManagement,
final DistributionSetManagement distributionSetManagement) {
@@ -96,13 +96,13 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
protected Map<String, ConfirmationTab> getConfimrationTabs() {
final Map<String, ConfirmationTab> tabs = Maps.newHashMapWithExpectedSize(3);
if (!managementUIState.getDeletedDistributionList().isEmpty()) {
tabs.put(i18n.get("caption.delete.dist.accordion.tab"), createDeletedDistributionTab());
tabs.put(i18n.getMessage("caption.delete.dist.accordion.tab"), createDeletedDistributionTab());
}
if (!managementUIState.getDeletedTargetList().isEmpty()) {
tabs.put(i18n.get("caption.delete.target.accordion.tab"), createDeletedTargetTab());
tabs.put(i18n.getMessage("caption.delete.target.accordion.tab"), createDeletedTargetTab());
}
if (!managementUIState.getAssignedList().isEmpty()) {
tabs.put(i18n.get("caption.assign.dist.accordion.tab"), createAssignmentTab());
tabs.put(i18n.getMessage("caption.assign.dist.accordion.tab"), createAssignmentTab());
}
return tabs;
@@ -113,10 +113,10 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
assignmnetTab = new ConfirmationTab();
assignmnetTab.getConfirmAll().setId(UIComponentIdProvider.SAVE_ASSIGNMENT);
assignmnetTab.getConfirmAll().setIcon(FontAwesome.SAVE);
assignmnetTab.getConfirmAll().setCaption(i18n.get("button.assign.all"));
assignmnetTab.getConfirmAll().setCaption(i18n.getMessage("button.assign.all"));
assignmnetTab.getConfirmAll().addClickListener(event -> saveAllAssignments(assignmnetTab));
assignmnetTab.getDiscardAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
assignmnetTab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
assignmnetTab.getDiscardAll().setId(UIComponentIdProvider.DISCARD_ASSIGNMENT);
assignmnetTab.getDiscardAll().addClickListener(event -> discardAllAssignments(assignmnetTab));
@@ -133,8 +133,8 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
assignmnetTab.getTable().setColumnExpandRatio(DISTRIBUTION_NAME, 2);
assignmnetTab.getTable().setColumnExpandRatio(DISCARD_CHANGES, 1);
assignmnetTab.getTable().setVisibleColumns(TARGET_NAME, DISTRIBUTION_NAME, DISCARD_CHANGES);
assignmnetTab.getTable().setColumnHeaders(i18n.get("header.first.assignment.table"),
i18n.get("header.second.assignment.table"), i18n.get("header.third.assignment.table"));
assignmnetTab.getTable().setColumnHeaders(i18n.getMessage("header.first.assignment.table"),
i18n.getMessage("header.second.assignment.table"), i18n.getMessage("header.third.assignment.table"));
assignmnetTab.getTable().setColumnAlignment(DISCARD_CHANGES, Align.CENTER);
actionTypeOptionGroupLayout.selectDefaultOption();
@@ -189,7 +189,7 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
resfreshPinnedDetails(saveAssignedList);
managementUIState.getAssignedList().clear();
setActionMessage(i18n.get("message.target.ds.assign.success"));
setActionMessage(i18n.getMessage("message.target.ds.assign.success"));
removeCurrentTab(tab);
eventBus.publish(this, SaveActionWindowEvent.SAVED_ASSIGNMENTS);
}
@@ -220,18 +220,18 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
private String getAssigmentSuccessMessage(final int assignedCount) {
return FontAwesome.TASKS.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.target.assignment", new Object[] { assignedCount });
+ i18n.getMessage("message.target.assignment", new Object[] { assignedCount });
}
private String getDuplicateAssignmentMessage(final int alreadyAssignedCount) {
return FontAwesome.TASKS.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.target.alreadyAssigned", new Object[] { alreadyAssignedCount });
+ i18n.getMessage("message.target.alreadyAssigned", new Object[] { alreadyAssignedCount });
}
private void discardAllAssignments(final ConfirmationTab tab) {
removeCurrentTab(tab);
managementUIState.getAssignedList().clear();
setActionMessage(i18n.get("message.assign.discard.success"));
setActionMessage(i18n.getMessage("message.assign.discard.success"));
eventBus.publish(this, SaveActionWindowEvent.DISCARD_ALL_ASSIGNMENTS);
}
@@ -275,10 +275,10 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
// TobeDone ? y to set caption every time??
tab.getConfirmAll().setId(UIComponentIdProvider.TARGET_DELETE_ALL);
tab.getConfirmAll().setIcon(FontAwesome.TRASH_O);
tab.getConfirmAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().addClickListener(event -> deleteAllTargets(tab));
tab.getDiscardAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().addClickListener(event -> discardAllTargets(tab));
/* Add items container to the table. */
@@ -292,8 +292,8 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
});
tab.getTable().setVisibleColumns(TARGET_NAME, DISCARD_CHANGES);
tab.getTable().setColumnHeaders(i18n.get("header.first.deletetarget.table"),
i18n.get("header.second.deletetarget.table"));
tab.getTable().setColumnHeaders(i18n.getMessage("header.first.deletetarget.table"),
i18n.getMessage("header.second.deletetarget.table"));
tab.getTable().setColumnExpandRatio(TARGET_NAME, SPUIDefinitions.TARGET_DISTRIBUTION_COLUMN_WIDTH);
tab.getTable().setColumnExpandRatio(DISCARD_CHANGES, SPUIDefinitions.DISCARD_COLUMN_WIDTH);
@@ -307,10 +307,10 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
// TobeDone ? y to set caption every time??
tab.getConfirmAll().setId(UIComponentIdProvider.DIST_DELETE_ALL);
tab.getConfirmAll().setIcon(FontAwesome.TRASH_O);
tab.getConfirmAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DELETE_ALL));
tab.getConfirmAll().addClickListener(event -> deleteAllDistributions(tab));
tab.getDiscardAll().setCaption(i18n.get(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().setCaption(i18n.getMessage(SPUILabelDefinitions.BUTTON_DISCARD_ALL));
tab.getDiscardAll().addClickListener(event -> discardAllDistributions(tab));
/* Add items container to the table. */
@@ -326,8 +326,8 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
tab.getTable().setColumnExpandRatio(DISTRIBUTION_NAME, SPUIDefinitions.TARGET_DISTRIBUTION_COLUMN_WIDTH);
tab.getTable().setColumnExpandRatio(DISCARD_CHANGES, SPUIDefinitions.DISCARD_COLUMN_WIDTH);
tab.getTable().setVisibleColumns(DISTRIBUTION_NAME, DISCARD_CHANGES);
tab.getTable().setColumnHeaders(i18n.get("header.one.deletedist.table"),
i18n.get("header.second.deletedist.table"));
tab.getTable().setColumnHeaders(i18n.getMessage("header.one.deletedist.table"),
i18n.getMessage("header.second.deletedist.table"));
tab.getTable().setColumnAlignment(DISCARD_CHANGES, Align.CENTER);
return tab;
}
@@ -363,7 +363,7 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
private void discardAllDistributions(final ConfirmationTab tab) {
removeCurrentTab(tab);
managementUIState.getDeletedDistributionList().clear();
setActionMessage(i18n.get("message.dist.discard.success"));
setActionMessage(i18n.getMessage("message.dist.discard.success"));
eventBus.publish(this, SaveActionWindowEvent.DISCARD_ALL_DISTRIBUTIONS);
}
@@ -376,11 +376,11 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.REMOVE_ENTITY, deletedIds));
addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.dist.deleted", managementUIState.getDeletedDistributionList().size()));
+ i18n.getMessage("message.dist.deleted", managementUIState.getDeletedDistributionList().size()));
removeDeletedDistributionsFromAssignmentTab();
removeCurrentTab(tab);
setActionMessage(i18n.get("message.dist.delete.success"));
setActionMessage(i18n.getMessage("message.dist.delete.success"));
managementUIState.getTargetTableFilters().getPinnedDistId()
.ifPresent(distId -> unPinDeletedDS(deletedIds, distId));
@@ -455,7 +455,7 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
private void discardAllTargets(final ConfirmationTab tab) {
removeCurrentTab(tab);
setActionMessage(i18n.get("message.target.discard.success"));
setActionMessage(i18n.getMessage("message.target.discard.success"));
managementUIState.getDeletedTargetList().clear();
eventBus.publish(this, SaveActionWindowEvent.DISCARD_ALL_TARGETS);
}
@@ -470,9 +470,9 @@ public class ManangementConfirmationWindowLayout extends AbstractConfirmationWin
eventBus.publish(this, new TargetTableEvent(BaseEntityEventType.REMOVE_ENTITY, targetIds));
addToConsolitatedMsg(FontAwesome.TRASH_O.getHtml() + SPUILabelDefinitions.HTML_SPACE
+ i18n.get("message.target.deleted", targetIds.size()));
+ i18n.getMessage("message.target.deleted", targetIds.size()));
removeCurrentTab(tab);
setActionMessage(i18n.get("message.target.delete.success"));
setActionMessage(i18n.getMessage("message.target.delete.success"));
removeDeletedTargetsFromAssignmentTab();
managementUIState.getDistributionTableFilters().getPinnedTarget().ifPresent(this::unPinDeletedTarget);

View File

@@ -41,7 +41,7 @@ import org.eclipse.hawkbit.ui.management.event.TargetTableEvent.TargetComponentE
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.management.state.TargetBulkUpload;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -85,7 +85,7 @@ public class BulkUploadHandler extends CustomComponent
private final ComboBox comboBox;
private final TextArea descTextArea;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final transient DeploymentManagement deploymentManagement;
private final transient DistributionSetManagement distributionSetManagement;
@@ -108,7 +108,7 @@ public class BulkUploadHandler extends CustomComponent
BulkUploadHandler(final TargetBulkUpdateWindowLayout targetBulkUpdateWindowLayout,
final TargetManagement targetManagement, final TagManagement tagManagement,
final EntityFactory entityFactory, final DistributionSetManagement distributionSetManagement,
final ManagementUIState managementUIState, final DeploymentManagement deploymentManagement, final I18N i18n,
final ManagementUIState managementUIState, final DeploymentManagement deploymentManagement, final VaadinMessageSource i18n,
final UI uiInstance, final Executor uiExecutor) {
this.uiInstance = uiInstance;
this.comboBox = targetBulkUpdateWindowLayout.getDsNamecomboBox();
@@ -305,7 +305,7 @@ public class BulkUploadHandler extends CustomComponent
final List<String> targetsList = targetBulkUpload.getTargetsCreated();
final Long dsSelected = (Long) comboBox.getValue();
if (!distributionSetManagement.findDistributionSetById(dsSelected).isPresent()) {
return i18n.get("message.bulk.upload.assignment.failed");
return i18n.getMessage("message.bulk.upload.assignment.failed");
}
deploymentManagement.assignDistributionSet(targetBulkUpload.getDsNameAndVersion(), actionType,
forcedTimeStamp, targetsList);
@@ -328,9 +328,9 @@ public class BulkUploadHandler extends CustomComponent
return null;
}
if (deletedTags.size() == 1) {
return i18n.get("message.bulk.upload.tag.assignment.failed", deletedTags.get(0));
return i18n.getMessage("message.bulk.upload.tag.assignment.failed", deletedTags.get(0));
}
return i18n.get("message.bulk.upload.tag.assignments.failed");
return i18n.getMessage("message.bulk.upload.tag.assignments.failed");
}
private boolean ifTagsSelected() {
@@ -392,7 +392,7 @@ public class BulkUploadHandler extends CustomComponent
if (!event.getFilename().endsWith(".csv")) {
new HawkbitErrorNotificationMessage(SPUILabelDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE, null,
i18n.get("bulk.targets.upload"), true).show(Page.getCurrent());
i18n.getMessage("bulk.targets.upload"), true).show(Page.getCurrent());
LOG.error("Wrong file format for file {}", event.getFilename());
upload.interruptUpload();
} else {

View File

@@ -22,7 +22,7 @@ import org.eclipse.hawkbit.ui.common.builder.WindowBuilder;
import org.eclipse.hawkbit.ui.common.table.BaseEntityEventType;
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -44,7 +44,7 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
private static final long serialVersionUID = -6659290471705262389L;
private final I18N i18n;
private final VaadinMessageSource i18n;
private final transient TargetManagement targetManagement;
@@ -62,7 +62,7 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
private FormLayout formLayout;
private CommonDialogWindow window;
TargetAddUpdateWindowLayout(final I18N i18n, final TargetManagement targetManagement, final UIEventBus eventBus,
TargetAddUpdateWindowLayout(final VaadinMessageSource i18n, final TargetManagement targetManagement, final UIEventBus eventBus,
final UINotification uINotification, final EntityFactory entityFactory) {
this.i18n = i18n;
this.targetManagement = targetManagement;
@@ -96,18 +96,18 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
private void createRequiredComponents() {
controllerIDTextField = createTextField("prompt.target.id", UIComponentIdProvider.TARGET_ADD_CONTROLLER_ID);
controllerIDTextField.addValidator(new RegexpValidator("[.\\S]*", i18n.get("message.target.whitespace.check")));
controllerIDTextField.addValidator(new RegexpValidator("[.\\S]*", i18n.getMessage("message.target.whitespace.check")));
nameTextField = createTextField("textfield.name", UIComponentIdProvider.TARGET_ADD_NAME);
nameTextField.setRequired(false);
descTextArea = new TextAreaBuilder().caption(i18n.get("textfield.description")).style("text-area-style")
.prompt(i18n.get("textfield.description")).immediate(true).id(UIComponentIdProvider.TARGET_ADD_DESC)
descTextArea = new TextAreaBuilder().caption(i18n.getMessage("textfield.description")).style("text-area-style")
.prompt(i18n.getMessage("textfield.description")).immediate(true).id(UIComponentIdProvider.TARGET_ADD_DESC)
.buildTextComponent();
descTextArea.setNullRepresentation(StringUtils.EMPTY);
}
private TextField createTextField(final String in18Key, final String id) {
return new TextFieldBuilder().caption(i18n.get(in18Key)).required(true).prompt(i18n.get(in18Key))
return new TextFieldBuilder().caption(i18n.getMessage(in18Key)).required(true).prompt(i18n.getMessage(in18Key))
.immediate(true).id(id).buildTextComponent();
}
@@ -129,7 +129,7 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
final Target target = targetManagement.updateTarget(entityFactory.target().update(controllerId)
.name(nameTextField.getValue()).description(descTextArea.getValue()));
/* display success msg */
uINotification.displaySuccess(i18n.get("message.update.success", new Object[] { target.getName() }));
uINotification.displaySuccess(i18n.getMessage("message.update.success", new Object[] { target.getName() }));
// publishing through event bus
eventBus.publish(this, new TargetTableEvent(BaseEntityEventType.UPDATED_ENTITY, target));
}
@@ -144,12 +144,12 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
eventBus.publish(this, new TargetTableEvent(BaseEntityEventType.ADD_ENTITY, newTarget));
uINotification.displaySuccess(i18n.get("message.save.success", new Object[] { newTarget.getName() }));
uINotification.displaySuccess(i18n.getMessage("message.save.success", new Object[] { newTarget.getName() }));
}
public Window createNewWindow() {
window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW)
.caption(i18n.get(UIComponentIdProvider.TARGET_ADD_CAPTION)).content(this).layout(formLayout).i18n(i18n)
.caption(i18n.getMessage(UIComponentIdProvider.TARGET_ADD_CAPTION)).content(this).layout(formLayout).i18n(i18n)
.saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow();
return window;
@@ -166,7 +166,7 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
public Window getWindow(final String controllerId) {
final Optional<Target> target = targetManagement.findTargetByControllerID(controllerId);
if (!target.isPresent()) {
uINotification.displayWarning(i18n.get("target.not.exists", new Object[] { controllerId }));
uINotification.displayWarning(i18n.getMessage("target.not.exists", new Object[] { controllerId }));
return null;
}
populateValuesOfTarget(target.get());
@@ -193,7 +193,7 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
final Optional<Target> existingTarget = targetManagement.findTargetByControllerID(newControlllerId.trim());
if (existingTarget.isPresent()) {
uINotification.displayValidationError(
i18n.get("message.target.duplicate.check", new Object[] { newControlllerId }));
i18n.getMessage("message.target.duplicate.check", new Object[] { newControlllerId }));
return true;
} else {
return false;

View File

@@ -29,7 +29,7 @@ import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
import org.eclipse.hawkbit.ui.components.ProxyTarget;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
@@ -58,7 +58,7 @@ public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
private String searchText;
private Boolean noTagClicked;
private transient TargetManagement targetManagement;
private transient I18N i18N;
private transient VaadinMessageSource i18N;
private Long pinnedDistId;
private Long targetFilterQueryId;
private ManagementUIState managementUIState;
@@ -226,9 +226,9 @@ public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
return managementUIState;
}
private I18N getI18N() {
private VaadinMessageSource getI18N() {
if (i18N == null) {
i18N = SpringContextHelper.getBean(I18N.class);
i18N = SpringContextHelper.getBean(VaadinMessageSource.class);
}
return i18N;
}

View File

@@ -15,7 +15,7 @@ import org.eclipse.hawkbit.repository.model.TargetTag;
import org.eclipse.hawkbit.ui.SpPermissionChecker;
import org.eclipse.hawkbit.ui.common.tagdetails.AbstractTargetTagToken;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.springframework.data.domain.PageRequest;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -29,7 +29,7 @@ public class TargetBulkTokenTags extends AbstractTargetTagToken {
private static final int MAX_TAGS = 500;
TargetBulkTokenTags(final SpPermissionChecker checker, final I18N i18n, final UINotification uinotification,
TargetBulkTokenTags(final SpPermissionChecker checker, final VaadinMessageSource i18n, final UINotification uinotification,
final UIEventBus eventBus, final ManagementUIState managementUIState, final TagManagement tagManagement) {
super(checker, i18n, uinotification, eventBus, managementUIState, tagManagement);
}
@@ -52,7 +52,7 @@ public class TargetBulkTokenTags extends AbstractTargetTagToken {
@Override
protected String getTokenInputPrompt() {
return i18n.get("combo.type.tag.name");
return i18n.getMessage("combo.type.tag.name");
}
@Override

View File

@@ -27,7 +27,7 @@ import org.eclipse.hawkbit.ui.management.dstable.DistributionBeanQuery;
import org.eclipse.hawkbit.ui.management.event.BulkUploadPopupEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.management.state.TargetBulkUpload;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
@@ -62,7 +62,7 @@ import com.vaadin.ui.themes.ValoTheme;
* Bulk target upload layout.
*/
public class TargetBulkUpdateWindowLayout extends CustomComponent {
private final I18N i18n;
private final VaadinMessageSource i18n;
private final transient TargetManagement targetManagement;
private final transient DistributionSetManagement distributionSetManagement;
@@ -96,7 +96,7 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent {
private Button minimizeButton;
private Button closeButton;
TargetBulkUpdateWindowLayout(final I18N i18n, final TargetManagement targetManagement, final UIEventBus eventBus,
TargetBulkUpdateWindowLayout(final VaadinMessageSource i18n, final TargetManagement targetManagement, final UIEventBus eventBus,
final ManagementUIState managementUIState, final DeploymentManagement deploymentManagement,
final UiProperties uiproperties, final SpPermissionChecker checker, final UINotification uinotification,
final TagManagement tagManagement, final DistributionSetManagement distributionSetManagement,
@@ -145,7 +145,7 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent {
bulkUploader = getBulkUploadHandler();
linkToSystemConfigHelp = SPUIComponentProvider
.getHelpLink(uiproperties.getLinks().getDocumentation().getDeploymentView());
windowCaption = new Label(i18n.get("caption.bulk.upload.targets"));
windowCaption = new Label(i18n.getMessage("caption.bulk.upload.targets"));
minimizeButton = getMinimizeButton();
closeButton = getCloseButton();
}
@@ -194,8 +194,8 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent {
}
private TextArea getDescriptionTextArea() {
final TextArea description = new TextAreaBuilder().caption(i18n.get("textfield.description"))
.style("text-area-style").prompt(i18n.get("textfield.description")).immediate(true)
final TextArea description = new TextAreaBuilder().caption(i18n.getMessage("textfield.description"))
.style("text-area-style").prompt(i18n.getMessage("textfield.description")).immediate(true)
.id(UIComponentIdProvider.BULK_UPLOAD_DESC).buildTextComponent();
description.setNullRepresentation(StringUtils.EMPTY);
description.setWidth("100%");
@@ -204,8 +204,8 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent {
private ComboBox getDsComboField() {
final Container container = createContainer();
final ComboBox dsComboBox = SPUIComponentProvider.getComboBox(i18n.get("bulkupload.ds.name"), "", null, null,
false, "", i18n.get("bulkupload.ds.name"));
final ComboBox dsComboBox = SPUIComponentProvider.getComboBox(i18n.getMessage("bulkupload.ds.name"), "", null, null,
false, "", i18n.getMessage("bulkupload.ds.name"));
dsComboBox.setSizeUndefined();
dsComboBox.addStyleName(SPUIDefinitions.BULK_UPLOD_DS_COMBO_STYLE);
dsComboBox.setImmediate(true);

View File

@@ -24,7 +24,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
@@ -59,7 +59,7 @@ public class TargetDetails extends AbstractTableDetailsLayout<Target> {
private VerticalLayout assignedDistLayout;
private VerticalLayout installedDistLayout;
TargetDetails(final I18N i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
TargetDetails(final VaadinMessageSource i18n, final UIEventBus eventBus, final SpPermissionChecker permissionChecker,
final ManagementUIState managementUIState, final UINotification uiNotification,
final TagManagement tagManagement, final TargetManagement targetManagement,
final EntityFactory entityFactory) {
@@ -74,18 +74,18 @@ public class TargetDetails extends AbstractTableDetailsLayout<Target> {
@Override
protected String getDefaultCaption() {
return getI18n().get("target.details.header");
return getI18n().getMessage("target.details.header");
}
@Override
protected void addTabs(final TabSheet detailsTab) {
detailsTab.addTab(createDetailsLayout(), getI18n().get("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().get("caption.tab.description"), null);
detailsTab.addTab(createAttributesLayout(), getI18n().get("caption.attributes.tab"), null);
detailsTab.addTab(createAssignedDistLayout(), getI18n().get("header.target.assigned"), null);
detailsTab.addTab(createInstalledDistLayout(), getI18n().get("header.target.installed"), null);
detailsTab.addTab(createTagsLayout(), getI18n().get("caption.tags.tab"), null);
detailsTab.addTab(createLogLayout(), getI18n().get("caption.logs.tab"), null);
detailsTab.addTab(createDetailsLayout(), getI18n().getMessage("caption.tab.details"), null);
detailsTab.addTab(createDescriptionLayout(), getI18n().getMessage("caption.tab.description"), null);
detailsTab.addTab(createAttributesLayout(), getI18n().getMessage("caption.attributes.tab"), null);
detailsTab.addTab(createAssignedDistLayout(), getI18n().getMessage("header.target.assigned"), null);
detailsTab.addTab(createInstalledDistLayout(), getI18n().getMessage("header.target.installed"), null);
detailsTab.addTab(createTagsLayout(), getI18n().getMessage("caption.tags.tab"), null);
detailsTab.addTab(createLogLayout(), getI18n().getMessage("caption.logs.tab"), null);
}
@@ -118,7 +118,7 @@ public class TargetDetails extends AbstractTableDetailsLayout<Target> {
if (targetWindow == null) {
return;
}
targetWindow.setCaption(getI18n().get(UIComponentIdProvider.TARGET_UPDATE_CAPTION));
targetWindow.setCaption(getI18n().getMessage(UIComponentIdProvider.TARGET_UPDATE_CAPTION));
UI.getCurrent().addWindow(targetWindow);
targetWindow.setVisible(Boolean.TRUE);
}
@@ -165,18 +165,18 @@ public class TargetDetails extends AbstractTableDetailsLayout<Target> {
final VerticalLayout detailsTabLayout = getDetailsLayout();
detailsTabLayout.removeAllComponents();
final Label controllerLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.target.id"),
final Label controllerLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.target.id"),
HawkbitCommonUtil.trimAndNullIfEmpty(controllerId) == null ? "" : controllerId);
controllerLabel.setId(UIComponentIdProvider.TARGET_CONTROLLER_ID);
detailsTabLayout.addComponent(controllerLabel);
final Label lastPollDtLabel = SPUIComponentProvider.createNameValueLabel(
getI18n().get("label.target.lastpolldate"),
getI18n().getMessage("label.target.lastpolldate"),
HawkbitCommonUtil.trimAndNullIfEmpty(lastQueryDate) == null ? "" : lastQueryDate);
lastPollDtLabel.setId(UIComponentIdProvider.TARGET_LAST_QUERY_DT);
detailsTabLayout.addComponent(lastPollDtLabel);
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().get("label.ip"),
final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.ip"),
address == null ? StringUtils.EMPTY : address.toString());
typeLabel.setId(UIComponentIdProvider.TARGET_IP_ADDRESS);
detailsTabLayout.addComponent(typeLabel);
@@ -192,7 +192,7 @@ public class TargetDetails extends AbstractTableDetailsLayout<Target> {
final HorizontalLayout securityTokenLayout = new HorizontalLayout();
final Label securityTableLbl = new Label(
SPUIComponentProvider.getBoldHTMLText(getI18n().get("label.target.security.token")), ContentMode.HTML);
SPUIComponentProvider.getBoldHTMLText(getI18n().getMessage("label.target.security.token")), ContentMode.HTML);
securityTableLbl.addStyleName(SPUIDefinitions.TEXT_STYLE);
securityTableLbl.addStyleName("label-style");
@@ -215,10 +215,10 @@ public class TargetDetails extends AbstractTableDetailsLayout<Target> {
if (distributionSet == null) {
return;
}
layout.addComponent(SPUIComponentProvider.createNameValueLabel(getI18n().get("label.dist.details.name"),
layout.addComponent(SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.name"),
distributionSet.getName()));
layout.addComponent(SPUIComponentProvider.createNameValueLabel(getI18n().get("label.dist.details.version"),
layout.addComponent(SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.dist.details.version"),
distributionSet.getVersion()));
distributionSet.getModules()

View File

@@ -61,7 +61,7 @@ import org.eclipse.hawkbit.ui.push.CancelTargetAssignmentEventContainer;
import org.eclipse.hawkbit.ui.push.TargetUpdatedEventContainer;
import org.eclipse.hawkbit.ui.utils.AssignInstalledDSTooltipGenerator;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
@@ -119,7 +119,7 @@ public class TargetTable extends AbstractTable<Target, Long> {
private Button targetPinnedBtn;
private boolean isTargetPinned;
public TargetTable(final UIEventBus eventBus, final I18N i18n, final UINotification notification,
public TargetTable(final UIEventBus eventBus, final VaadinMessageSource i18n, final UINotification notification,
final TargetManagement targetManagement, final ManagementUIState managementUIState,
final SpPermissionChecker permChecker, final ManagementViewClientCriterion managementViewClientCriterion,
final DistributionSetManagement distributionSetManagement, final TagManagement tagManagement) {
@@ -499,7 +499,7 @@ public class TargetTable extends AbstractTable<Target, Long> {
.toString();
if (tagName.equals(SPUIDefinitions.TARGET_TAG_BUTTON)) {
notification.displayValidationError(
i18n.get("message.tag.cannot.be.assigned", new Object[] { i18n.get("label.no.tag.assigned") }));
i18n.getMessage("message.tag.cannot.be.assigned", new Object[] { i18n.getMessage("label.no.tag.assigned") }));
return false;
}
return true;
@@ -511,7 +511,7 @@ public class TargetTable extends AbstractTable<Target, Long> {
final String targTagName = HawkbitCommonUtil.removePrefix(event.getTransferable().getSourceComponent().getId(),
SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
if (targetList.isEmpty()) {
final String actionDidNotWork = i18n.get("message.action.did.not.work");
final String actionDidNotWork = i18n.getMessage("message.action.did.not.work");
notification.displayValidationError(actionDidNotWork);
return;
}
@@ -540,14 +540,14 @@ public class TargetTable extends AbstractTable<Target, Long> {
final List<String> controllerIds = targetManagement.findTargetAllById(targetIds).stream()
.map(Target::getControllerId).collect(Collectors.toList());
if (controllerIds.isEmpty()) {
notification.displayWarning(i18n.get("targets.not.exists"));
notification.displayWarning(i18n.getMessage("targets.not.exists"));
return new TargetTagAssignmentResult(0, 0, 0, Lists.newArrayListWithCapacity(0),
Lists.newArrayListWithCapacity(0), null);
}
final Optional<TargetTag> tag = tagManagement.findTargetTag(targTagName);
if (!tag.isPresent()) {
notification.displayWarning(i18n.get("targettag.not.exists", new Object[] { targTagName }));
notification.displayWarning(i18n.getMessage("targettag.not.exists", new Object[] { targTagName }));
return new TargetTagAssignmentResult(0, 0, 0, Lists.newArrayListWithCapacity(0),
Lists.newArrayListWithCapacity(0), null);
}
@@ -565,11 +565,11 @@ public class TargetTable extends AbstractTable<Target, Long> {
SPUIDefinitions.TARGET_TAG_ID_PREFIXS);
if (wrapperSource.getId().startsWith(SPUIDefinitions.TARGET_TAG_ID_PREFIXS)) {
if ("NO TAG".equals(tagName)) {
notification.displayValidationError(i18n.get(ACTION_NOT_ALLOWED_MSG));
notification.displayValidationError(i18n.getMessage(ACTION_NOT_ALLOWED_MSG));
return false;
}
} else {
notification.displayValidationError(i18n.get(ACTION_NOT_ALLOWED_MSG));
notification.displayValidationError(i18n.getMessage(ACTION_NOT_ALLOWED_MSG));
return false;
}
@@ -595,13 +595,13 @@ public class TargetTable extends AbstractTable<Target, Long> {
final Object targetItemId = dropData.getItemIdOver();
LOG.debug("Adding a log to check if targetItemId is null : {} ", targetItemId);
if (targetItemId == null) {
getNotification().displayWarning(i18n.get("target.not.exists", new Object[] { "" }));
getNotification().displayWarning(i18n.getMessage("target.not.exists", new Object[] { "" }));
return;
}
final Long targetId = (Long) targetItemId;
final Optional<Target> target = targetManagement.findTargetById(targetId);
if (!target.isPresent()) {
getNotification().displayWarning(i18n.get("target.not.exists", new Object[] { "" }));
getNotification().displayWarning(i18n.getMessage("target.not.exists", new Object[] { "" }));
return;
}
final TargetIdName createTargetIdName = new TargetIdName(target.get());
@@ -610,7 +610,7 @@ public class TargetTable extends AbstractTable<Target, Long> {
.findDistributionSetAllById(ids);
if (findDistributionSetAllById.isEmpty()) {
notification.displayWarning(i18n.get("distributionsets.not.exists"));
notification.displayWarning(i18n.getMessage("distributionsets.not.exists"));
return;
}
@@ -667,9 +667,9 @@ public class TargetTable extends AbstractTable<Target, Long> {
*/
private String getPendingActionMessage(final String message, final String distName, final String controllerId) {
if (message == null) {
return i18n.get("message.dist.pending.action", new Object[] { controllerId, distName });
return i18n.getMessage("message.dist.pending.action", new Object[] { controllerId, distName });
}
return i18n.get("message.target.assigned.pending");
return i18n.getMessage("message.target.assigned.pending");
}
/**

View File

@@ -35,7 +35,7 @@ import org.eclipse.hawkbit.ui.management.event.TargetTableEvent;
import org.eclipse.hawkbit.ui.management.event.TargetTableEvent.TargetComponentEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.I18N;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.utils.SPUITargetDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
@@ -77,7 +77,7 @@ public class TargetTableHeader extends AbstractTableHeader {
private final transient DistributionSetManagement distributionSetManagement;
TargetTableHeader(final I18N i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
TargetTableHeader(final VaadinMessageSource i18n, final SpPermissionChecker permChecker, final UIEventBus eventbus,
final UINotification notification, final ManagementUIState managementUIState,
final ManagementViewClientCriterion managementViewClientCriterion, final TargetManagement targetManagement,
final DeploymentManagement deploymentManagement, final UiProperties uiproperties, final UIEventBus eventBus,
@@ -166,7 +166,7 @@ public class TargetTableHeader extends AbstractTableHeader {
@Override
protected String getHeaderCaption() {
return i18n.get("header.target.table");
return i18n.getMessage("header.target.table");
}
@Override
@@ -280,7 +280,7 @@ public class TargetTableHeader extends AbstractTableHeader {
protected void addNewItem(final ClickEvent event) {
targetAddUpdateWindow.resetComponents();
final Window addTargetWindow = targetAddUpdateWindow.createNewWindow();
addTargetWindow.setCaption(i18n.get(UIComponentIdProvider.TARGET_ADD_CAPTION));
addTargetWindow.setCaption(i18n.getMessage(UIComponentIdProvider.TARGET_ADD_CAPTION));
UI.getCurrent().addWindow(addTargetWindow);
addTargetWindow.setVisible(Boolean.TRUE);
}
@@ -343,7 +343,7 @@ public class TargetTableHeader extends AbstractTableHeader {
final Optional<DistributionSet> distributionSet = distributionSetManagement
.findDistributionSetById(distributionSetId);
if (!distributionSet.isPresent()) {
notification.displayWarning(i18n.get("distributionset.not.exists"));
notification.displayWarning(i18n.getMessage("distributionset.not.exists"));
return;
}
final DistributionSetIdName distributionSetIdName = new DistributionSetIdName(distributionSet.get());
@@ -366,16 +366,16 @@ public class TargetTableHeader extends AbstractTableHeader {
final Table source = transferable.getSourceComponent();
if (!source.getId().equals(UIComponentIdProvider.DIST_TABLE_ID)) {
notification.displayValidationError(i18n.get("message.action.not.allowed"));
notification.displayValidationError(i18n.getMessage("message.action.not.allowed"));
isValid = Boolean.FALSE;
} else {
if (getDropppedDistributionDetails(transferable).size() > 1) {
notification.displayValidationError(i18n.get("message.onlyone.distribution.dropallowed"));
notification.displayValidationError(i18n.getMessage("message.onlyone.distribution.dropallowed"));
isValid = Boolean.FALSE;
}
}
} else {
notification.displayValidationError(i18n.get("message.action.not.allowed"));
notification.displayValidationError(i18n.getMessage("message.action.not.allowed"));
isValid = Boolean.FALSE;
}
return isValid;

Some files were not shown because too many files have changed in this diff Show More