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

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.m2e.core.maven2Builder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.sonarlint.eclipse.core.sonarlintBuilder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>

View File

@@ -1 +1,3 @@
/bin/ /bin/
/target/
/.externalToolBuilders/

View File

@@ -0,0 +1 @@
/artifactrepo/

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.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions; import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@@ -181,9 +182,11 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private SPUIButton createMaxMinButton() { private SPUIButton createMaxMinButton() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(SPUIDefinitions.EXPAND_ACTION_HISTORY, 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()); button.addClickListener(event -> maxArtifactDetails());
return button; return button;
} }
private void buildLayout() { private void buildLayout() {
@@ -273,13 +276,15 @@ public class ArtifactDetailsLayout extends VerticalLayout {
return deleteIcon; return deleteIcon;
} }
}); });
} }
private void confirmAndDeleteArtifact(final Long id, final String fileName) { private void confirmAndDeleteArtifact(final Long id, final String fileName) {
final ConfirmationDialog confirmDialog = new ConfirmationDialog( final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.delete.artifact.confirmbox"), i18n.getMessage("caption.delete.artifact.confirmbox"),
i18n.getMessage("message.delete.artifact", new Object[] { fileName }), 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) { if (ok) {
artifactManagement.delete(id); artifactManagement.delete(id);
uINotification.displaySuccess(i18n.getMessage("message.artifact.deleted", fileName)); uINotification.displaySuccess(i18n.getMessage("message.artifact.deleted", fileName));
@@ -292,6 +297,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
} }
private void setTableColumnDetails(final Table table) { private void setTableColumnDetails(final Table table) {
table.setColumnHeader(PROVIDED_FILE_NAME, i18n.getMessage("upload.file.name")); table.setColumnHeader(PROVIDED_FILE_NAME, i18n.getMessage("upload.file.name"));
table.setColumnHeader(SIZE, i18n.getMessage("upload.size")); table.setColumnHeader(SIZE, i18n.getMessage("upload.size"));
if (fullWindowMode) { if (fullWindowMode) {
@@ -351,6 +357,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private void maxArtifactDetails() { private void maxArtifactDetails() {
final Boolean flag = (Boolean) maxMinButton.getData(); final Boolean flag = (Boolean) maxMinButton.getData();
if (flag == null || Boolean.FALSE.equals(flag)) { if (flag == null || Boolean.FALSE.equals(flag)) {
// Clicked on max Button
maximizedArtifactDetailsView(); maximizedArtifactDetailsView();
} else { } else {
minimizedArtifactDetailsView(); minimizedArtifactDetailsView();
@@ -387,6 +394,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
} }
private void createArtifactDetailsMaxView() { private void createArtifactDetailsMaxView() {
artifactDetailsTable.setValue(null); artifactDetailsTable.setValue(null);
artifactDetailsTable.setSelectable(false); artifactDetailsTable.setSelectable(false);
artifactDetailsTable.setMultiSelect(false); artifactDetailsTable.setMultiSelect(false);
@@ -497,11 +505,13 @@ public class ArtifactDetailsLayout extends VerticalLayout {
private void showMinIcon() { private void showMinIcon() {
maxMinButton.toggleIcon(FontAwesome.COMPRESS); maxMinButton.toggleIcon(FontAwesome.COMPRESS);
maxMinButton.setData(Boolean.TRUE); maxMinButton.setData(Boolean.TRUE);
maxMinButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MINIMIZE));
} }
private void showMaxIcon() { private void showMaxIcon() {
maxMinButton.toggleIcon(FontAwesome.EXPAND); maxMinButton.toggleIcon(FontAwesome.EXPAND);
maxMinButton.setData(Boolean.FALSE); maxMinButton.setData(Boolean.FALSE);
maxMinButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE));
} }
private boolean isMaximized() { 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.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus; import org.vaadin.spring.events.EventBus;
@@ -281,8 +282,8 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
final ConfirmationDialog confirmDialog = new ConfirmationDialog( final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.entity.delete.action.confirmbox"), i18n.getMessage("caption.entity.delete.action.confirmbox"),
i18n.getMessage("message.confirm.delete.metadata", key), i18n.getMessage(SPUIDefinitions.BUTTON_OK), i18n.getMessage("message.confirm.delete.metadata", key), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> { i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok) { if (ok) {
handleOkDeleteMetadata(event, key); 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.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus.UIEventBus; import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -235,16 +236,17 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
caption.setContentMode(ContentMode.HTML); caption.setContentMode(ContentMode.HTML);
caption.setId(getDetailsHeaderCaptionId()); caption.setId(getDetailsHeaderCaptionId());
editButton = SPUIComponentProvider.getButton("", "", "", null, false, FontAwesome.PENCIL_SQUARE_O, editButton = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE), null,
SPUIButtonStyleNoBorder.class); false, FontAwesome.PENCIL_SQUARE_O, SPUIButtonStyleNoBorder.class);
editButton.setId(getEditButtonId()); editButton.setId(getEditButtonId());
editButton.addClickListener(this::onEdit); editButton.addClickListener(this::onEdit);
editButton.setEnabled(false); 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); SPUIButtonStyleNoBorder.class);
manageMetadataBtn.setId(getMetadataButtonId()); manageMetadataBtn.setId(getMetadataButtonId());
manageMetadataBtn.setDescription(i18n.getMessage("tooltip.metadata.icon")); manageMetadataBtn.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON));
manageMetadataBtn.addClickListener(this::showMetadata); manageMetadataBtn.addClickListener(this::showMetadata);
manageMetadataBtn.setEnabled(false); 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.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer; import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
@@ -178,7 +179,7 @@ public abstract class AbstractFilterButtons extends Table {
} else { } else {
deleteButton.setId(UIComponentIdProvider.DELETE_TAG_ID + itemId.toString()); deleteButton.setId(UIComponentIdProvider.DELETE_TAG_ID + itemId.toString());
} }
deleteButton.setDescription(SPUIDefinitions.DELETE); deleteButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE));
deleteButton.addClickListener(this::addDeleteButtonClickListener); deleteButton.addClickListener(this::addDeleteButtonClickListener);
return deleteButton; return deleteButton;
} }
@@ -317,7 +318,8 @@ public abstract class AbstractFilterButtons extends Table {
i18n.getMessage("caption.entity.delete.action.confirmbox"), i18n.getMessage("caption.entity.delete.action.confirmbox"),
i18n.getMessage("message.confirm.delete.entity", entityName.toLowerCase(), i18n.getMessage("message.confirm.delete.entity", entityName.toLowerCase(),
entityToDelete.substring(entityToDelete.indexOf('.') + 1), ""), 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) { if (ok) {
deleteEntity(entityToDelete); deleteEntity(entityToDelete);
} else { } 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.decorators.SPUIButtonStyleNoBorder;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus; import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBus.UIEventBus; import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -97,9 +98,10 @@ public abstract class AbstractFilterHeader extends VerticalLayout {
if (isAddTagRequired()) { if (isAddTagRequired()) {
menu = new ConfigMenuBar(permChecker.hasCreateRepositoryPermission(), menu = new ConfigMenuBar(permChecker.hasCreateRepositoryPermission(),
permChecker.hasUpdateRepositoryPermission(), permChecker.hasDeleteRepositoryPermission(), 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); SPUIButtonStyleNoBorder.class);
hideIcon.addClickListener(event -> hideFilterButtonLayout()); 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.management.actionhistory.ProxyActionStatus;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil; import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer; import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
import org.vaadin.spring.events.EventBus; import org.vaadin.spring.events.EventBus;
@@ -640,6 +641,7 @@ public abstract class AbstractGrid<T extends Indexed> extends Grid implements Re
* detailed format. * detailed format.
*/ */
protected static class TooltipGenerator implements CellDescriptionGenerator { protected static class TooltipGenerator implements CellDescriptionGenerator {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final VaadinMessageSource i18n; 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) { private String getFormattedNextMaintenanceWindow(final ZonedDateTime nextAt) {
final long nextAtMilli = nextAt.toInstant().toEpochMilli(); 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)); 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}. * and grid header {@link DefaultGridHeader}.
*/ */
public abstract class AbstractGridComponentLayout extends VerticalLayout { public abstract class AbstractGridComponentLayout extends VerticalLayout {
private static final long serialVersionUID = -3766179797384539821L;
protected final transient EventBus.UIEventBus eventBus; private static final long serialVersionUID = 1L;
protected final VaadinMessageSource i18n;
private final transient EventBus.UIEventBus eventBus;
private final VaadinMessageSource i18n;
private AbstractOrderedLayout gridHeader; private AbstractOrderedLayout gridHeader;
private Grid grid; private Grid grid;
private transient AbstractFooterSupport footerSupport; private transient AbstractFooterSupport footerSupport;
@@ -203,4 +206,13 @@ public abstract class AbstractGridComponentLayout extends VerticalLayout {
*/ */
protected abstract Label getFooterMessageLabel(); 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.rollout.state.RolloutUIState;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@@ -115,23 +116,26 @@ public abstract class AbstractGridHeader extends VerticalLayout {
} }
private SPUIButton createSearchResetIcon() { private SPUIButton createSearchResetIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getSearchRestIconId(), "", "", null, final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getSearchRestIconId(), "",
false, FontAwesome.SEARCH, SPUIButtonStyleNoBorder.class); i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> onSearchResetClick()); button.addClickListener(event -> onSearchResetClick());
button.setData(Boolean.FALSE); button.setData(Boolean.FALSE);
return button; return button;
} }
private Button createAddButton() { 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); SPUIButtonStyleNoBorder.class);
button.addClickListener(this::addNewItem); button.addClickListener(this::addNewItem);
return button; return button;
} }
private Button createCloseButton() { private Button createCloseButton() {
final Button button = SPUIComponentProvider.getButton(getCloseButtonId(), "", "", null, false, final Button button = SPUIComponentProvider.getButton(getCloseButtonId(), "",
FontAwesome.TIMES, SPUIButtonStyleNoBorder.class); i18n.getMessage(UIMessageIdProvider.TOOLTIP_CLOSE), null, false, FontAwesome.TIMES,
SPUIButtonStyleNoBorder.class);
button.addClickListener(this::onClose); button.addClickListener(this::onClose);
return button; return button;
} }
@@ -155,6 +159,7 @@ public abstract class AbstractGridHeader extends VerticalLayout {
searchResetIcon.addStyleName(SPUIDefinitions.FILTER_RESET_ICON); searchResetIcon.addStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.TIMES); searchResetIcon.toggleIcon(FontAwesome.TIMES);
searchResetIcon.setData(Boolean.TRUE); searchResetIcon.setData(Boolean.TRUE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_RESET));
searchField.removeStyleName(SPUIDefinitions.FILTER_BOX_HIDE); searchField.removeStyleName(SPUIDefinitions.FILTER_BOX_HIDE);
searchField.setVisible(true); searchField.setVisible(true);
searchField.focus(); searchField.focus();
@@ -167,6 +172,7 @@ public abstract class AbstractGridHeader extends VerticalLayout {
searchResetIcon.removeStyleName(SPUIDefinitions.FILTER_RESET_ICON); searchResetIcon.removeStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.SEARCH); searchResetIcon.toggleIcon(FontAwesome.SEARCH);
searchResetIcon.setData(Boolean.FALSE); searchResetIcon.setData(Boolean.FALSE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH));
resetSearchText(); 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.decorators.SPUIButtonStyleNoBorder;
import org.eclipse.hawkbit.ui.management.state.ManagementUIState; import org.eclipse.hawkbit.ui.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; 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.server.FontAwesome;
import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.shared.ui.label.ContentMode;
@@ -35,13 +37,15 @@ public class DefaultGridHeader extends VerticalLayout {
private HorizontalLayout titleLayout; private HorizontalLayout titleLayout;
private transient AbstractHeaderMaximizeSupport maximizeSupport; private transient AbstractHeaderMaximizeSupport maximizeSupport;
private final VaadinMessageSource i18n;
/** /**
* Constructor. * Constructor.
* *
* @param managementUIState * @param managementUIState
*/ */
public DefaultGridHeader(final ManagementUIState managementUIState) { public DefaultGridHeader(final ManagementUIState managementUIState, final VaadinMessageSource i18n) {
this(managementUIState, ""); this(managementUIState, "", i18n);
} }
/** /**
@@ -50,9 +54,11 @@ public class DefaultGridHeader extends VerticalLayout {
* @param managementUIState * @param managementUIState
* @param titleText * @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.managementUIState = managementUIState;
this.titleText = titleText; this.titleText = titleText;
this.i18n = i18n;
} }
/** /**
@@ -217,8 +223,9 @@ public class DefaultGridHeader extends VerticalLayout {
* @return newly cretaed min-max-button * @return newly cretaed min-max-button
*/ */
protected SPUIButton createMinMaxButton(final String buttonId) { protected SPUIButton createMinMaxButton(final String buttonId) {
return (SPUIButton) SPUIComponentProvider.getButton(buttonId, "", "Maximize", null, true, return (SPUIButton) SPUIComponentProvider.getButton(buttonId, "",
FontAwesome.EXPAND, SPUIButtonStyleNoBorder.class); i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE), null, true, FontAwesome.EXPAND,
SPUIButtonStyleNoBorder.class);
} }
/** /**
@@ -226,7 +233,7 @@ public class DefaultGridHeader extends VerticalLayout {
*/ */
public void showMinIcon() { public void showMinIcon() {
maxMinButton.toggleIcon(FontAwesome.COMPRESS); maxMinButton.toggleIcon(FontAwesome.COMPRESS);
maxMinButton.setDescription("Minimize"); maxMinButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MINIMIZE));
maxMinButton.setData(Boolean.TRUE); maxMinButton.setData(Boolean.TRUE);
} }
@@ -235,7 +242,7 @@ public class DefaultGridHeader extends VerticalLayout {
*/ */
public void showMaxIcon() { public void showMaxIcon() {
maxMinButton.toggleIcon(FontAwesome.EXPAND); maxMinButton.toggleIcon(FontAwesome.EXPAND);
maxMinButton.setDescription("Maximize"); maxMinButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE));
maxMinButton.setData(Boolean.FALSE); 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.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions; import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer; import org.vaadin.addons.lazyquerycontainer.LazyQueryContainer;
@@ -364,7 +365,7 @@ public abstract class AbstractTable<E extends NamedEntity> extends Table impleme
SPUIButtonStyleNoBorderWithIcon.class); SPUIButtonStyleNoBorderWithIcon.class);
final String id = getEntityId(itemId); final String id = getEntityId(itemId);
deleteButton.setId("delete.entity." + id); deleteButton.setId("delete.entity." + id);
deleteButton.setDescription(SPUIDefinitions.DELETE); deleteButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE));
deleteButton.addClickListener(this::addDeleteButtonClickListener); deleteButton.addClickListener(this::addDeleteButtonClickListener);
return deleteButton; return deleteButton;
} }
@@ -401,8 +402,8 @@ public abstract class AbstractTable<E extends NamedEntity> extends Table impleme
private ConfirmationDialog createConfirmationWindowForDeletion(final List<Long> entitiesToBeDeleted, private ConfirmationDialog createConfirmationWindowForDeletion(final List<Long> entitiesToBeDeleted,
final String confirmationQuestion) { final String confirmationQuestion) {
return new ConfirmationDialog(i18n.getMessage("caption.entity.delete.action.confirmbox", getEntityType()), return new ConfirmationDialog(i18n.getMessage("caption.entity.delete.action.confirmbox", getEntityType()),
confirmationQuestion, i18n.getMessage(SPUIDefinitions.BUTTON_OK), confirmationQuestion, i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> { i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok) { if (ok) {
handleOkDelete(entitiesToBeDeleted); 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.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.vaadin.spring.events.EventBus; import org.vaadin.spring.events.EventBus;
@@ -220,38 +221,43 @@ public abstract class AbstractTableHeader extends VerticalLayout {
} }
private SPUIButton createSearchResetIcon() { private SPUIButton createSearchResetIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getSearchRestIconId(), "", "", null, final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getSearchRestIconId(), "",
false, FontAwesome.SEARCH, SPUIButtonStyleNoBorder.class); i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> onSearchResetClick()); button.addClickListener(event -> onSearchResetClick());
button.setData(Boolean.FALSE); button.setData(Boolean.FALSE);
return button; return button;
} }
private Button createAddIcon() { 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); SPUIButtonStyleNoBorder.class);
button.addClickListener(this::addNewItem); button.addClickListener(this::addNewItem);
return button; return button;
} }
private Button createBulkUploadIcon() { private Button createBulkUploadIcon() {
final Button button = SPUIComponentProvider.getButton(getBulkUploadIconId(), "", "", null, false, final Button button = SPUIComponentProvider.getButton(getBulkUploadIconId(), "",
FontAwesome.UPLOAD, SPUIButtonStyleNoBorder.class); i18n.getMessage(UIMessageIdProvider.TOOLTIP_BULK_UPLOAD), null, false, FontAwesome.UPLOAD,
SPUIButtonStyleNoBorder.class);
button.addClickListener(this::bulkUpload); button.addClickListener(this::bulkUpload);
return button; return button;
} }
private Button createShowFilterButtonLayout() { private Button createShowFilterButtonLayout() {
final Button button = SPUIComponentProvider.getButton(getShowFilterButtonLayoutId(), null, null, null, false, final Button button = SPUIComponentProvider.getButton(getShowFilterButtonLayoutId(), null,
FontAwesome.TAGS, SPUIButtonStyleNoBorder.class); i18n.getMessage(UIMessageIdProvider.TOOLTIP_SHOW_TAGS), null, false, FontAwesome.TAGS,
SPUIButtonStyleNoBorder.class);
button.setVisible(false); button.setVisible(false);
button.addClickListener(event -> showFilterButtonsIconClicked()); button.addClickListener(event -> showFilterButtonsIconClicked());
return button; return button;
} }
private SPUIButton createMaxMinIcon() { private SPUIButton createMaxMinIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getMaxMinIconId(), "", "", null, false, final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getMaxMinIconId(), "",
FontAwesome.EXPAND, SPUIButtonStyleNoBorder.class); i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE), null, false, FontAwesome.EXPAND,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> maxMinButtonClicked()); button.addClickListener(event -> maxMinButtonClicked());
return button; return button;
} }
@@ -275,6 +281,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
searchResetIcon.addStyleName(SPUIDefinitions.FILTER_RESET_ICON); searchResetIcon.addStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.TIMES); searchResetIcon.toggleIcon(FontAwesome.TIMES);
searchResetIcon.setData(Boolean.TRUE); searchResetIcon.setData(Boolean.TRUE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_RESET));
searchField.removeStyleName(SPUIDefinitions.FILTER_BOX_HIDE); searchField.removeStyleName(SPUIDefinitions.FILTER_BOX_HIDE);
searchField.focus(); searchField.focus();
} }
@@ -282,6 +289,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
private void closeSearchTextField() { private void closeSearchTextField() {
searchField.setValue(""); searchField.setValue("");
searchField.addStyleName(SPUIDefinitions.FILTER_BOX_HIDE); searchField.addStyleName(SPUIDefinitions.FILTER_BOX_HIDE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH));
searchResetIcon.removeStyleName(SPUIDefinitions.FILTER_RESET_ICON); searchResetIcon.removeStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.SEARCH); searchResetIcon.toggleIcon(FontAwesome.SEARCH);
searchResetIcon.setData(Boolean.FALSE); searchResetIcon.setData(Boolean.FALSE);
@@ -314,11 +322,13 @@ public abstract class AbstractTableHeader extends VerticalLayout {
private void showMinIcon() { private void showMinIcon() {
maxMinIcon.toggleIcon(FontAwesome.COMPRESS); maxMinIcon.toggleIcon(FontAwesome.COMPRESS);
maxMinIcon.setData(Boolean.TRUE); maxMinIcon.setData(Boolean.TRUE);
maxMinIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MINIMIZE));
} }
private void showMaxIcon() { private void showMaxIcon() {
maxMinIcon.toggleIcon(FontAwesome.EXPAND); maxMinIcon.toggleIcon(FontAwesome.EXPAND);
maxMinIcon.setData(Boolean.FALSE); maxMinIcon.setData(Boolean.FALSE);
maxMinIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE));
} }
private static HorizontalLayout createHeaderFilterIconLayout() { 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.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.server.FontAwesome;
import com.vaadin.ui.MenuBar; import com.vaadin.ui.MenuBar;
@@ -40,8 +42,10 @@ public class ConfigMenuBar extends MenuBar {
private final String id; private final String id;
private final VaadinMessageSource i18n;
/** /**
* Constructor for the menubar * Constructor for the Menubar
* *
* @param createPermission * @param createPermission
* flag if the logged-in user has permission to create the entity * flag if the logged-in user has permission to create the entity
@@ -63,10 +67,12 @@ public class ConfigMenuBar extends MenuBar {
* command * command
* @param id * @param id
* the id of the menuBar * the id of the menuBar
* @param i18n
* VaadinMessageSource
*/ */
public ConfigMenuBar(final boolean createPermission, final boolean updatePermission, final boolean deletePermission, public ConfigMenuBar(final boolean createPermission, final boolean updatePermission, final boolean deletePermission,
final Command addButtonCommand, final Command updateButtonCommand, final Command deleteButtonCommand, final Command addButtonCommand, final Command updateButtonCommand, final Command deleteButtonCommand,
final String id) { final String id, final VaadinMessageSource i18n) {
this.createPermission = createPermission; this.createPermission = createPermission;
this.updatePermission = updatePermission; this.updatePermission = updatePermission;
this.deletePermission = deletePermission; this.deletePermission = deletePermission;
@@ -74,6 +80,7 @@ public class ConfigMenuBar extends MenuBar {
this.updateButtonCommand = updateButtonCommand; this.updateButtonCommand = updateButtonCommand;
this.deleteButtonCommand = deleteButtonCommand; this.deleteButtonCommand = deleteButtonCommand;
this.id = id; this.id = id;
this.i18n = i18n;
init(); init();
} }
@@ -87,6 +94,7 @@ public class ConfigMenuBar extends MenuBar {
addStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_POSITION); addStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_POSITION);
config = addItem("", FontAwesome.COG, null); config = addItem("", FontAwesome.COG, null);
config.setStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_ITEMS); config.setStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_ITEMS);
config.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_CONFIGURE));
addMenuItems(); 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.decorators.SPUIButtonStyleNoBorder;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@@ -151,7 +152,7 @@ public class DistributionSetTypeSoftwareModuleSelectLayout extends VerticalLayou
if (DIST_TYPE_NAME.equals(propertyId) && !StringUtils.isEmpty(description)) { if (DIST_TYPE_NAME.equals(propertyId) && !StringUtils.isEmpty(description)) {
return i18n.getMessage("label.description") + description; return i18n.getMessage("label.description") + description;
} else if (DIST_TYPE_MANDATORY.equals(propertyId)) { } else if (DIST_TYPE_MANDATORY.equals(propertyId)) {
return i18n.getMessage("tooltip.check.for.mandatory"); return i18n.getMessage(UIMessageIdProvider.TOOLTIP_CHECK_FOR_MANDATORY);
} }
return null; 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.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions; import org.eclipse.hawkbit.ui.utils.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.view.filter.OnlyEventsFromDistributionsViewFilter; import org.eclipse.hawkbit.ui.view.filter.OnlyEventsFromDistributionsViewFilter;
@@ -316,8 +317,8 @@ public class DistributionSetTable extends AbstractNamedVersionTable<Distribution
private ConfirmationDialog createConfirmationWindowForAssignment(final String confirmQuestion) { private ConfirmationDialog createConfirmationWindowForAssignment(final String confirmQuestion) {
return new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX), confirmQuestion, return new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX), confirmQuestion,
getI18n().getMessage(SPUIDefinitions.BUTTON_OK), getI18n().getMessage(SPUIDefinitions.BUTTON_CANCEL), getI18n().getMessage(UIMessageIdProvider.BUTTON_OK),
ok -> { getI18n().getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok) { if (ok) {
saveAllAssignments(); saveAllAssignments();
} else { } 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.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus.UIEventBus; import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -88,7 +89,7 @@ public class SwModuleDetails extends AbstractSoftwareModuleDetails {
private Button createShowArtifactDetailsButton() { private Button createShowArtifactDetailsButton() {
artifactDetailsButton = SPUIComponentProvider.getButton("", "", "", null, false, FontAwesome.FILE_O, artifactDetailsButton = SPUIComponentProvider.getButton("", "", "", null, false, FontAwesome.FILE_O,
SPUIButtonStyleNoBorder.class); SPUIButtonStyleNoBorder.class);
artifactDetailsButton.setDescription(getI18n().getMessage("tooltip.artifact.icon")); artifactDetailsButton.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_ARTIFACT_ICON));
artifactDetailsButton.addClickListener(event -> showArtifactDetailsWindow(getSelectedBaseEntity())); artifactDetailsButton.addClickListener(event -> showArtifactDetailsWindow(getSelectedBaseEntity()));
return artifactDetailsButton; 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.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
@@ -313,8 +314,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private SPUIButton createSearchResetIcon() { private SPUIButton createSearchResetIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton( final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(
UIComponentIdProvider.CUSTOM_FILTER_CLOSE, "", "", null, false, FontAwesome.TIMES, UIComponentIdProvider.CUSTOM_FILTER_CLOSE, "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_CLOSE), null,
SPUIButtonStyleNoBorder.class); false, FontAwesome.TIMES, SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> closeFilterLayout()); button.addClickListener(event -> closeFilterLayout());
return button; return button;
} }
@@ -329,16 +330,17 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
private Button createSaveButton() { private Button createSaveButton() {
saveButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON, saveButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON,
UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON, "Save", null, false, FontAwesome.SAVE, UIComponentIdProvider.CUSTOM_FILTER_SAVE_ICON, i18n.getMessage(UIMessageIdProvider.TOOLTIP_SAVE), null,
SPUIButtonStyleNoBorder.class); false, FontAwesome.SAVE, SPUIButtonStyleNoBorder.class);
saveButton.addClickListener(this); saveButton.addClickListener(this);
saveButton.setEnabled(false); saveButton.setEnabled(false);
return saveButton; return saveButton;
} }
private Button createSearchIcon() { private Button createSearchIcon() {
searchIcon = SPUIComponentProvider.getButton(UIComponentIdProvider.FILTER_SEARCH_ICON_ID, "", "", null, false, searchIcon = SPUIComponentProvider.getButton(UIComponentIdProvider.FILTER_SEARCH_ICON_ID, "",
FontAwesome.SEARCH, SPUIButtonStyleNoBorder.class); i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
SPUIButtonStyleNoBorder.class);
searchIcon.addClickListener(event -> onSearchIconClick()); searchIcon.addClickListener(event -> onSearchIconClick());
searchIcon.setEnabled(false); searchIcon.setEnabled(false);
searchIcon.setData(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.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn; import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory; import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
@@ -201,24 +202,24 @@ public class CreateOrUpdateFilterTable extends Table {
final Label label = new LabelBuilder().name("").buildLabel(); final Label label = new LabelBuilder().name("").buildLabel();
label.setContentMode(ContentMode.HTML); label.setContentMode(ContentMode.HTML);
if (targetStatus == TargetUpdateStatus.PENDING) { if (targetStatus == TargetUpdateStatus.PENDING) {
label.setDescription("Pending"); label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING));
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW); label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW);
label.setValue(FontAwesome.ADJUST.getHtml()); label.setValue(FontAwesome.ADJUST.getHtml());
} else if (targetStatus == TargetUpdateStatus.REGISTERED) { } else if (targetStatus == TargetUpdateStatus.REGISTERED) {
label.setDescription("Registered"); label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED));
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE); label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE);
label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml()); label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml());
} else if (targetStatus == TargetUpdateStatus.ERROR) { } 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.setStyleName(SPUIStyleDefinitions.STATUS_ICON_RED);
label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml()); label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
} else if (targetStatus == TargetUpdateStatus.IN_SYNC) { } else if (targetStatus == TargetUpdateStatus.IN_SYNC) {
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN); label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN);
label.setDescription("In-Synch"); label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC));
label.setValue(FontAwesome.CHECK_CIRCLE.getHtml()); label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
} else if (targetStatus == TargetUpdateStatus.UNKNOWN) { } else if (targetStatus == TargetUpdateStatus.UNKNOWN) {
label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE); 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()); label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml());
} }
return label; 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.filtermanagement.event.CustomFilterUIEvent;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus; import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBus.UIEventBus; import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -273,7 +274,7 @@ public class DistributionSetSelectWindow
layout.addComponent(buttonsLayout); layout.addComponent(buttonsLayout);
okButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SAVE_BUTTON, okButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SAVE_BUTTON,
i18n.getMessage(SPUIDefinitions.BUTTON_OK), "", "", true, FontAwesome.SAVE, i18n.getMessage(UIMessageIdProvider.BUTTON_OK), "", "", true, FontAwesome.SAVE,
SPUIButtonStyleNoBorderWithIcon.class); SPUIButtonStyleNoBorderWithIcon.class);
okButton.setSizeUndefined(); okButton.setSizeUndefined();
okButton.addStyleName("default-color"); okButton.addStyleName("default-color");
@@ -283,7 +284,7 @@ public class DistributionSetSelectWindow
buttonsLayout.setExpandRatio(okButton, 1.0F); buttonsLayout.setExpandRatio(okButton, 1.0F);
final Button cancelButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CANCEL_BUTTON, 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); SPUIButtonStyleNoBorderWithIcon.class);
cancelButton.setSizeUndefined(); cancelButton.setSizeUndefined();
cancelButton.addStyleName("default-color"); 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 UINotification notification, final UiProperties uiProperties, final EntityFactory entityFactory,
final AutoCompleteTextFieldComponent queryTextField, final ManageDistUIState manageDistUIState, final AutoCompleteTextFieldComponent queryTextField, final ManageDistUIState manageDistUIState,
final TargetManagement targetManagement) { 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, this.targetFilterTable = new TargetFilterTable(i18n, notification, eventBus, filterManagementUIState,
targetFilterQueryManagement, manageDistUIState, targetManagement, permissionChecker); targetFilterQueryManagement, manageDistUIState, targetManagement, permissionChecker);
this.createNewFilterHeader = new CreateOrUpdateFilterHeader(i18n, eventBus, filterManagementUIState, 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.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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;
import org.vaadin.spring.events.EventBus.UIEventBus; import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -51,6 +53,8 @@ public class TargetFilterHeader extends VerticalLayout {
private SPUIButton searchResetIcon; private SPUIButton searchResetIcon;
private final VaadinMessageSource i18n;
/** /**
* Constructor for TargetFilterHeader * Constructor for TargetFilterHeader
* *
@@ -60,12 +64,15 @@ public class TargetFilterHeader extends VerticalLayout {
* FilterManagementUIState * FilterManagementUIState
* @param permissionChecker * @param permissionChecker
* SpPermissionChecker * SpPermissionChecker
* @param i18n
* VaadinMessageSource
*/ */
public TargetFilterHeader(final UIEventBus eventBus, final FilterManagementUIState filterManagementUIState, public TargetFilterHeader(final UIEventBus eventBus, final FilterManagementUIState filterManagementUIState,
final SpPermissionChecker permissionChecker) { final SpPermissionChecker permissionChecker, final VaadinMessageSource i18n) {
this.eventBus = eventBus; this.eventBus = eventBus;
this.filterManagementUIState = filterManagementUIState; this.filterManagementUIState = filterManagementUIState;
this.permissionChecker = permissionChecker; this.permissionChecker = permissionChecker;
this.i18n = i18n;
createComponents(); createComponents();
buildLayout(); buildLayout();
@@ -108,10 +115,12 @@ public class TargetFilterHeader extends VerticalLayout {
} }
private Button createAddButton() { private Button createAddButton() {
final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.TARGET_FILTER_ADD_ICON_ID, "", "", final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.TARGET_FILTER_ADD_ICON_ID, "",
null, false, FontAwesome.PLUS, SPUIButtonStyleNoBorder.class); i18n.getMessage(UIMessageIdProvider.TOOLTIP_ADD), null, false, FontAwesome.PLUS,
SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> addNewFilter()); button.addClickListener(event -> addNewFilter());
return button; return button;
} }
private void addNewFilter() { private void addNewFilter() {
@@ -136,10 +145,12 @@ public class TargetFilterHeader extends VerticalLayout {
private SPUIButton createSearchResetIcon() { private SPUIButton createSearchResetIcon() {
final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton( 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); SPUIButtonStyleNoBorder.class);
button.addClickListener(event -> onSearchResetClick()); button.addClickListener(event -> onSearchResetClick());
return button; return button;
} }
private void onSearchResetClick() { private void onSearchResetClick() {
@@ -157,6 +168,7 @@ public class TargetFilterHeader extends VerticalLayout {
searchResetIcon.addStyleName(SPUIDefinitions.FILTER_RESET_ICON); searchResetIcon.addStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.TIMES); searchResetIcon.toggleIcon(FontAwesome.TIMES);
searchResetIcon.setData(Boolean.TRUE); searchResetIcon.setData(Boolean.TRUE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_RESET));
searchField.removeStyleName(SPUIDefinitions.FILTER_BOX_HIDE); searchField.removeStyleName(SPUIDefinitions.FILTER_BOX_HIDE);
searchField.setVisible(true); searchField.setVisible(true);
searchField.focus(); searchField.focus();
@@ -168,6 +180,7 @@ public class TargetFilterHeader extends VerticalLayout {
searchResetIcon.removeStyleName(SPUIDefinitions.FILTER_RESET_ICON); searchResetIcon.removeStyleName(SPUIDefinitions.FILTER_RESET_ICON);
searchResetIcon.toggleIcon(FontAwesome.SEARCH); searchResetIcon.toggleIcon(FontAwesome.SEARCH);
searchResetIcon.setData(Boolean.FALSE); searchResetIcon.setData(Boolean.FALSE);
searchResetIcon.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH));
resetSearchText(); 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.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn; import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory; import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
@@ -187,8 +188,8 @@ public class TargetFilterTable extends Table {
/* Display the confirmation */ /* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog( final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.entity.delete.action.confirmbox"), i18n.getMessage("caption.entity.delete.action.confirmbox"),
i18n.getMessage("message.delete.filter.confirm"), i18n.getMessage(SPUIDefinitions.BUTTON_OK), i18n.getMessage("message.delete.filter.confirm"), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> { i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok) { if (ok) {
final Long rowId = (Long) ((Button) event.getComponent()).getData(); final Long rowId = (Long) ((Button) event.getComponent()).getData();
final String deletedFilterName = targetFilterQueryManagement.get(rowId).get().getName(); 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.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -304,7 +305,8 @@ public class ActionHistoryGrid extends AbstractGrid<LazyQueryContainer> {
/* Display the confirmation */ /* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog( final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.force.action.confirmbox"), i18n.getMessage("message.force.action.confirm"), 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) { if (!ok) {
return; return;
} }
@@ -327,8 +329,8 @@ public class ActionHistoryGrid extends AbstractGrid<LazyQueryContainer> {
/* Display the confirmation */ /* Display the confirmation */
final ConfirmationDialog confirmDialog = new ConfirmationDialog( final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.forcequit.action.confirmbox"), i18n.getMessage("caption.forcequit.action.confirmbox"),
i18n.getMessage("message.forcequit.action.confirm"), i18n.getMessage(SPUIDefinitions.BUTTON_OK), i18n.getMessage("message.forcequit.action.confirm"), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
i18n.getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> { i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (!ok) { if (!ok) {
return; return;
} }
@@ -358,7 +360,8 @@ public class ActionHistoryGrid extends AbstractGrid<LazyQueryContainer> {
final ConfirmationDialog confirmDialog = new ConfirmationDialog( final ConfirmationDialog confirmDialog = new ConfirmationDialog(
i18n.getMessage("caption.cancel.action.confirmbox"), i18n.getMessage("message.cancel.action.confirm"), 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) { if (!ok) {
return; 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.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UINotification; import org.eclipse.hawkbit.ui.utils.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.springframework.util.StringUtils;
import org.vaadin.spring.events.EventBus.UIEventBus; import org.vaadin.spring.events.EventBus.UIEventBus;
import org.vaadin.spring.events.EventScope; import org.vaadin.spring.events.EventScope;
import org.vaadin.spring.events.annotation.EventBusListenerMethod; import org.vaadin.spring.events.annotation.EventBusListenerMethod;
@@ -43,6 +44,8 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
private transient AbstractGrid<?>.DetailsSupport details; private transient AbstractGrid<?>.DetailsSupport details;
private Long masterForDetails; private Long masterForDetails;
private final String actionHistoryCaption;
/** /**
* Constructor. * Constructor.
* *
@@ -58,9 +61,25 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
this.deploymentManagement = deploymentManagement; this.deploymentManagement = deploymentManagement;
this.notification = notification; this.notification = notification;
this.managementUIState = managementUIState; this.managementUIState = managementUIState;
actionHistoryCaption = getActionHistoryCaption();
init(); 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 @Override
public ActionHistoryHeader createGridHeader() { public ActionHistoryHeader createGridHeader() {
return new ActionHistoryHeader(managementUIState).init(); return new ActionHistoryHeader(managementUIState).init();
@@ -68,7 +87,7 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
@Override @Override
public ActionHistoryGrid createGrid() { public ActionHistoryGrid createGrid() {
return new ActionHistoryGrid(i18n, deploymentManagement, eventBus, notification, managementUIState); return new ActionHistoryGrid(getI18n(), deploymentManagement, getEventBus(), notification, managementUIState);
} }
@EventBusListenerMethod(scope = EventScope.UI) @EventBusListenerMethod(scope = EventScope.UI)
@@ -138,7 +157,7 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
* @param managementUIState * @param managementUIState
*/ */
ActionHistoryHeader(final ManagementUIState managementUIState) { ActionHistoryHeader(final ManagementUIState managementUIState) {
super(managementUIState); super(managementUIState, actionHistoryCaption, getI18n());
this.setHeaderMaximizeSupport( this.setHeaderMaximizeSupport(
new ActionHistoryHeaderMaxSupport(this, SPUIDefinitions.EXPAND_ACTION_HISTORY)); new ActionHistoryHeaderMaxSupport(this, SPUIDefinitions.EXPAND_ACTION_HISTORY));
} }
@@ -160,7 +179,7 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
* name of the target * name of the target
*/ */
public void updateActionHistoryHeader(final String targetName) { public void updateActionHistoryHeader(final String targetName) {
updateTitle(HawkbitCommonUtil.getActionHistoryLabelId(targetName)); updateTitle(getActionHistoryCaption(targetName));
} }
/** /**
@@ -195,12 +214,12 @@ public class ActionHistoryLayout extends AbstractGridComponentLayout {
@Override @Override
protected void maximize() { protected void maximize() {
details.populateMasterDataAndRecreateContainer(masterForDetails); details.populateMasterDataAndRecreateContainer(masterForDetails);
eventBus.publish(this, ManagementUIEvent.MAX_ACTION_HISTORY); getEventBus().publish(this, ManagementUIEvent.MAX_ACTION_HISTORY);
} }
@Override @Override
protected void minimize() { 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; return abstractGridHeader;
} }
} }
} }

View File

@@ -43,12 +43,12 @@ public class ActionStatusLayout extends AbstractGridComponentLayout {
@Override @Override
public DefaultGridHeader createGridHeader() { public DefaultGridHeader createGridHeader() {
return new DefaultGridHeader(managementUIState, "Action States").init(); return new DefaultGridHeader(managementUIState, "Action States", getI18n()).init();
} }
@Override @Override
public ActionStatusGrid createGrid() { 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 @Override
public DefaultGridHeader createGridHeader() { public DefaultGridHeader createGridHeader() {
return new DefaultGridHeader(managementUIState, "Messages").init(); return new DefaultGridHeader(managementUIState, "Messages", getI18n()).init();
} }
@Override @Override
public ActionStatusMsgGrid createGrid() { 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.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn; import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.eclipse.hawkbit.ui.view.filter.OnlyEventsFromDeploymentViewFilter; import org.eclipse.hawkbit.ui.view.filter.OnlyEventsFromDeploymentViewFilter;
@@ -467,8 +468,8 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
private void createConfirmationWindowForAssignment(final String confirmQuestion) { private void createConfirmationWindowForAssignment(final String confirmQuestion) {
confirmDialog = new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX), confirmDialog = new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX),
confirmQuestion, getI18n().getMessage(SPUIDefinitions.BUTTON_OK), confirmQuestion, getI18n().getMessage(UIMessageIdProvider.BUTTON_OK),
getI18n().getMessage(SPUIDefinitions.BUTTON_CANCEL), ok -> { getI18n().getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok && isMaintenanceWindowValid()) { if (ok && isMaintenanceWindowValid()) {
saveAllAssignments(); saveAllAssignments();
} else { } else {
@@ -832,6 +833,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
pinBtn.setData(distributionSetIdName); pinBtn.setData(distributionSetIdName);
pinBtn.setId(getPinButtonId(name, version)); pinBtn.setId(getPinButtonId(name, version));
pinBtn.setImmediate(true); pinBtn.setImmediate(true);
pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_DISTRIBUTION_SET_PIN));
return pinBtn; 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.HawkbitCommonUtil;
import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil; import org.eclipse.hawkbit.ui.utils.SPDateTimeUtil;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroup; import org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroup;
import org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroupItemComponent; import org.vaadin.hene.flexibleoptiongroup.FlexibleOptionGroupItemComponent;
@@ -92,7 +93,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
forceLabel.setStyleName("statusIconPending"); forceLabel.setStyleName("statusIconPending");
forceLabel.setIcon(FontAwesome.BOLT); forceLabel.setIcon(FontAwesome.BOLT);
forceLabel.setCaption("Forced"); forceLabel.setCaption("Forced");
forceLabel.setDescription(i18n.getMessage("tooltip.forced.item")); forceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_FORCED_ITEM));
forceLabel.setStyleName("padding-right-style"); forceLabel.setStyleName("padding-right-style");
addComponent(forceLabel); addComponent(forceLabel);
@@ -103,7 +104,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
final Label softLabel = new Label(); final Label softLabel = new Label();
softLabel.setSizeFull(); softLabel.setSizeFull();
softLabel.setCaption("Soft"); softLabel.setCaption("Soft");
softLabel.setDescription(i18n.getMessage("tooltip.soft.item")); softLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SOFT_ITEM));
softLabel.setStyleName("padding-right-style"); softLabel.setStyleName("padding-right-style");
addComponent(softLabel); addComponent(softLabel);
@@ -116,7 +117,7 @@ public class ActionTypeOptionGroupLayout extends HorizontalLayout {
autoForceLabel.setStyleName("statusIconPending"); autoForceLabel.setStyleName("statusIconPending");
autoForceLabel.setIcon(FontAwesome.HISTORY); autoForceLabel.setIcon(FontAwesome.HISTORY);
autoForceLabel.setCaption("Time Forced"); 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); autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
addComponent(autoForceLabel); 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.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.TableColumn; import org.eclipse.hawkbit.ui.utils.TableColumn;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -402,10 +403,12 @@ public class TargetTable extends AbstractTable<Target> {
.getItemProperty(SPUILabelDefinitions.VAR_POLL_STATUS_TOOL_TIP).getValue(); .getItemProperty(SPUILabelDefinitions.VAR_POLL_STATUS_TOOL_TIP).getValue();
if (StringUtils.hasText(pollStatusToolTip)) { if (StringUtils.hasText(pollStatusToolTip)) {
statusLabel.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml()); statusLabel.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
statusLabel.setDescription(pollStatusToolTip);
} else { } else {
statusLabel.setValue(FontAwesome.CLOCK_O.getHtml()); statusLabel.setValue(FontAwesome.CLOCK_O.getHtml());
statusLabel.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_IN_TIME));
} }
statusLabel.setDescription(pollStatusToolTip);
return statusLabel; return statusLabel;
} }
@@ -424,6 +427,7 @@ public class TargetTable extends AbstractTable<Target> {
pinBtn.setData(pinnedTarget); pinBtn.setData(pinnedTarget);
pinBtn.setId(UIComponentIdProvider.TARGET_PIN_ICON + controllerId); pinBtn.setId(UIComponentIdProvider.TARGET_PIN_ICON + controllerId);
pinBtn.addClickListener(this::addPinClickListener); pinBtn.addClickListener(this::addPinClickListener);
pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_TARGET_PIN));
if (isPinned(pinnedTarget)) { if (isPinned(pinnedTarget)) {
pinBtn.addStyleName(TARGET_PINNED); pinBtn.addStyleName(TARGET_PINNED);
targetPinned = Boolean.TRUE; targetPinned = Boolean.TRUE;
@@ -980,8 +984,8 @@ public class TargetTable extends AbstractTable<Target> {
private void openConfirmationWindowForAssignment(final String distributionNameToAssign, final String targetName) { private void openConfirmationWindowForAssignment(final String distributionNameToAssign, final String targetName) {
confirmDialog = new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX), confirmDialog = new ConfirmationDialog(getI18n().getMessage(CAPTION_ENTITY_ASSIGN_ACTION_CONFIRMBOX),
getI18n().getMessage(MESSAGE_CONFIRM_ASSIGN_ENTITY, distributionNameToAssign, "target", targetName), getI18n().getMessage(MESSAGE_CONFIRM_ASSIGN_ENTITY, distributionNameToAssign, "target", targetName),
getI18n().getMessage(SPUIDefinitions.BUTTON_OK), getI18n().getMessage(SPUIDefinitions.BUTTON_CANCEL), getI18n().getMessage(UIMessageIdProvider.BUTTON_OK),
ok -> { getI18n().getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
if (ok && isMaintenanceWindowValid()) { if (ok && isMaintenanceWindowValid()) {
saveAllAssignments(); saveAllAssignments();
} else { } 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.management.state.ManagementUIState;
import org.eclipse.hawkbit.ui.utils.SPUIDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
import org.eclipse.hawkbit.ui.utils.UIMessageIdProvider;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.spring.events.EventBus; import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventBus.UIEventBus; import org.vaadin.spring.events.EventBus.UIEventBus;
@@ -36,7 +37,8 @@ import com.vaadin.ui.VerticalLayout;
* *
*/ */
public class FilterByStatusLayout extends VerticalLayout implements Button.ClickListener { public class FilterByStatusLayout extends VerticalLayout implements Button.ClickListener {
private static final long serialVersionUID = -6930348859189929850L;
private static final long serialVersionUID = 1L;
private final VaadinMessageSource i18n; private final VaadinMessageSource i18n;
@@ -61,7 +63,8 @@ public class FilterByStatusLayout extends VerticalLayout implements Button.Click
private Button buttonClicked; private Button buttonClicked;
private static final String BTN_CLICKED = "btnClicked"; 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.i18n = i18n;
this.eventBus = eventBus; this.eventBus = eventBus;
this.managementUIState = managementUIState; this.managementUIState = managementUIState;
@@ -83,7 +86,8 @@ public class FilterByStatusLayout extends VerticalLayout implements Button.Click
addStyleName("target-status-filters"); addStyleName("target-status-filters");
setMargin(false); 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"); targetFilterStatusLabel.addStyleName("target-status-filters-title");
@@ -149,23 +153,25 @@ public class FilterByStatusLayout extends VerticalLayout implements Button.Click
*/ */
private void getTargetFilterStatuses() { private void getTargetFilterStatuses() {
unknown = SPUIComponentProvider.getButton(UIComponentIdProvider.UNKNOWN_STATUS_ICON, 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); SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
inSync = SPUIComponentProvider.getButton(UIComponentIdProvider.INSYNCH_STATUS_ICON, 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); SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
pending = SPUIComponentProvider.getButton(UIComponentIdProvider.PENDING_STATUS_ICON, 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); SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
error = SPUIComponentProvider.getButton(UIComponentIdProvider.ERROR_STATUS_ICON, 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); SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
registered = SPUIComponentProvider.getButton(UIComponentIdProvider.REGISTERED_STATUS_ICON, registered = SPUIComponentProvider.getButton(UIComponentIdProvider.REGISTERED_STATUS_ICON,
TargetUpdateStatus.REGISTERED.toString(), i18n.getMessage("tooltip.status.registered"), TargetUpdateStatus.REGISTERED.toString(),
SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class); 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, overdue = SPUIComponentProvider.getButton(UIComponentIdProvider.OVERDUE_STATUS_ICON, OVERDUE_CAPTION,
i18n.getMessage("tooltip.status.overdue"), SPUIDefinitions.SP_BUTTON_STATUS_STYLE, false, FontAwesome.SQUARE, i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_OVERDUE), SPUIDefinitions.SP_BUTTON_STATUS_STYLE,
SPUIButtonStyleSmall.class); false, FontAwesome.SQUARE, SPUIButtonStyleSmall.class);
applyStatusBtnStyle(); applyStatusBtnStyle();
unknown.setData("filterStatusOne"); unknown.setData("filterStatusOne");
inSync.setData("filterStatusTwo"); inSync.setData("filterStatusTwo");

View File

@@ -107,7 +107,7 @@ public class MultipleTargetFilter extends Accordion implements SelectedTabChange
targetFilterQueryButtonsTab.init(customTargetTagFilterButtonClick); targetFilterQueryButtonsTab.init(customTargetTagFilterButtonClick);
menu = new ConfigMenuBar(permChecker.hasCreateTargetPermission(), permChecker.hasUpdateTargetPermission(), menu = new ConfigMenuBar(permChecker.hasCreateTargetPermission(), permChecker.hasUpdateTargetPermission(),
permChecker.hasDeleteRepositoryPermission(), getAddButtonCommand(), getUpdateButtonCommand(), permChecker.hasDeleteRepositoryPermission(), getAddButtonCommand(), getUpdateButtonCommand(),
getDeleteButtonCommand(), UIComponentIdProvider.TARGET_MENU_BAR_ID); getDeleteButtonCommand(), UIComponentIdProvider.TARGET_MENU_BAR_ID, i18n);
menu.addStyleName("targetTag"); menu.addStyleName("targetTag");
addStyleName(ValoTheme.ACCORDION_BORDERLESS); addStyleName(ValoTheme.ACCORDION_BORDERLESS);
addTabs(); 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.SPUILabelDefinitions;
import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions; import org.eclipse.hawkbit.ui.utils.SPUIStyleDefinitions;
import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider; 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.UINotification;
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource; import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory; import org.vaadin.addons.lazyquerycontainer.BeanQueryFactory;
@@ -584,7 +585,8 @@ public class RolloutListGrid extends AbstractGrid<LazyQueryContainer> {
final String formattedConfirmationQuestion = getConfirmationQuestion(rollout.get()); final String formattedConfirmationQuestion = getConfirmationQuestion(rollout.get());
final ConfirmationDialog confirmationDialog = new ConfirmationDialog( final ConfirmationDialog confirmationDialog = new ConfirmationDialog(
i18n.getMessage("caption.entity.delete.action.confirmbox"), formattedConfirmationQuestion, 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) { if (!ok) {
return; return;
} }
@@ -637,37 +639,38 @@ public class RolloutListGrid extends AbstractGrid<LazyQueryContainer> {
private StatusFontIcon createApprovalButtonMetadata(final RolloutStatus rolloutStatus) { private StatusFontIcon createApprovalButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, APPROVE_BUTTON_ENABLED); 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); UIComponentIdProvider.ROLLOUT_APPROVAL_BUTTON_ID, isDisabled);
} }
private StatusFontIcon createRunButtonMetadata(final RolloutStatus rolloutStatus) { private StatusFontIcon createRunButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, RUN_BUTTON_ENABLED); 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); UIComponentIdProvider.ROLLOUT_RUN_BUTTON_ID, isDisabled);
} }
private StatusFontIcon createPauseButtonMetadata(final RolloutStatus rolloutStatus) { private StatusFontIcon createPauseButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, PAUSE_BUTTON_ENABLED); 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); UIComponentIdProvider.ROLLOUT_PAUSE_BUTTON_ID, isDisabled);
} }
private StatusFontIcon createCopyButtonMetadata(final RolloutStatus rolloutStatus) { private StatusFontIcon createCopyButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, DELETE_COPY_BUTTON_ENABLED); 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); UIComponentIdProvider.ROLLOUT_COPY_BUTTON_ID, isDisabled);
} }
private StatusFontIcon createUpdateButtonMetadata(final RolloutStatus rolloutStatus) { private StatusFontIcon createUpdateButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, UPDATE_BUTTON_ENABLED); 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); UIComponentIdProvider.ROLLOUT_UPDATE_BUTTON_ID, isDisabled);
} }
private StatusFontIcon createDeleteButtonMetadata(final RolloutStatus rolloutStatus) { private StatusFontIcon createDeleteButtonMetadata(final RolloutStatus rolloutStatus) {
final boolean isDisabled = hasToBeDisabled(rolloutStatus, DELETE_COPY_BUTTON_ENABLED); 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); UIComponentIdProvider.ROLLOUT_DELETE_BUTTON_ID, isDisabled);
} }

View File

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

View File

@@ -59,12 +59,13 @@ public class RolloutGroupsListView extends AbstractGridComponentLayout {
@Override @Override
public RolloutGroupsListHeader createGridHeader() { public RolloutGroupsListHeader createGridHeader() {
return new RolloutGroupsListHeader(eventBus, rolloutUIState, i18n); return new RolloutGroupsListHeader(getEventBus(), rolloutUIState, getI18n());
} }
@Override @Override
public AbstractGrid<LazyQueryContainer> createGrid() { 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, rolloutNameLink = SPUIComponentProvider.getButton(null, "", "", null, false, null,
SPUIButtonStyleNoBorder.class); SPUIButtonStyleNoBorder.class);
rolloutNameLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links"); 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()); rolloutNameLink.addClickListener(value -> showRolloutGroupListView());
final HorizontalLayout headerCaptionLayout = new HorizontalLayout(); final HorizontalLayout headerCaptionLayout = new HorizontalLayout();

View File

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

View File

@@ -165,18 +165,6 @@ public final class HawkbitCommonUtil {
.append(DIV_DESCRIPTION_END).toString(); .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. * 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 NO_TAG = "NO TAG";
public static final String BUTTON_CANCEL = "button.cancel";
public static final String BUTTON_OK = "button.ok";
/** /**
* /** Constructor. * /** Constructor.
*/ */

View File

@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.ui.utils;
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties.TenantConfigurationKey; 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 { public final class UIComponentIdProvider {
/** /**
@@ -1214,7 +1214,7 @@ public final class UIComponentIdProvider {
/** /**
* ID for the menu bar item to update a tag or type * 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 * 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 = Target Filters
dashboard.filters.caption-long = Target Filter Management dashboard.filters.caption-long = Target Filter Management
dashboard.deployment.caption = Deployment dashboard.deployment.caption = Deployment
dashboard.deployment.caption-long Deployment Management dashboard.deployment.caption-long = Deployment Management
dashboard.rollouts.caption = Rollout dashboard.rollouts.caption = Rollout
dashboard.rollouts.caption-long = Rollout Management 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 distribution.set.tag.updated.event.container.notifcation.message=distribution set tags changed
# Captions prefix with - caption # 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.error = Error
caption.new.softwaremodule.application = Configure New Application caption.new.softwaremodule.application = Configure New Application
caption.new.softwaremodule.jvm = Configure New Runtime caption.new.softwaremodule.jvm = Configure New Runtime
@@ -114,7 +115,7 @@ caption.software.module = Software Module
caption.rollout = Rollout caption.rollout = Rollout
caption.create.new = Create new {0} 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.select.auto.assign.dist = Select auto assignment distribution set
caption.bulk.upload.targets = Bulk Upload caption.bulk.upload.targets = Bulk Upload
@@ -171,9 +172,9 @@ label.mandatory.field = * Mandatory Field
label.components.drop.area = Drop here to delete label.components.drop.area = Drop here to delete
label.software.module.drop.area = Delete Software label.software.module.drop.area = Delete Software
label.create.tag = Create Tag label.create.tag = Create Tag
label.update.tag = Update Tag label.update.tag = Edit Tag
label.create.type = Create Type label.create.type = Create Type
label.update.type = Update Type label.update.type = Edit Type
label.singleAssign.type = Firmware (FW) label.singleAssign.type = Firmware (FW)
label.multiAssign.type = Software (SW) label.multiAssign.type = Software (SW)
label.choose.type.color = Type Color 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.check.for.mandatory=Check to make Mandatory
tooltip.artifact.icon=Show Artifact Details tooltip.artifact.icon=Show Artifact Details
tooltip.click.to.edit = Click to edit tooltip.click.to.edit = Click to edit
tooltip.metadata.icon = Manage Metadata tooltip.metadata.icon = Manage Metadata..
tooltip.next.maintenancewindow = next on {0} tooltip.next.maintenance.window = next on {0}
#rollout action #rollout action
tooltip.rollout.run = Run tooltip.rollout.run = Run
tooltip.rollout.approve = Approve tooltip.rollout.approve = Approve
tooltip.rollout.pause = Pause tooltip.rollout.pause = Pause
tooltip.rollout.update = Update.. tooltip.rollout.update = Edit..
tooltip.rollout.copy = Copy.. 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 # Notification messages prefix with - message
message.save.success = {0} saved successfully message.save.success = {0} saved successfully
@@ -512,7 +529,7 @@ header.assigned.ds = Assigned DS
header.installed.ds = Installed DS header.installed.ds = Installed DS
header.target.status = Status header.target.status = Status
header.target.tags = Tags header.target.tags = Tags
header.total.targets = Targets header.total.targets = Targets
header.key = Key header.key = Key
header.value = Value header.value = Value
metadata.targetvisible = Visible for targets 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. 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 caption.entity.delete.action.confirmbox = Confirm Deletion
message.confirm.delete.entity = Are you sure you want to delete {0} {1}{2}? message.confirm.delete.entity = Are you sure you want to delete {0} {1}{2}?
caption.entity.assign.action.confirmbox = Confirm Assignment caption.entity.assign.action.confirmbox = Confirm Assignment