Feature insert tooltips for icons (#702)

* Insert tooltips
* Insert constants for message keys
* Display caption for ActionHistoryTable when no target is selected
* Improve JavaDocs
* Fix PR review findings

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Melanie Retter
2018-07-13 08:37:43 +02:00
committed by Stefan Behl
parent 3077f4e86d
commit b4fc7c8929
44 changed files with 369 additions and 160 deletions

View File

@@ -34,6 +34,7 @@ import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils;
@@ -181,9 +182,11 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private SPUIButton createMaxMinButton() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(SPUIDefinitions.EXPAND_ACTION_HISTORY,
"", "", null, true, FontAwesome.EXPAND, SPUIButtonStyleNoBorder.class);
"", i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE), null, true, FontAwesome.EXPAND,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> maxArtifactDetails());
return button;
}
private void buildLayout() {
@@ -273,13 +276,15 @@ public class ArtifactDetailsLayout extends VerticalLayout {
return deleteIcon;
}
});
}
private void confirmAndDeleteArtifact(final Long id, final String fileName) {
final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.delete.artifact.confirmbox"),
i18n.getMessage("message.delete.artifact", new Object[] { fileName }),
i18n.getMessage(SPUIDefinitions.BUTTON_OK), i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
ok -> {
if (ok) {
artifactManagement.delete(id);
uINotification.displaySuccess(i18n.getMessage("message.artifact.deleted", fileName));
@@ -292,6 +297,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
}
private void setTableColumnDetails(final Table table) {
table.setColumnHeader(PROVIDED_FILE_NAME, i18n.getMessage("upload.file.name"));
table.setColumnHeader(SIZE, i18n.getMessage("upload.size"));
if (fullWindowMode) {
@@ -351,6 +357,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private void maxArtifactDetails() {
final Boolean flag = (Boolean) maxMinButton.getData();
if (flag == null || Boolean.FALSE.equals(flag)) {
// Clicked on max Button
maximizedArtifactDetailsView();
} else {
minimizedArtifactDetailsView();
@@ -387,6 +394,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
}
private void createArtifactDetailsMaxView() {
artifactDetailsTable.setValue(null);
artifactDetailsTable.setSelectable(false);
artifactDetailsTable.setMultiSelect(false);
@@ -497,11 +505,13 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private void showMinIcon() {
maxMinButton.toggleIcon(FontAwesome.COMPRESS);
maxMinButton.setData(Boolean.TRUE);
maxMinButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MINIMIZE));
}
private void showMaxIcon() {
maxMinButton.toggleIcon(FontAwesome.EXPAND);
maxMinButton.setData(Boolean.FALSE);
maxMinButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE));
}
private boolean isMaximized() {

View File

@@ -26,6 +26,7 @@ import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus;
@@ -281,8 +282,8 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.entity.delete.action.confirmbox"),
i18n.getMessage("message.confirm.delete.metadata", key), i18n.getMessage(SPUIDefinitions.BUTTON_OK),
i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
i18n.getMessage("message.confirm.delete.metadata", key), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok) {
handleOkDeleteMetadata(event, key);
}

View File

@@ -23,6 +23,7 @@ import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -235,16 +236,17 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
caption.setContentMode(ContentMode.HTML);
caption.setId(getDetailsHeaderCaptionId());
editButton = SPUIComponentProvider.getButton("", "", "", null, false, FontAwesome.PENCIL_SQUARE_O,
SPUIButtonStyleNoBorder.class);
editButton = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE), null,
false, FontAwesome.PENCIL_SQUARE_O, SPUIButtonStyleNoBorder.class);
editButton.setId(getEditButtonId());
editButton.addClickListener(this::onEdit);
editButton.setEnabled(false);
manageMetadataBtn = SPUIComponentProvider.getButton("", "", "", null, false, FontAwesome.LIST_ALT,
manageMetadataBtn = SPUIComponentProvider.getButton("", "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON), null, false, FontAwesome.LIST_ALT,
SPUIButtonStyleNoBorder.class);
manageMetadataBtn.setId(getMetadataButtonId());
manageMetadataBtn.setDescription(i18n.getMessage("tooltip.metadata.icon"));
manageMetadataBtn.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON));
manageMetadataBtn.addClickListener(this::showMetadata);
manageMetadataBtn.setEnabled(false);

View File

@@ -24,6 +24,7 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
@@ -178,7 +179,7 @@ public abstract class AbstractFilterButtons extends Table {
} else {
deleteButton.setId(UIComponentIdProvider.DELETE_TAG_ID + itemId.toString());
}
deleteButton.setDescription(SPUIDefinitions.DELETE);
deleteButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE));
deleteButton.addClickListener(this::addDeleteButtonClickListener);
return deleteButton;
}
@@ -317,7 +318,8 @@ public abstract class AbstractFilterButtons extends Table {
i18n.getMessage("caption.entity.delete.action.confirmbox"),
i18n.getMessage("message.confirm.delete.entity", entityName.toLowerCase(),
entityToDelete.substring(entityToDelete.indexOf('.') + 1), ""),
i18n.getMessage(SPUIDefinitions.BUTTON_OK), i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
ok -> {
if (ok) {
deleteEntity(entityToDelete);
} else {

View File

@@ -17,6 +17,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorder;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -97,9 +98,10 @@ public abstract class AbstractFilterHeader extends VerticalLayout {
if (isAddTagRequired()) {
menu = new ConfigMenuBar(permChecker.hasCreateRepositoryPermission(),
permChecker.hasUpdateRepositoryPermission(), permChecker.hasDeleteRepositoryPermission(),
getAddButtonCommand(), getUpdateButtonCommand(), getDeleteButtonCommand(), getMenuBarId());
getAddButtonCommand(), getUpdateButtonCommand(), getDeleteButtonCommand(), getMenuBarId(), i18n);
}
hideIcon = SPUIComponentProvider.getButton(getHideButtonId(), "", "", "", true, FontAwesome.TIMES,
hideIcon = SPUIComponentProvider.getButton(getHideButtonId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_CLOSE), "", true, FontAwesome.TIMES,
SPUIButtonStyleNoBorder.class);
hideIcon.addClickListener(event -> hideFilterButtonLayout());
}

View File

@@ -20,6 +20,7 @@ import org.eclipse.hawkbit.ui.management.actionhistory.ProxyAction;
import org.eclipse.hawkbit.ui.management.actionhistory.ProxyActionStatus;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
import org.vaadin.spring.events.EventBus;
@@ -640,6 +641,7 @@ public abstract class AbstractGrid<T extends Indexed> extends Grid implements Re
* detailed format.
*/
protected static class TooltipGenerator implements CellDescriptionGenerator {
private static final long serialVersionUID = 1L;
private final VaadinMessageSource i18n;
@@ -668,7 +670,7 @@ public abstract class AbstractGrid<T extends Indexed> extends Grid implements Re
private String getFormattedNextMaintenanceWindow(final ZonedDateTime nextAt) {
final long nextAtMilli = nextAt.toInstant().toEpochMilli();
return i18n.getMessage("tooltip.next.maintenancewindow",
return i18n.getMessage(UIMessageIdProvider.TOOLTIP_NEXT_MAINTENANCE_WINDOW,
SPDateTimeUtil.getFormattedDate(nextAtMilli, SPUIDefinitions.LAST_QUERY_DATE_FORMAT_SHORT));
}
}

View File

@@ -25,12 +25,15 @@ import com.vaadin.ui.VerticalLayout;
* and grid header {@link DefaultGridHeader}.
*/
public abstract class AbstractGridComponentLayout extends VerticalLayout {
private static final long serialVersionUID = -3766179797384539821L;
protected final transient EventBus.UIEventBus eventBus;
protected final VaadinMessageSource i18n;
private static final long serialVersionUID = 1L;
private final transient EventBus.UIEventBus eventBus;
private final VaadinMessageSource i18n;
private AbstractOrderedLayout gridHeader;
private Grid grid;
private transient AbstractFooterSupport footerSupport;
@@ -203,4 +206,13 @@ public abstract class AbstractGridComponentLayout extends VerticalLayout {
*/
protected abstract Label getFooterMessageLabel();
}
protected VaadinMessageSource getI18n() {
return i18n;
}
protected EventBus.UIEventBus getEventBus() {
return eventBus;
}
}

View File

@@ -16,6 +16,7 @@ import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorder;
import org.eclipse.hawkbit.ui.rollout.state.RolloutUIState;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils;
@@ -115,23 +116,26 @@ public abstract class AbstractGridHeader extends VerticalLayout {
}
private SPUIButton createSearchResetIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getSearchRestIconId(), "", "", null,
false, FontAwesome.SEARCH, SPUIButtonStyleNoBorder.class);
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getSearchRestIconId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> onSearchResetClick());
button.setData(Boolean.FALSE);
return button;
}
private Button createAddButton() {
final Button button = SPUIComponentProvider.getButton(getAddIconId(), "", "", null, false, FontAwesome.PLUS,
final Button button = SPUIComponentProvider.getButton(getAddIconId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_ADD), null, false, FontAwesome.PLUS,
SPUIButtonStyleNoBorder.class);
button.addClickListener(this::addNewItem);
return button;
}
private Button createCloseButton() {
final Button button = SPUIComponentProvider.getButton(getCloseButtonId(), "", "", null, false,
FontAwesome.TIMES, SPUIButtonStyleNoBorder.class);
final Button button = SPUIComponentProvider.getButton(getCloseButtonId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_CLOSE), null, false, FontAwesome.TIMES,
SPUIButtonStyleNoBorder.class);
button.addClickListener(this::onClose);
return button;
}
@@ -155,6 +159,7 @@ public abstract class AbstractGridHeader extends VerticalLayout {
searchResetIcon.addStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.TIMES);
searchResetIcon.setData(Boolean.TRUE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_RESET));
searchField.removeStyleName(SPUIDefinitions.FILTER_BOX_HIDE);
searchField.setVisible(true);
searchField.focus();
@@ -167,6 +172,7 @@ public abstract class AbstractGridHeader extends VerticalLayout {
searchResetIcon.removeStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.SEARCH);
searchResetIcon.setData(Boolean.FALSE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH));
resetSearchText();
}

View File

@@ -14,6 +14,8 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorder;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import com.vaadin.server.FontAwesome;
import com.vaadin.shared.ui.label.ContentMode;
@@ -35,13 +37,15 @@ public class DefaultGridHeader extends VerticalLayout {
private HorizontalLayout titleLayout;
private transient AbstractHeaderMaximizeSupport maximizeSupport;
private final VaadinMessageSource i18n;
/**
* Constructor.
*
* @param managementUIState
*/
public DefaultGridHeader(final ManagementUIState managementUIState) {
this(managementUIState, "");
public DefaultGridHeader(final ManagementUIState managementUIState, final VaadinMessageSource i18n) {
this(managementUIState, "", i18n);
}
/**
@@ -50,9 +54,11 @@ public class DefaultGridHeader extends VerticalLayout {
* @param managementUIState
* @param titleText
*/
public DefaultGridHeader(final ManagementUIState managementUIState, final String titleText) {
public DefaultGridHeader(final ManagementUIState managementUIState, final String titleText,
final VaadinMessageSource i18n) {
this.managementUIState = managementUIState;
this.titleText = titleText;
this.i18n = i18n;
}
/**
@@ -217,8 +223,9 @@ public class DefaultGridHeader extends VerticalLayout {
* @return newly cretaed min-max-button
*/
protected SPUIButton createMinMaxButton(final String buttonId) {
return (SPUIButton) SPUIComponentProvider.getButton(buttonId, "", "Maximize", null, true,
FontAwesome.EXPAND, SPUIButtonStyleNoBorder.class);
return (SPUIButton) SPUIComponentProvider.getButton(buttonId, "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE), null, true, FontAwesome.EXPAND,
SPUIButtonStyleNoBorder.class);
}
/**
@@ -226,7 +233,7 @@ public class DefaultGridHeader extends VerticalLayout {
*/
public void showMinIcon() {
maxMinButton.toggleIcon(FontAwesome.COMPRESS);
maxMinButton.setDescription("Minimize");
maxMinButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MINIMIZE));
maxMinButton.setData(Boolean.TRUE);
}
@@ -235,7 +242,7 @@ public class DefaultGridHeader extends VerticalLayout {
*/
public void showMaxIcon() {
maxMinButton.toggleIcon(FontAwesome.EXPAND);
maxMinButton.setDescription("Maximize");
maxMinButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE));
maxMinButton.setData(Boolean.FALSE);
}
}

View File

@@ -30,6 +30,7 @@ import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
@@ -364,7 +365,7 @@ public abstract class AbstractTable<E extends NamedEntity> extends Table impleme
SPUIButtonStyleNoBorderWithIcon.class);
final String id = getEntityId(itemId);
deleteButton.setId("delete.entity." + id);
deleteButton.setDescription(SPUIDefinitions.DELETE);
deleteButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE));
deleteButton.addClickListener(this::addDeleteButtonClickListener);
return deleteButton;
}
@@ -401,8 +402,8 @@ public abstract class AbstractTable<E extends NamedEntity> extends Table impleme
private ConfirmationDialog createConfirmationWindowForDeletion(final List<Long> entitiesToBeDeleted,
final String confirmationQuestion) {
return new ConfirmationDialog(i18n.getMessage("caption.entity.delete.action.confirmbox", getEntityType()),
confirmationQuestion, i18n.getMessage(SPUIDefinitions.BUTTON_OK),
i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
confirmationQuestion, i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok) {
handleOkDelete(entitiesToBeDeleted);
}

View File

@@ -19,6 +19,7 @@ import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils;
import org.vaadin.spring.events.EventBus;
@@ -220,38 +221,43 @@ public abstract class AbstractTableHeader extends VerticalLayout {
}
private SPUIButton createSearchResetIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getSearchRestIconId(), "", "", null,
false, FontAwesome.SEARCH, SPUIButtonStyleNoBorder.class);
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getSearchRestIconId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> onSearchResetClick());
button.setData(Boolean.FALSE);
return button;
}
private Button createAddIcon() {
final Button button = SPUIComponentProvider.getButton(getAddIconId(), "", "", null, false, FontAwesome.PLUS,
final Button button = SPUIComponentProvider.getButton(getAddIconId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_ADD), null, false, FontAwesome.PLUS,
SPUIButtonStyleNoBorder.class);
button.addClickListener(this::addNewItem);
return button;
}
private Button createBulkUploadIcon() {
final Button button = SPUIComponentProvider.getButton(getBulkUploadIconId(), "", "", null, false,
FontAwesome.UPLOAD, SPUIButtonStyleNoBorder.class);
final Button button = SPUIComponentProvider.getButton(getBulkUploadIconId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_BULK_UPLOAD), null, false, FontAwesome.UPLOAD,
SPUIButtonStyleNoBorder.class);
button.addClickListener(this::bulkUpload);
return button;
}
private Button createShowFilterButtonLayout() {
final Button button = SPUIComponentProvider.getButton(getShowFilterButtonLayoutId(), null, null, null, false,
FontAwesome.TAGS, SPUIButtonStyleNoBorder.class);
final Button button = SPUIComponentProvider.getButton(getShowFilterButtonLayoutId(), null,
i18n.getMessage(UIMessageIdProvider.TOOLTIP_SHOW_TAGS), null, false, FontAwesome.TAGS,
SPUIButtonStyleNoBorder.class);
button.setVisible(false);
button.addClickListener(event -> showFilterButtonsIconClicked());
return button;
}
private SPUIButton createMaxMinIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getMaxMinIconId(), "", "", null, false,
FontAwesome.EXPAND, SPUIButtonStyleNoBorder.class);
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getMaxMinIconId(), "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE), null, false, FontAwesome.EXPAND,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> maxMinButtonClicked());
return button;
}
@@ -275,6 +281,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
searchResetIcon.addStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.TIMES);
searchResetIcon.setData(Boolean.TRUE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_RESET));
searchField.removeStyleName(SPUIDefinitions.FILTER_BOX_HIDE);
searchField.focus();
}
@@ -282,6 +289,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
private void closeSearchTextField() {
searchField.setValue("");
searchField.addStyleName(SPUIDefinitions.FILTER_BOX_HIDE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH));
searchResetIcon.removeStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.SEARCH);
searchResetIcon.setData(Boolean.FALSE);
@@ -314,11 +322,13 @@ public abstract class AbstractTableHeader extends VerticalLayout {
private void showMinIcon() {
maxMinIcon.toggleIcon(FontAwesome.COMPRESS);
maxMinIcon.setData(Boolean.TRUE);
maxMinIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MINIMIZE));
}
private void showMaxIcon() {
maxMinIcon.toggleIcon(FontAwesome.EXPAND);
maxMinIcon.setData(Boolean.FALSE);
maxMinIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE));
}
private static HorizontalLayout createHeaderFilterIconLayout() {

View File

@@ -10,6 +10,8 @@ package org.eclipse.hawkbit.ui.components;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import com.vaadin.server.FontAwesome;
import com.vaadin.ui.MenuBar;
@@ -40,8 +42,10 @@ public class ConfigMenuBar extends MenuBar {
private final String id;
private final VaadinMessageSource i18n;
/**
* Constructor for the menubar
* Constructor for the Menubar
*
* @param createPermission
* flag if the logged-in user has permission to create the entity
@@ -63,10 +67,12 @@ public class ConfigMenuBar extends MenuBar {
* command
* @param id
* the id of the menuBar
* @param i18n
* VaadinMessageSource
*/
public ConfigMenuBar(final boolean createPermission, final boolean updatePermission, final boolean deletePermission,
final Command addButtonCommand, final Command updateButtonCommand, final Command deleteButtonCommand,
final String id) {
final String id, final VaadinMessageSource i18n) {
this.createPermission = createPermission;
this.updatePermission = updatePermission;
this.deletePermission = deletePermission;
@@ -74,6 +80,7 @@ public class ConfigMenuBar extends MenuBar {
this.updateButtonCommand = updateButtonCommand;
this.deleteButtonCommand = deleteButtonCommand;
this.id = id;
this.i18n = i18n;
init();
}
@@ -87,6 +94,7 @@ public class ConfigMenuBar extends MenuBar {
addStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_POSITION);
config = addItem("", FontAwesome.COG, null);
config.setStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_ITEMS);
config.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_CONFIGURE));
addMenuItems();
}

View File

@@ -16,6 +16,7 @@ import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorder;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.data.domain.PageRequest;
import org.springframework.util.StringUtils;
@@ -151,7 +152,7 @@ public class DistributionSetTypeSoftwareModuleSelectLayout extends VerticalLayou
if (DIST_TYPE_NAME.equals(propertyId) && !StringUtils.isEmpty(description)) {
return i18n.getMessage("label.description") + description;
} else if (DIST_TYPE_MANDATORY.equals(propertyId)) {
return i18n.getMessage("tooltip.check.for.mandatory");
return i18n.getMessage(UIMessageIdProvider.TOOLTIP_CHECK_FOR_MANDATORY);
}
return null;
}

View File

@@ -47,6 +47,7 @@ import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.view.filter.OnlyEventsFromDistributionsViewFilter;
@@ -316,8 +317,8 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
private ConfirmationDialog createConfirmationWindowForAssignment(final String confirmQuestion) {
return new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX), confirmQuestion,
getI18n().getMessage(SPUIDefinitions.BUTTON_OK), getI18n().getMessage(SPUIDefinitions.BUTTON_CANCEL),
ok -> {
getI18n().getMessage(UIMessageIdProvider.BUTTON_OK),
getI18n().getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok) {
saveAllAssignments();
} else {

View File

@@ -20,6 +20,7 @@ import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -88,7 +89,7 @@ public class SwModuleDetails extends AbstractSoftwareModuleDetails {
private Button createShowArtifactDetailsButton() {
artifactDetailsButton = SPUIComponentProvider.getButton("", "", "", null, false, FontAwesome.FILE_O,
SPUIButtonStyleNoBorder.class);
artifactDetailsButton.setDescription(getI18n().getMessage("tooltip.artifact.icon"));
artifactDetailsButton.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_ARTIFACT_ICON));
artifactDetailsButton.addClickListener(event -> showArtifactDetailsWindow(getSelectedBaseEntity()));
return artifactDetailsButton;
}

View File

@@ -26,6 +26,7 @@ import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils;
@@ -313,8 +314,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private SPUIButton createSearchResetIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(
UIComponentIdProvider.CUSTOM_FILTER_CLOSE, "", "", null, false, FontAwesome.TIMES,
SPUIButtonStyleNoBorder.class);
UIComponentIdProvider.CUSTOM_FILTER_CLOSE, "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_CLOSE), null,
false, FontAwesome.TIMES, SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> closeFilterLayout());
return button;
}
@@ -329,16 +330,17 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private Button createSaveButton() {
saveButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON,
UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON, "Save", null, false, FontAwesome.SAVE,
SPUIButtonStyleNoBorder.class);
UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON, i18n.getMessage(UIMessageIdProvider.TOOLTIP_SAVE), null,
false, FontAwesome.SAVE, SPUIButtonStyleNoBorder.class);
saveButton.addClickListener(this);
saveButton.setEnabled(false);
return saveButton;
}
private Button createSearchIcon() {
searchIcon = SPUIComponentProvider.getButton(UIComponentIdProvider.FILTER_SEARCH_ICON_ID, "", "", null, false,
FontAwesome.SEARCH, SPUIButtonStyleNoBorder.class);
searchIcon = SPUIComponentProvider.getButton(UIComponentIdProvider.FILTER_SEARCH_ICON_ID, "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
SPUIButtonStyleNoBorder.class);
searchIcon.addClickListener(event -> onSearchIconClick());
searchIcon.setEnabled(false);
searchIcon.setData(false);

View File

@@ -24,6 +24,7 @@ import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils;
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
@@ -201,24 +202,24 @@ public class CreateOrUpdateFilterTable extends Table {
final Label label = new LabelBuilder().name("").buildLabel();
label.setContentMode(ContentMode.HTML);
if (targetStatus == TargetUpdateStatus.PENDING) {
label.setDescription("Pending");
label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING));
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW);
label.setValue(FontAwesome.ADJUST.getHtml());
} else if (targetStatus == TargetUpdateStatus.REGISTERED) {
label.setDescription("Registered");
label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED));
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE);
label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml());
} else if (targetStatus == TargetUpdateStatus.ERROR) {
label.setDescription(i18n.getMessage("label.error"));
label.setDescription(i18n.getMessage(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_ERROR)));
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_RED);
label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
} else if (targetStatus == TargetUpdateStatus.IN_SYNC) {
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN);
label.setDescription("In-Synch");
label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC));
label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
} else if (targetStatus == TargetUpdateStatus.UNKNOWN) {
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE);
label.setDescription(i18n.getMessage("label.unknown"));
label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TARGET_STATUS_UNKNOWN));
label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml());
}
return label;

View File

@@ -23,6 +23,7 @@ import org.eclipse.hawkbit.ui.distributions.state.ManageDistUIState;
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -273,7 +274,7 @@ public class DistributionSetSelectWindow
layout.addComponent(buttonsLayout);
okButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SAVE_BUTTON,
i18n.getMessage(SPUIDefinitions.BUTTON_OK), "", "", true, FontAwesome.SAVE,
i18n.getMessage(UIMessageIdProvider.BUTTON_OK), "", "", true, FontAwesome.SAVE,
SPUIButtonStyleNoBorderWithIcon.class);
okButton.setSizeUndefined();
okButton.addStyleName("default-color");
@@ -283,7 +284,7 @@ public class DistributionSetSelectWindow
buttonsLayout.setExpandRatio(okButton, 1.0F);
final Button cancelButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CANCEL_BUTTON,
i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), "", "", true, FontAwesome.TIMES,
i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), "", "", true, FontAwesome.TIMES,
SPUIButtonStyleNoBorderWithIcon.class);
cancelButton.setSizeUndefined();
cancelButton.addStyleName("default-color");

View File

@@ -70,7 +70,7 @@ public class FilterManagementView extends VerticalLayout implements View {
final UINotification notification, final UiProperties uiProperties, final EntityFactory entityFactory,
final AutoCompleteTextFieldComponent queryTextField, final ManageDistUIState manageDistUIState,
final TargetManagement targetManagement) {
this.targetFilterHeader = new TargetFilterHeader(eventBus, filterManagementUIState, permissionChecker);
this.targetFilterHeader = new TargetFilterHeader(eventBus, filterManagementUIState, permissionChecker, i18n);
this.targetFilterTable = new TargetFilterTable(i18n, notification, eventBus, filterManagementUIState,
targetFilterQueryManagement, manageDistUIState, targetManagement, permissionChecker);
this.createNewFilterHeader = new CreateOrUpdateFilterHeader(i18n, eventBus, filterManagementUIState,

View File

@@ -19,6 +19,8 @@ import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -51,6 +53,8 @@ public class TargetFilterHeader extends VerticalLayout {
private SPUIButton searchResetIcon;
private final VaadinMessageSource i18n;
/**
* Constructor for TargetFilterHeader
*
@@ -60,12 +64,15 @@ public class TargetFilterHeader extends VerticalLayout {
* FilterManagementUIState
* @param permissionChecker
* SpPermissionChecker
* @param i18n
* VaadinMessageSource
*/
public TargetFilterHeader(final UIEventBus eventBus, final FilterManagementUIState filterManagementUIState,
final SpPermissionChecker permissionChecker) {
final SpPermissionChecker permissionChecker, final VaadinMessageSource i18n) {
this.eventBus = eventBus;
this.filterManagementUIState = filterManagementUIState;
this.permissionChecker = permissionChecker;
this.i18n = i18n;
createComponents();
buildLayout();
@@ -108,10 +115,12 @@ public class TargetFilterHeader extends VerticalLayout {
}
private Button createAddButton() {
final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.TARGET_FILTER_ADD_ICON_ID, "", "",
null, false, FontAwesome.PLUS, SPUIButtonStyleNoBorder.class);
final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.TARGET_FILTER_ADD_ICON_ID, "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_ADD), null, false, FontAwesome.PLUS,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> addNewFilter());
return button;
}
private void addNewFilter() {
@@ -136,10 +145,12 @@ public class TargetFilterHeader extends VerticalLayout {
private SPUIButton createSearchResetIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(
UIComponentIdProvider.TARGET_FILTER_TBL_SEARCH_RESET_ID, "", "", null, false, FontAwesome.SEARCH,
UIComponentIdProvider.TARGET_FILTER_TBL_SEARCH_RESET_ID, "",
i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> onSearchResetClick());
return button;
}
private void onSearchResetClick() {
@@ -157,6 +168,7 @@ public class TargetFilterHeader extends VerticalLayout {
searchResetIcon.addStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.TIMES);
searchResetIcon.setData(Boolean.TRUE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_RESET));
searchField.removeStyleName(SPUIDefinitions.FILTER_BOX_HIDE);
searchField.setVisible(true);
searchField.focus();
@@ -168,6 +180,7 @@ public class TargetFilterHeader extends VerticalLayout {
searchResetIcon.removeStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.SEARCH);
searchResetIcon.setData(Boolean.FALSE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH));
resetSearchText();
}

View File

@@ -28,6 +28,7 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
@@ -187,8 +188,8 @@ public class TargetFilterTable extends Table {
/* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.entity.delete.action.confirmbox"),
i18n.getMessage("message.delete.filter.confirm"), i18n.getMessage(SPUIDefinitions.BUTTON_OK),
i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
i18n.getMessage("message.delete.filter.confirm"), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok) {
final Long rowId = (Long) ((Button) event.getComponent()).getData();
final String deletedFilterName = targetFilterQueryManagement.get(rowId).get().getName();

View File

@@ -32,6 +32,7 @@ import org.eclipse.hawkbit.ui.rollout.StatusFontIcon;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.slf4j.Logger;
@@ -304,7 +305,8 @@ public class ActionHistoryGrid extends AbstractGrid<LazyQueryContainer> {
/* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.force.action.confirmbox"), i18n.getMessage("message.force.action.confirm"),
i18n.getMessage(SPUIDefinitions.BUTTON_OK), i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
ok -> {
if (!ok) {
return;
}
@@ -327,8 +329,8 @@ public class ActionHistoryGrid extends AbstractGrid<LazyQueryContainer> {
/* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.forcequit.action.confirmbox"),
i18n.getMessage("message.forcequit.action.confirm"), i18n.getMessage(SPUIDefinitions.BUTTON_OK),
i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
i18n.getMessage("message.forcequit.action.confirm"), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (!ok) {
return;
}
@@ -358,7 +360,8 @@ public class ActionHistoryGrid extends AbstractGrid<LazyQueryContainer> {
final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.cancel.action.confirmbox"), i18n.getMessage("message.cancel.action.confirm"),
i18n.getMessage(SPUIDefinitions.BUTTON_OK), i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
ok -> {
if (!ok) {
return;
}

View File

@@ -24,6 +24,7 @@ import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils;
import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope;
import org.vaadin.spring.events.annotation.EventBusListenerMethod;
@@ -43,6 +44,8 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
private transient AbstractGrid<?>.DetailsSupport details;
private Long masterForDetails;
private final String actionHistoryCaption;
/**
* Constructor.
*
@@ -58,9 +61,25 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
this.deploymentManagement = deploymentManagement;
this.notification = notification;
this.managementUIState = managementUIState;
actionHistoryCaption = getActionHistoryCaption();
init();
}
private final String getActionHistoryCaption() {
return getActionHistoryCaption(null);
}
private String getActionHistoryCaption(final String targetName) {
final String caption;
if (StringUtils.hasText(targetName)) {
caption = getI18n().getMessage("caption.action.history.for", HawkbitCommonUtil.getBoldHTMLText(targetName));
} else {
caption = getI18n().getMessage("caption.action.history");
}
return HawkbitCommonUtil.DIV_DESCRIPTION_START + caption + HawkbitCommonUtil.DIV_DESCRIPTION_END;
}
@Override
public ActionHistoryHeader createGridHeader() {
return new ActionHistoryHeader(managementUIState).init();
@@ -68,7 +87,7 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
@Override
public ActionHistoryGrid createGrid() {
return new ActionHistoryGrid(i18n, deploymentManagement, eventBus, notification, managementUIState);
return new ActionHistoryGrid(getI18n(), deploymentManagement, getEventBus(), notification, managementUIState);
}
@EventBusListenerMethod(scope = EventScope.UI)
@@ -138,7 +157,7 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
* @param managementUIState
*/
ActionHistoryHeader(final ManagementUIState managementUIState) {
super(managementUIState);
super(managementUIState, actionHistoryCaption, getI18n());
this.setHeaderMaximizeSupport(
new ActionHistoryHeaderMaxSupport(this, SPUIDefinitions.EXPAND_ACTION_HISTORY));
}
@@ -160,7 +179,7 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
* name of the target
*/
public void updateActionHistoryHeader(final String targetName) {
updateTitle(HawkbitCommonUtil.getActionHistoryLabelId(targetName));
updateTitle(getActionHistoryCaption(targetName));
}
/**
@@ -195,12 +214,12 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
@Override
protected void maximize() {
details.populateMasterDataAndRecreateContainer(masterForDetails);
eventBus.publish(this, ManagementUIEvent.MAX_ACTION_HISTORY);
getEventBus().publish(this, ManagementUIEvent.MAX_ACTION_HISTORY);
}
@Override
protected void minimize() {
eventBus.publish(this, ManagementUIEvent.MIN_ACTION_HISTORY);
getEventBus().publish(this, ManagementUIEvent.MIN_ACTION_HISTORY);
}
/**
@@ -212,4 +231,5 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
return abstractGridHeader;
}
}
}

View File

@@ -43,12 +43,12 @@ public class ActionStatusLayout extends AbstractGridComponentLayout {
@Override
public DefaultGridHeader createGridHeader() {
return new DefaultGridHeader(managementUIState, "Action States").init();
return new DefaultGridHeader(managementUIState, "Action States", getI18n()).init();
}
@Override
public ActionStatusGrid createGrid() {
return new ActionStatusGrid(i18n, eventBus);
return new ActionStatusGrid(getI18n(), getEventBus());
}
}

View File

@@ -43,11 +43,11 @@ public class ActionStatusMsgLayout extends AbstractGridComponentLayout {
@Override
public DefaultGridHeader createGridHeader() {
return new DefaultGridHeader(managementUIState, "Messages").init();
return new DefaultGridHeader(managementUIState, "Messages", getI18n()).init();
}
@Override
public ActionStatusMsgGrid createGrid() {
return new ActionStatusMsgGrid(i18n, eventBus);
return new ActionStatusMsgGrid(getI18n(), getEventBus());
}
}

View File

@@ -62,6 +62,7 @@ import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.view.filter.OnlyEventsFromDeploymentViewFilter;
@@ -467,8 +468,8 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
private void createConfirmationWindowForAssignment(final String confirmQuestion) {
confirmDialog = new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX),
confirmQuestion, getI18n().getMessage(SPUIDefinitions.BUTTON_OK),
getI18n().getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
confirmQuestion, getI18n().getMessage(UIMessageIdProvider.BUTTON_OK),
getI18n().getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok && isMaintenanceWindowValid()) {
saveAllAssignments();
} else {
@@ -832,6 +833,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
pinBtn.setData(distributionSetIdName);
pinBtn.setId(getPinButtonId(name, version));
pinBtn.setImmediate(true);
pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_DISTRIBUTION_SET_PIN));
return pinBtn;
}

View File

@@ -16,6 +16,7 @@ import org.eclipse.hawkbit.repository.model.Action.ActionType;
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroup;
import org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroupItemComponent;
@@ -92,7 +93,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
forceLabel.setStyleName("statusIconPending");
forceLabel.setIcon(FontAwesome.BOLT);
forceLabel.setCaption("Forced");
forceLabel.setDescription(i18n.getMessage("tooltip.forced.item"));
forceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_FORCED_ITEM));
forceLabel.setStyleName("padding-right-style");
addComponent(forceLabel);
@@ -103,7 +104,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
final Label softLabel = new Label();
softLabel.setSizeFull();
softLabel.setCaption("Soft");
softLabel.setDescription(i18n.getMessage("tooltip.soft.item"));
softLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SOFT_ITEM));
softLabel.setStyleName("padding-right-style");
addComponent(softLabel);
@@ -116,7 +117,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
autoForceLabel.setStyleName("statusIconPending");
autoForceLabel.setIcon(FontAwesome.HISTORY);
autoForceLabel.setCaption("Time Forced");
autoForceLabel.setDescription(i18n.getMessage("tooltip.timeforced.item"));
autoForceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TIMEFORCED_ITEM));
autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
addComponent(autoForceLabel);

View File

@@ -75,6 +75,7 @@ import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.slf4j.Logger;
@@ -402,10 +403,12 @@ public class TargetTable extends AbstractTable<Target> {
.getItemProperty(SPUILabelDefinitions.VAR_POLL_STATUS_TOOL_TIP).getValue();
if (StringUtils.hasText(pollStatusToolTip)) {
statusLabel.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
statusLabel.setDescription(pollStatusToolTip);
} else {
statusLabel.setValue(FontAwesome.CLOCK_O.getHtml());
statusLabel.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_IN_TIME));
}
statusLabel.setDescription(pollStatusToolTip);
return statusLabel;
}
@@ -424,6 +427,7 @@ public class TargetTable extends AbstractTable<Target> {
pinBtn.setData(pinnedTarget);
pinBtn.setId(UIComponentIdProvider.TARGET_PIN_ICON + controllerId);
pinBtn.addClickListener(this::addPinClickListener);
pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_TARGET_PIN));
if (isPinned(pinnedTarget)) {
pinBtn.addStyleName(TARGET_PINNED);
targetPinned = Boolean.TRUE;
@@ -980,8 +984,8 @@ public class TargetTable extends AbstractTable<Target> {
private void openConfirmationWindowForAssignment(final String distributionNameToAssign, final String targetName) {
confirmDialog = new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX),
getI18n().getMessage(MESSAGE_CONFIRM_ASSIGN_ENTITY, distributionNameToAssign, "target", targetName),
getI18n().getMessage(SPUIDefinitions.BUTTON_OK), getI18n().getMessage(SPUIDefinitions.BUTTON_CANCEL),
ok -> {
getI18n().getMessage(UIMessageIdProvider.BUTTON_OK),
getI18n().getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok && isMaintenanceWindowValid()) {
saveAllAssignments();
} else {

View File

@@ -17,6 +17,7 @@ import org.eclipse.hawkbit.ui.management.event.TargetFilterEvent;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -36,7 +37,8 @@ import com.vaadin.ui.VerticalLayout;
*
*/
public class FilterByStatusLayout extends VerticalLayout implements Button.ClickListener {
private static final long serialVersionUID = -6930348859189929850L;
private static final long serialVersionUID = 1L;
private final VaadinMessageSource i18n;
@@ -61,7 +63,8 @@ public class FilterByStatusLayout extends VerticalLayout implements Button.Click
private Button buttonClicked;
private static final String BTN_CLICKED = "btnClicked";
FilterByStatusLayout(final VaadinMessageSource i18n, final UIEventBus eventBus, final ManagementUIState managementUIState) {
FilterByStatusLayout(final VaadinMessageSource i18n, final UIEventBus eventBus,
final ManagementUIState managementUIState) {
this.i18n = i18n;
this.eventBus = eventBus;
this.managementUIState = managementUIState;
@@ -83,7 +86,8 @@ public class FilterByStatusLayout extends VerticalLayout implements Button.Click
addStyleName("target-status-filters");
setMargin(false);
final Label targetFilterStatusLabel = new LabelBuilder().name(i18n.getMessage("label.filter.by.status")).buildLabel();
final Label targetFilterStatusLabel = new LabelBuilder().name(i18n.getMessage("label.filter.by.status"))
.buildLabel();
targetFilterStatusLabel.addStyleName("target-status-filters-title");
@@ -149,23 +153,25 @@ public class FilterByStatusLayout extends VerticalLayout implements Button.Click
*/
private void getTargetFilterStatuses() {
unknown = SPUIComponentProvider.getButton(UIComponentIdProvider.UNKNOWN_STATUS_ICON,
TargetUpdateStatus.UNKNOWN.toString(), i18n.getMessage("tooltip.status.unknown"),
TargetUpdateStatus.UNKNOWN.toString(),
i18n.getMessage(UIMessageIdProvider.TOOLTIP_TARGET_STATUS_UNKNOWN),
SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
inSync = SPUIComponentProvider.getButton(UIComponentIdProvider.INSYNCH_STATUS_ICON,
TargetUpdateStatus.IN_SYNC.toString(), i18n.getMessage("tooltip.status.insync"),
TargetUpdateStatus.IN_SYNC.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC),
SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
pending = SPUIComponentProvider.getButton(UIComponentIdProvider.PENDING_STATUS_ICON,
TargetUpdateStatus.PENDING.toString(), i18n.getMessage("tooltip.status.pending"),
TargetUpdateStatus.PENDING.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING),
SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
error = SPUIComponentProvider.getButton(UIComponentIdProvider.ERROR_STATUS_ICON,
TargetUpdateStatus.ERROR.toString(), i18n.getMessage("tooltip.status.error"),
TargetUpdateStatus.ERROR.toString(), i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_ERROR),
SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
registered = SPUIComponentProvider.getButton(UIComponentIdProvider.REGISTERED_STATUS_ICON,
TargetUpdateStatus.REGISTERED.toString(), i18n.getMessage("tooltip.status.registered"),
SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
TargetUpdateStatus.REGISTERED.toString(),
i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED), SPUIDefinitions.SP_BUTTON_STATUS_STYLE,
false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
overdue = SPUIComponentProvider.getButton(UIComponentIdProvider.OVERDUE_STATUS_ICON, OVERDUE_CAPTION,
i18n.getMessage("tooltip.status.overdue"), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE,
SPUIButtonStyleSmall.class);
i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_OVERDUE), SPUIDefinitions.SP_BUTTON_STATUS_STYLE,
false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
applyStatusBtnStyle();
unknown.setData("filterStatusOne");
inSync.setData("filterStatusTwo");

View File

@@ -107,7 +107,7 @@ public class MultipleTargetFilter extends Accordion implements SelectedTabChange
targetFilterQueryButtonsTab.init(customTargetTagFilterButtonClick);
menu = new ConfigMenuBar(permChecker.hasCreateTargetPermission(), permChecker.hasUpdateTargetPermission(),
permChecker.hasDeleteRepositoryPermission(), getAddButtonCommand(), getUpdateButtonCommand(),
getDeleteButtonCommand(), UIComponentIdProvider.TARGET_MENU_BAR_ID);
getDeleteButtonCommand(), UIComponentIdProvider.TARGET_MENU_BAR_ID, i18n);
menu.addStyleName("targetTag");
addStyleName(ValoTheme.ACCORDION_BORDERLESS);
addTabs();

View File

@@ -53,6 +53,7 @@ import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
@@ -584,7 +585,8 @@ public class RolloutListGrid extends AbstractGrid<LazyQueryContainer> {
final String formattedConfirmationQuestion = getConfirmationQuestion(rollout.get());
final ConfirmationDialog confirmationDialog = new ConfirmationDialog(
i18n.getMessage("caption.entity.delete.action.confirmbox"), formattedConfirmationQuestion,
i18n.getMessage(SPUIDefinitions.BUTTON_OK), i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> {
i18n.getMessage(UIMessageIdProvider.BUTTON_OK), i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL),
ok -> {
if (!ok) {
return;
}
@@ -637,37 +639,38 @@ public class RolloutListGrid extends AbstractGrid<LazyQueryContainer> {
private StatusFontIcon createApprovalButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, APPROVE_BUTTON_ENABLED);
return new StatusFontIcon(FontAwesome.GAVEL, null, i18n.getMessage("tooltip.rollout.approve"),
return new StatusFontIcon(FontAwesome.GAVEL, null, i18n.getMessage(UIMessageIdProvider.TOOLTIP_ROLLOUT_APPROVE),
UIComponentIdProvider.ROLLOUT_APPROVAL_BUTTON_ID, isDisabled);
}
private StatusFontIcon createRunButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, RUN_BUTTON_ENABLED);
return new StatusFontIcon(FontAwesome.PLAY, null, i18n.getMessage("tooltip.rollout.run"),
return new StatusFontIcon(FontAwesome.PLAY, null, i18n.getMessage(UIMessageIdProvider.TOOLTIP_ROLLOUT_RUN),
UIComponentIdProvider.ROLLOUT_RUN_BUTTON_ID, isDisabled);
}
private StatusFontIcon createPauseButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, PAUSE_BUTTON_ENABLED);
return new StatusFontIcon(FontAwesome.PAUSE, null, i18n.getMessage("tooltip.rollout.pause"),
return new StatusFontIcon(FontAwesome.PAUSE, null, i18n.getMessage(UIMessageIdProvider.TOOLTIP_ROLLOUT_PAUSE),
UIComponentIdProvider.ROLLOUT_PAUSE_BUTTON_ID, isDisabled);
}
private StatusFontIcon createCopyButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, DELETE_COPY_BUTTON_ENABLED);
return new StatusFontIcon(FontAwesome.COPY, null, i18n.getMessage("tooltip.rollout.copy"),
return new StatusFontIcon(FontAwesome.COPY, null, i18n.getMessage(UIMessageIdProvider.TOOLTIP_ROLLOUT_COPY),
UIComponentIdProvider.ROLLOUT_COPY_BUTTON_ID, isDisabled);
}
private StatusFontIcon createUpdateButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, UPDATE_BUTTON_ENABLED);
return new StatusFontIcon(FontAwesome.EDIT, null, i18n.getMessage("tooltip.rollout.update"),
return new StatusFontIcon(FontAwesome.EDIT, null, i18n.getMessage(UIMessageIdProvider.TOOLTIP_ROLLOUT_UPDATE),
UIComponentIdProvider.ROLLOUT_UPDATE_BUTTON_ID, isDisabled);
}
private StatusFontIcon createDeleteButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, DELETE_COPY_BUTTON_ENABLED);
return new StatusFontIcon(FontAwesome.TRASH_O, null, i18n.getMessage("tooltip.rollout.delete"),
return new StatusFontIcon(FontAwesome.TRASH_O, null,
i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE),
UIComponentIdProvider.ROLLOUT_DELETE_BUTTON_ID, isDisabled);
}

View File

@@ -76,16 +76,16 @@ public class RolloutListView extends AbstractGridComponentLayout {
@Override
public AbstractOrderedLayout createGridHeader() {
return new RolloutListHeader(permissionChecker, rolloutUIState, eventBus, rolloutManagement, targetManagement,
uiNotification, uiProperties, entityFactory, i18n, targetFilterQueryManagement, rolloutGroupManagement,
quotaManagement);
return new RolloutListHeader(permissionChecker, rolloutUIState, getEventBus(), rolloutManagement,
targetManagement, uiNotification, uiProperties, entityFactory, getI18n(), targetFilterQueryManagement,
rolloutGroupManagement, quotaManagement);
}
@Override
public AbstractGrid<LazyQueryContainer> createGrid() {
return new RolloutListGrid(i18n, eventBus, rolloutManagement, uiNotification, rolloutUIState, permissionChecker,
targetManagement, entityFactory, uiProperties, targetFilterQueryManagement, rolloutGroupManagement,
quotaManagement, tenantConfigManagement);
return new RolloutListGrid(getI18n(), getEventBus(), rolloutManagement, uiNotification, rolloutUIState,
permissionChecker, targetManagement, entityFactory, uiProperties, targetFilterQueryManagement,
rolloutGroupManagement, quotaManagement, tenantConfigManagement);
}
}

View File

@@ -59,12 +59,13 @@ public class RolloutGroupsListView extends AbstractGridComponentLayout {
@Override
public RolloutGroupsListHeader createGridHeader() {
return new RolloutGroupsListHeader(eventBus, rolloutUIState, i18n);
return new RolloutGroupsListHeader(getEventBus(), rolloutUIState, getI18n());
}
@Override
public AbstractGrid<LazyQueryContainer> createGrid() {
return new RolloutGroupListGrid(i18n, eventBus, rolloutGroupManagement, rolloutUIState, permissionChecker);
return new RolloutGroupListGrid(getI18n(), getEventBus(), rolloutGroupManagement, rolloutUIState,
permissionChecker);
}
}

View File

@@ -152,7 +152,7 @@ public class RolloutGroupTargetsListHeader extends AbstractGridHeader {
rolloutNameLink = SPUIComponentProvider.getButton(null, "", "", null, false, null,
SPUIButtonStyleNoBorder.class);
rolloutNameLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links");
rolloutNameLink.setDescription("Rollout");
rolloutNameLink.setDescription(i18n.getMessage("dashboard.rollouts.caption"));
rolloutNameLink.addClickListener(value -> showRolloutGroupListView());
final HorizontalLayout headerCaptionLayout = new HorizontalLayout();

View File

@@ -40,12 +40,12 @@ public class RolloutGroupTargetsListView extends AbstractGridComponentLayout {
@Override
public AbstractOrderedLayout createGridHeader() {
return new RolloutGroupTargetsListHeader(eventBus, i18n, rolloutUIState);
return new RolloutGroupTargetsListHeader(getEventBus(), getI18n(), rolloutUIState);
}
@Override
public RolloutGroupTargetsListGrid createGrid() {
return new RolloutGroupTargetsListGrid(i18n, eventBus, rolloutUIState);
return new RolloutGroupTargetsListGrid(getI18n(), getEventBus(), rolloutUIState);
}
class RolloutTargetsCountFooterSupport extends AbstractFooterSupport {
@@ -54,7 +54,7 @@ public class RolloutGroupTargetsListView extends AbstractGridComponentLayout {
@Override
protected Label getFooterMessageLabel() {
final RolloutGroupTargetsCountLabelMessage countMessageLabel = new RolloutGroupTargetsCountLabelMessage(
rolloutUIState, (RolloutGroupTargetsListGrid) getGrid(), i18n, eventBus);
rolloutUIState, (RolloutGroupTargetsListGrid) getGrid(), getI18n(), getEventBus());
countMessageLabel.setId(UIComponentIdProvider.ROLLOUT_GROUP_TARGET_LABEL);
return countMessageLabel;
}

View File

@@ -165,18 +165,6 @@ public final class HawkbitCommonUtil {
.append(DIV_DESCRIPTION_END).toString();
}
/**
* Get Label for Action History Details.
*
* @param name
* @return ActionHistoryLabelId
*/
public static String getActionHistoryLabelId(final String name) {
return new StringBuilder()
.append(DIV_DESCRIPTION_START + "Action History For " + getBoldHTMLText(getFormattedName(name)))
.append(DIV_DESCRIPTION_END).toString();
}
/**
* Get tool tip for Poll status.
*

View File

@@ -468,10 +468,6 @@ public final class SPUIDefinitions {
public static final String NO_TAG = "NO TAG";
public static final String BUTTON_CANCEL = "button.cancel";
public static final String BUTTON_OK = "button.ok";
/**
* /** Constructor.
*/

View File

@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.ui.utils;
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties.TenantConfigurationKey;
/**
* Interface to provide the unchanged constants.
* Class that contains the unique ids of the UI components.
*/
public final class UIComponentIdProvider {
/**
@@ -1214,7 +1214,7 @@ public final class UIComponentIdProvider {
/**
* ID for the menu bar item to update a tag or type
*/
public static final String CONFIG_MENU_BAR_UPDATE = "update";
public static final String CONFIG_MENU_BAR_UPDATE = "edit";
/**
* ID for the menu bar item to delete a tag or type

View File

@@ -0,0 +1,94 @@
/**
* Copyright (c) 2018 Bosch Software Innovations GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.hawkbit.ui.utils;
/**
* Class that contains the unique ids of the messages provided in
* messages.properties.
*/
public final class UIMessageIdProvider {
public static final String BUTTON_CANCEL = "button.cancel";
public static final String BUTTON_OK = "button.ok";
public static final String TOOLTIP_MAXIMIZE = "tooltip.maximize";
public static final String TOOLTIP_MINIMIZE = "tooltip.minimize";
public static final String TOOLTIP_SEARCH = "tooltip.search";
public static final String TOOLTIP_CLOSE = "tooltip.close";
public static final String TOOLTIP_SAVE = "tooltip.save";
public static final String TOOLTIP_METADATA_ICON = "tooltip.metadata.icon";
public static final String TOOLTIP_UPDATE = "tooltip.update";
public static final String TOOLTIP_NEXT_MAINTENANCE_WINDOW = "tooltip.next.maintenance.window";
public static final String TOOLTIP_RESET = "tooltip.reset";
public static final String TOOLTIP_ADD = "tooltip.add";
public static final String TOOLTIP_SHOW_TAGS = "tooltip.showTags";
public static final String TOOLTIP_BULK_UPLOAD = "tooltip.bulkUpload";
public static final String TOOLTIP_CONFIGURE = "tooltip.configure";
public static final String TOOLTIP_CHECK_FOR_MANDATORY = "tooltip.check.for.mandatory";
public static final String TOOLTIP_ARTIFACT_ICON = "tooltip.artifact.icon";
public static final String TOOLTIP_DISTRIBUTION_SET_PIN = "tooltip.distribution.set.pin";
public static final String TOOLTIP_TIMEFORCED_ITEM = "tooltip.timeforced.item";
public static final String TOOLTIP_SOFT_ITEM = "tooltip.soft.item";
public static final String TOOLTIP_FORCED_ITEM = "tooltip.forced.item";
public static final String TOOLTIP_TARGET_PIN = "tooltip.target.pin";
public static final String TOOLTIP_TARGET_STATUS_UNKNOWN = "tooltip.target.status.unknown";
public static final String TOOLTIP_STATUS_OVERDUE = "tooltip.status.overdue";
public static final String TOOLTIP_STATUS_REGISTERED = "tooltip.status.registered";
public static final String TOOLTIP_STATUS_ERROR = "tooltip.status.error";
public static final String TOOLTIP_STATUS_PENDING = "tooltip.status.pending";
public static final String TOOLTIP_STATUS_INSYNC = "tooltip.status.insync";
public static final String TOOLTIP_DELETE = "tooltip.delete";
public static final String TOOLTIP_ROLLOUT_UPDATE = "tooltip.rollout.update";
public static final String TOOLTIP_ROLLOUT_COPY = "tooltip.rollout.copy";
public static final String TOOLTIP_ROLLOUT_PAUSE = "tooltip.rollout.pause";
public static final String TOOLTIP_ROLLOUT_RUN = "tooltip.rollout.run";
public static final String TOOLTIP_ROLLOUT_APPROVE = "tooltip.rollout.approve";
public static final String TOOLTIP_IN_TIME = "tooltip.in.time";
/**
* Private Constructor.
*/
private UIMessageIdProvider() {
}
}

View File

@@ -21,7 +21,7 @@ dashboard.distributions.caption-long = Distributions Management
dashboard.filters.caption = Target Filters
dashboard.filters.caption-long = Target Filter Management
dashboard.deployment.caption = Deployment
dashboard.deployment.caption-long Deployment Management
dashboard.deployment.caption-long = Deployment Management
dashboard.rollouts.caption = Rollout
dashboard.rollouts.caption-long = Rollout Management
@@ -97,7 +97,8 @@ distribution.set.tag.deleted.event.container.notifcation.message=distribution se
distribution.set.tag.updated.event.container.notifcation.message=distribution set tags changed
# Captions prefix with - caption
caption.action.history = Action history for {0}
caption.action.history = Action history
caption.action.history.for = Action history for {0}
caption.error = Error
caption.new.softwaremodule.application = Configure New Application
caption.new.softwaremodule.jvm = Configure New Runtime
@@ -114,7 +115,7 @@ caption.software.module = Software Module
caption.rollout = Rollout
caption.create.new = Create new {0}
caption.update = Update {0}
caption.update = Edit {0}
caption.select.auto.assign.dist = Select auto assignment distribution set
caption.bulk.upload.targets = Bulk Upload
@@ -171,9 +172,9 @@ label.mandatory.field = * Mandatory Field
label.components.drop.area = Drop here to delete
label.software.module.drop.area = Delete Software
label.create.tag = Create Tag
label.update.tag = Update Tag
label.update.tag = Edit Tag
label.create.type = Create Type
label.update.type = Update Type
label.update.type = Edit Type
label.singleAssign.type = Firmware (FW)
label.multiAssign.type = Software (SW)
label.choose.type.color = Type Color
@@ -253,15 +254,31 @@ tooltip.timeforced.item=Soft update until a specific time and then the action wi
tooltip.check.for.mandatory=Check to make Mandatory
tooltip.artifact.icon=Show Artifact Details
tooltip.click.to.edit = Click to edit
tooltip.metadata.icon = Manage Metadata
tooltip.next.maintenancewindow = next on {0}
tooltip.metadata.icon = Manage Metadata..
tooltip.next.maintenance.window = next on {0}
#rollout action
tooltip.rollout.run = Run
tooltip.rollout.approve = Approve
tooltip.rollout.pause = Pause
tooltip.rollout.update = Update..
tooltip.rollout.update = Edit..
tooltip.rollout.copy = Copy..
tooltip.rollout.delete = Delete..
tooltip.delete = Delete..
tooltip.close = Close
tooltip.search = Search
tooltip.save = Save
tooltip.add = Create..
tooltip.maximize = Maximize
tooltip.minimize = Minimize
tooltip.bulkUpload = Bulk Upload..
tooltip.showTags = Show Tags
tooltip.update = Edit..
tooltip.reset = Reset
tooltip.configure = Configure..
tooltip.target.status.unknown = Status unknown
tooltip.target.pin = Pin target
tooltip.distribution.set.pin = Pin distribution set
tooltip.in.time = In Time
# Notification messages prefix with - message
message.save.success = {0} saved successfully
@@ -512,7 +529,7 @@ header.assigned.ds = Assigned DS
header.installed.ds = Installed DS
header.target.status = Status
header.target.tags = Tags
header.total.targets = Targets
header.total.targets = Targets
header.key = Key
header.value = Value
metadata.targetvisible = Visible for targets
@@ -630,6 +647,7 @@ caption.entity.software.module.type = Software Module Type
validator.textfield.min.length = Please enter a text consisting of at least one and a maximum of {0} characters.
caption.entity.delete.action.confirmbox = Confirm Deletion
message.confirm.delete.entity = Are you sure you want to delete {0} {1}{2}?
caption.entity.assign.action.confirmbox = Confirm Assignment