Merge branch 'master' into feature_ui_metadata
Conflicts: hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/CommonDialogWindow.java hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss
This commit is contained in:
@@ -21,7 +21,7 @@ import org.eclipse.hawkbit.repository.model.MetaData;
|
|||||||
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.customrenderers.renderers.HtmlButtonRenderer;
|
import org.eclipse.hawkbit.ui.customrenderers.renderers.HtmlButtonRenderer;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleBorderWithIcon;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorderWithIcon;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIWindowDecorator;
|
import org.eclipse.hawkbit.ui.decorators.SPUIWindowDecorator;
|
||||||
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil;
|
||||||
@@ -510,7 +510,7 @@ public abstract class AbstractMetadataPopupLayout<E extends NamedVersionedEntity
|
|||||||
|
|
||||||
private Button createDiscardButton() {
|
private Button createDiscardButton() {
|
||||||
final Button discardButton = SPUIComponentProvider.getButton(SPUIComponentIdProvider.CANCEL_BUTTON,
|
final Button discardButton = SPUIComponentProvider.getButton(SPUIComponentIdProvider.CANCEL_BUTTON,
|
||||||
i18n.get("button.discard"), "", "", true, FontAwesome.UNDO, SPUIButtonStyleBorderWithIcon.class);
|
i18n.get("button.discard"), "", "", true, FontAwesome.UNDO, SPUIButtonStyleNoBorderWithIcon.class);
|
||||||
discardButton.setSizeUndefined();
|
discardButton.setSizeUndefined();
|
||||||
discardButton.addStyleName("default-color");
|
discardButton.addStyleName("default-color");
|
||||||
discardButton.addClickListener(event -> onDiscard());
|
discardButton.addClickListener(event -> onDiscard());
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleAddUpdateWindow;
|
import org.eclipse.hawkbit.ui.artifacts.smtable.SoftwareModuleAddUpdateWindow;
|
||||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||||
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleBorderWithIcon;
|
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorderWithIcon;
|
||||||
import org.eclipse.hawkbit.ui.layouts.AbstractCreateUpdateTagLayout;
|
import org.eclipse.hawkbit.ui.layouts.AbstractCreateUpdateTagLayout;
|
||||||
import org.eclipse.hawkbit.ui.management.targettable.TargetAddUpdateWindowLayout;
|
import org.eclipse.hawkbit.ui.management.targettable.TargetAddUpdateWindowLayout;
|
||||||
import org.eclipse.hawkbit.ui.utils.I18N;
|
import org.eclipse.hawkbit.ui.utils.I18N;
|
||||||
@@ -232,7 +232,6 @@ public class CommonDialogWindow extends Window implements Serializable {
|
|||||||
addCloseListenerForCancelButton();
|
addCloseListenerForCancelButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void addCloseListenerForSaveButton() {
|
protected void addCloseListenerForSaveButton() {
|
||||||
saveButton.addClickListener(close);
|
saveButton.addClickListener(close);
|
||||||
}
|
}
|
||||||
@@ -390,13 +389,14 @@ public class CommonDialogWindow extends Window implements Serializable {
|
|||||||
private HorizontalLayout createActionButtonsLayout() {
|
private HorizontalLayout createActionButtonsLayout() {
|
||||||
|
|
||||||
buttonsLayout = new HorizontalLayout();
|
buttonsLayout = new HorizontalLayout();
|
||||||
buttonsLayout.setSizeUndefined();
|
buttonsLayout.setSizeFull();
|
||||||
|
buttonsLayout.setSpacing(true);
|
||||||
buttonsLayout.setSpacing(true);
|
buttonsLayout.setSpacing(true);
|
||||||
createSaveButton();
|
|
||||||
|
|
||||||
createCancelButton();
|
|
||||||
buttonsLayout.addStyleName("actionButtonsMargin");
|
buttonsLayout.addStyleName("actionButtonsMargin");
|
||||||
|
|
||||||
|
createSaveButton();
|
||||||
|
createCancelButton();
|
||||||
|
|
||||||
addHelpLink();
|
addHelpLink();
|
||||||
|
|
||||||
return buttonsLayout;
|
return buttonsLayout;
|
||||||
@@ -424,7 +424,7 @@ public class CommonDialogWindow extends Window implements Serializable {
|
|||||||
|
|
||||||
private void createCancelButton() {
|
private void createCancelButton() {
|
||||||
cancelButton = SPUIComponentProvider.getButton(SPUIComponentIdProvider.CANCEL_BUTTON, "Cancel", "", "", true,
|
cancelButton = SPUIComponentProvider.getButton(SPUIComponentIdProvider.CANCEL_BUTTON, "Cancel", "", "", true,
|
||||||
FontAwesome.TIMES, SPUIButtonStyleBorderWithIcon.class);
|
FontAwesome.TIMES, SPUIButtonStyleNoBorderWithIcon.class);
|
||||||
cancelButton.setSizeUndefined();
|
cancelButton.setSizeUndefined();
|
||||||
cancelButton.addStyleName("default-color");
|
cancelButton.addStyleName("default-color");
|
||||||
if (cancelButtonClickListener != null) {
|
if (cancelButtonClickListener != null) {
|
||||||
@@ -438,7 +438,7 @@ public class CommonDialogWindow extends Window implements Serializable {
|
|||||||
|
|
||||||
private void createSaveButton() {
|
private void createSaveButton() {
|
||||||
saveButton = SPUIComponentProvider.getButton(SPUIComponentIdProvider.SAVE_BUTTON, "Save", "", "", true,
|
saveButton = SPUIComponentProvider.getButton(SPUIComponentIdProvider.SAVE_BUTTON, "Save", "", "", true,
|
||||||
FontAwesome.SAVE, SPUIButtonStyleBorderWithIcon.class);
|
FontAwesome.SAVE, SPUIButtonStyleNoBorderWithIcon.class);
|
||||||
saveButton.setSizeUndefined();
|
saveButton.setSizeUndefined();
|
||||||
saveButton.addStyleName("default-color");
|
saveButton.addStyleName("default-color");
|
||||||
saveButton.addClickListener(saveButtonClickListener);
|
saveButton.addClickListener(saveButtonClickListener);
|
||||||
@@ -458,12 +458,10 @@ public class CommonDialogWindow extends Window implements Serializable {
|
|||||||
buttonsLayout.setComponentAlignment(helpLinkComponent, Alignment.MIDDLE_RIGHT);
|
buttonsLayout.setComponentAlignment(helpLinkComponent, Alignment.MIDDLE_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public AbstractComponent getButtonsLayout() {
|
public AbstractComponent getButtonsLayout() {
|
||||||
return this.buttonsLayout;
|
return this.buttonsLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private class ChangeListener implements ValueChangeListener, TextChangeListener, ItemSetChangeListener {
|
private class ChangeListener implements ValueChangeListener, TextChangeListener, ItemSetChangeListener {
|
||||||
|
|
||||||
private final Field<?> field;
|
private final Field<?> field;
|
||||||
@@ -494,8 +492,6 @@ public class CommonDialogWindow extends Window implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the component manually to the allComponents-List and adds a
|
* Adds the component manually to the allComponents-List and adds a
|
||||||
* ValueChangeListener to it. Necessary in Update Distribution Type as the
|
* ValueChangeListener to it. Necessary in Update Distribution Type as the
|
||||||
@@ -521,6 +517,4 @@ public class CommonDialogWindow extends Window implements Serializable {
|
|||||||
public void setCancelButtonEnabled(final boolean enabled) {
|
public void setCancelButtonEnabled(final boolean enabled) {
|
||||||
cancelButton.setEnabled(enabled);
|
cancelButton.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,15 +8,16 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ui.decorators;
|
package org.eclipse.hawkbit.ui.decorators;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.vaadin.server.Resource;
|
import com.vaadin.server.Resource;
|
||||||
import com.vaadin.ui.Button;
|
import com.vaadin.ui.Button;
|
||||||
import com.vaadin.ui.themes.ValoTheme;
|
import com.vaadin.ui.themes.ValoTheme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Button with icon decorator.
|
* Decorator class for a borderless Button with an icon.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class SPUIButtonStyleBorderWithIcon implements SPUIButtonDecorator {
|
public class SPUIButtonStyleNoBorderWithIcon implements SPUIButtonDecorator {
|
||||||
|
|
||||||
private Button button;
|
private Button button;
|
||||||
|
|
||||||
@@ -24,23 +25,25 @@ public class SPUIButtonStyleBorderWithIcon implements SPUIButtonDecorator {
|
|||||||
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
|
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
|
||||||
|
|
||||||
this.button = button;
|
this.button = button;
|
||||||
|
button.setSizeFull();
|
||||||
setButtonStyle(style, setStyle);
|
|
||||||
setButtonIcon(icon);
|
|
||||||
|
|
||||||
button.addStyleName(ValoTheme.LABEL_SMALL);
|
button.addStyleName(ValoTheme.LABEL_SMALL);
|
||||||
button.setSizeFull();
|
button.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
|
||||||
|
setOrAddButtonStyle(style, setStyle);
|
||||||
|
|
||||||
|
setButtonIcon(icon);
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setButtonStyle(final String style, final boolean setStyle) {
|
private void setOrAddButtonStyle(final String style, final boolean setStyle) {
|
||||||
|
|
||||||
if (style == null) {
|
if (StringUtils.isEmpty(style)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setStyle) {
|
if (setStyle) {
|
||||||
|
// overwrite all other styles
|
||||||
button.setStyleName(style);
|
button.setStyleName(style);
|
||||||
} else {
|
} else {
|
||||||
button.addStyleName(style);
|
button.addStyleName(style);
|
||||||
@@ -293,8 +293,4 @@
|
|||||||
padding-bottom: 12px !important;
|
padding-bottom: 12px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.v-button-default-color {
|
|
||||||
color: #551f62;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,4 +60,5 @@
|
|||||||
.metadata-table-margin {
|
.metadata-table-margin {
|
||||||
margin-top:3px;
|
margin-top:3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,5 +164,6 @@
|
|||||||
|
|
||||||
.actionButtonsMargin {
|
.actionButtonsMargin {
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user