Create a parent class for all dialogs

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Melanie Retter
2016-05-11 16:28:16 +02:00
parent 6404c9ba82
commit 589c60cedf
23 changed files with 354 additions and 209 deletions

View File

@@ -133,22 +133,24 @@ public class SoftwareModuleAddUpdateWindow implements Serializable {
private void createRequiredComponents() { private void createRequiredComponents() {
/* name textfield */ /* name textfield */
nameTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, true, null, nameTextField = SPUIComponentProvider.getTextField(i18n.get("textfield.name"), "", ValoTheme.TEXTFIELD_TINY,
i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); true, null, i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
nameTextField.setId(SPUIComponetIdProvider.SOFT_MODULE_NAME); nameTextField.setId(SPUIComponetIdProvider.SOFT_MODULE_NAME);
/* version text field */ /* version text field */
versionTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, true, null, versionTextField = SPUIComponentProvider.getTextField(i18n.get("textfield.version"), "",
i18n.get("textfield.version"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); ValoTheme.TEXTFIELD_TINY, true, null, i18n.get("textfield.version"), true,
SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
versionTextField.setId(SPUIComponetIdProvider.SOFT_MODULE_VERSION); versionTextField.setId(SPUIComponetIdProvider.SOFT_MODULE_VERSION);
/* Vendor text field */ /* Vendor text field */
vendorTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null, vendorTextField = SPUIComponentProvider.getTextField(i18n.get("textfield.vendor"), "", ValoTheme.TEXTFIELD_TINY,
i18n.get("textfield.vendor"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); false, null, i18n.get("textfield.vendor"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
vendorTextField.setId(SPUIComponetIdProvider.SOFT_MODULE_VENDOR); vendorTextField.setId(SPUIComponetIdProvider.SOFT_MODULE_VENDOR);
descTextArea = SPUIComponentProvider.getTextArea("text-area-style", ValoTheme.TEXTAREA_TINY, false, null, descTextArea = SPUIComponentProvider.getTextArea(i18n.get("textfield.description"), "text-area-style",
i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH); ValoTheme.TEXTAREA_TINY, false, null, i18n.get("textfield.description"),
SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
descTextArea.setId(SPUIComponetIdProvider.ADD_SW_MODULE_DESCRIPTION); descTextArea.setId(SPUIComponetIdProvider.ADD_SW_MODULE_DESCRIPTION);
addDescriptionTextChangeListener(); addDescriptionTextChangeListener();
addVendorTextChangeListener(); addVendorTextChangeListener();
@@ -158,8 +160,8 @@ public class SoftwareModuleAddUpdateWindow implements Serializable {
madatoryLabel.setStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR); madatoryLabel.setStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_ERROR);
madatoryLabel.addStyleName(ValoTheme.LABEL_SMALL); madatoryLabel.addStyleName(ValoTheme.LABEL_SMALL);
typeComboBox = SPUIComponentProvider.getComboBox("", "", null, null, false, null, typeComboBox = SPUIComponentProvider.getComboBox(i18n.get("upload.swmodule.type"), "", "", null, null, false,
i18n.get("upload.swmodule.type")); null, i18n.get("upload.swmodule.type"));
typeComboBox.setId(SPUIComponetIdProvider.SW_MODULE_TYPE); typeComboBox.setId(SPUIComponetIdProvider.SW_MODULE_TYPE);
typeComboBox.setStyleName(SPUIDefinitions.COMBO_BOX_SPECIFIC_STYLE + " " + ValoTheme.COMBOBOX_TINY); typeComboBox.setStyleName(SPUIDefinitions.COMBO_BOX_SPECIFIC_STYLE + " " + ValoTheme.COMBOBOX_TINY);
typeComboBox.setNewItemsAllowed(Boolean.FALSE); typeComboBox.setNewItemsAllowed(Boolean.FALSE);

View File

@@ -165,23 +165,26 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
colorLabel = SPUIComponentProvider.getLabel(i18n.get("label.choose.type.color"), null); colorLabel = SPUIComponentProvider.getLabel(i18n.get("label.choose.type.color"), null);
colorLabel.addStyleName(SPUIDefinitions.COLOR_LABEL_STYLE); colorLabel.addStyleName(SPUIDefinitions.COLOR_LABEL_STYLE);
typeName = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TYPE_NAME, typeName = SPUIComponentProvider.getTextField(i18n.get("textfield.name"), "",
true, "", i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TYPE_NAME, true, "", i18n.get("textfield.name"), true,
SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
typeName.setId(SPUIDefinitions.NEW_SOFTWARE_TYPE_NAME); typeName.setId(SPUIDefinitions.NEW_SOFTWARE_TYPE_NAME);
typeKey = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TYPE_KEY, typeKey = SPUIComponentProvider.getTextField(i18n.get("textfield.key"), "",
true, "", i18n.get("textfield.key"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TYPE_KEY, true, "", i18n.get("textfield.key"), true,
SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
typeKey.setId(SPUIDefinitions.NEW_SOFTWARE_TYPE_KEY); typeKey.setId(SPUIDefinitions.NEW_SOFTWARE_TYPE_KEY);
typeDesc = SPUIComponentProvider.getTextArea("", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TYPE_DESC, typeDesc = SPUIComponentProvider.getTextArea(i18n.get("textfield.description"), "",
false, "", i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH); ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TYPE_DESC, false, "",
i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
typeDesc.setId(SPUIDefinitions.NEW_SOFTWARE_TYPE_DESC); typeDesc.setId(SPUIDefinitions.NEW_SOFTWARE_TYPE_DESC);
typeDesc.setImmediate(true); typeDesc.setImmediate(true);
typeDesc.setNullRepresentation(""); typeDesc.setNullRepresentation("");
typeNameComboBox = SPUIComponentProvider.getComboBox("", "", null, null, false, "", typeNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.type"), "", "", null, null, false,
i18n.get("label.combobox.type")); "", i18n.get("label.combobox.type"));
typeNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE); typeNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE);
typeNameComboBox.setImmediate(true); typeNameComboBox.setImmediate(true);

View File

@@ -245,16 +245,16 @@ public class UploadConfirmationwindow implements Button.ClickListener {
deleteIcon.setData(itemId); deleteIcon.setData(itemId);
newItem.getItemProperty(ACTION).setValue(deleteIcon); newItem.getItemProperty(ACTION).setValue(deleteIcon);
final TextField sha1 = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null, null, final TextField sha1 = SPUIComponentProvider.getTextField(null, "", ValoTheme.TEXTFIELD_TINY, false, null,
true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); null, true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
sha1.setId(swNameVersion + "/" + customFile.getFileName() + "/sha1"); sha1.setId(swNameVersion + "/" + customFile.getFileName() + "/sha1");
final TextField md5 = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null, null, final TextField md5 = SPUIComponentProvider.getTextField(null, "", ValoTheme.TEXTFIELD_TINY, false, null,
true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); null, true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
md5.setId(swNameVersion + "/" + customFile.getFileName() + "/md5"); md5.setId(swNameVersion + "/" + customFile.getFileName() + "/md5");
final TextField customFileName = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, final TextField customFileName = SPUIComponentProvider.getTextField(null, "", ValoTheme.TEXTFIELD_TINY,
null, null, true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); false, null, null, true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
customFileName.setId(swNameVersion + "/" + customFile.getFileName() + "/customFileName"); customFileName.setId(swNameVersion + "/" + customFile.getFileName() + "/customFileName");
newItem.getItemProperty(SHA1_CHECKSUM).setValue(sha1); newItem.getItemProperty(SHA1_CHECKSUM).setValue(sha1);
newItem.getItemProperty(MD5_CHECKSUM).setValue(md5); newItem.getItemProperty(MD5_CHECKSUM).setValue(md5);
@@ -265,8 +265,8 @@ public class UploadConfirmationwindow implements Button.ClickListener {
private void addFileNameLayout(final Item newItem, final String baseSoftwareModuleNameVersion, private void addFileNameLayout(final Item newItem, final String baseSoftwareModuleNameVersion,
final String customFileName, final String itemId) { final String customFileName, final String itemId) {
final HorizontalLayout horizontalLayout = new HorizontalLayout(); final HorizontalLayout horizontalLayout = new HorizontalLayout();
final TextField fileNameTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, final TextField fileNameTextField = SPUIComponentProvider.getTextField(null, "", ValoTheme.TEXTFIELD_TINY,
null, null, true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); false, null, null, true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
fileNameTextField.setId(baseSoftwareModuleNameVersion + "/" + customFileName + "/customFileName"); fileNameTextField.setId(baseSoftwareModuleNameVersion + "/" + customFileName + "/customFileName");
fileNameTextField.setData(baseSoftwareModuleNameVersion + "/" + customFileName); fileNameTextField.setData(baseSoftwareModuleNameVersion + "/" + customFileName);
fileNameTextField.setValue(customFileName); fileNameTextField.setValue(customFileName);

View File

@@ -0,0 +1,101 @@
package org.eclipse.hawkbit.ui.common;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.utils.SPUIComponetIdProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.vaadin.server.FontAwesome;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Link;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
public class CommonDialog extends Window {
private static final long serialVersionUID = -1321949234316858703L;
private static final Logger LOGGER = LoggerFactory.getLogger(CommonDialog.class);
private final VerticalLayout mainLayout = new VerticalLayout();
private FormLayout formLayout = new FormLayout();
private Button saveButton;
private Button cancelButton;
public CommonDialog() {
mainLayout.addComponent(formLayout);
mainLayout.addComponent(createActionButtonsLayout());
setContent(mainLayout);
setResizable(false);
center();
}
public CommonDialog(final String title, final FormLayout form, final String helpLink) {
if (formLayout != null) {
formLayout = form;
}
formLayout.setSpacing(true);
formLayout.setMargin(true);
if (StringUtils.isNotEmpty(helpLink)) {
mainLayout.addComponent(createLinkToHelp(helpLink));
}
mainLayout.addComponent(formLayout);
mainLayout.addComponent(createActionButtonsLayout());
setCaption(title);
setContent(mainLayout);
setResizable(false);
center();
}
private HorizontalLayout createActionButtonsLayout() {
final HorizontalLayout hlayout = new HorizontalLayout();
hlayout.setSpacing(true);
saveButton = SPUIComponentProvider.getButton(SPUIComponetIdProvider.SYSTEM_CONFIGURATION_SAVE, "", "", "", true,
FontAwesome.SAVE, SPUIButtonStyleSmallNoBorder.class);
// saveButton.setDescription(i18n.get("configuration.savebutton.tooltip"));
hlayout.addComponent(saveButton);
cancelButton = SPUIComponentProvider.getButton(SPUIComponetIdProvider.SYSTEM_CONFIGURATION_CANCEL, "", "", "",
true, FontAwesome.UNDO, SPUIButtonStyleSmallNoBorder.class);
// cancelButton.setDescription(i18n.get("configuration.cancellbutton.tooltip"));
hlayout.addComponent(cancelButton);
return hlayout;
}
public void setSaveButtonClickListener(final ClickListener clickListener) {
saveButton.addClickListener(clickListener);
}
public void setCancelButtonClickListener(final ClickListener clickListener) {
cancelButton.addClickListener(clickListener);
}
private Link createLinkToHelp(final String link) {
return SPUIComponentProvider.getHelpLink(link);
}
public FormLayout getFormLayout() {
return formLayout;
}
public void setFormLayout(final FormLayout formLayout) {
this.formLayout = formLayout;
}
}

View File

@@ -102,7 +102,7 @@ public abstract class AbstractGridHeader extends VerticalLayout {
} }
private TextField createSearchField() { private TextField createSearchField() {
final TextField textField = SPUIComponentProvider.getTextField("filter-box", "text-style filter-box-hide", final TextField textField = SPUIComponentProvider.getTextField("", "filter-box", "text-style filter-box-hide",
false, "", "", false, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); false, "", "", false, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
textField.setId(getSearchBoxId()); textField.setId(getSearchBoxId());
textField.setWidth(100.0f, Unit.PERCENTAGE); textField.setWidth(100.0f, Unit.PERCENTAGE);

View File

@@ -54,7 +54,6 @@ public abstract class AbstractTableHeader extends VerticalLayout {
@Autowired @Autowired
protected transient EventBus.SessionEventBus eventbus; protected transient EventBus.SessionEventBus eventbus;
private Label headerCaption; private Label headerCaption;
private TextField searchField; private TextField searchField;
@@ -214,7 +213,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
} }
private TextField createSearchField() { private TextField createSearchField() {
final TextField textField = SPUIComponentProvider.getTextField("filter-box", "text-style filter-box-hide", final TextField textField = SPUIComponentProvider.getTextField("", "filter-box", "text-style filter-box-hide",
false, "", "", false, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); false, "", "", false, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
textField.setId(getSearchBoxId()); textField.setId(getSearchBoxId());
textField.setWidth(100.0f, Unit.PERCENTAGE); textField.setWidth(100.0f, Unit.PERCENTAGE);

View File

@@ -152,6 +152,8 @@ public final class SPUIComponentProvider {
/** /**
* Get Label UI component. * Get Label UI component.
* *
* @param caption
* set the caption of the textfield
* @param style * @param style
* set style * set style
* @param styleName * @param styleName
@@ -160,7 +162,7 @@ public final class SPUIComponentProvider {
* to set field as mandatory * to set field as mandatory
* @param data * @param data
* component data * component data
* @param promt * @param prompt
* prompt user for input * prompt user for input
* @param immediate * @param immediate
* set component's immediate mode specified mode * set component's immediate mode specified mode
@@ -168,9 +170,11 @@ public final class SPUIComponentProvider {
* maximum characters allowed * maximum characters allowed
* @return TextField text field * @return TextField text field
*/ */
public static TextField getTextField(final String style, final String styleName, final boolean required, public static TextField getTextField(final String caption, final String style, final String styleName,
final String data, final String promt, final boolean immediate, final int maxLengthAllowed) { final boolean required, final String data, final String prompt, final boolean immediate,
return SPUITextFieldDecorator.decorate(style, styleName, required, data, promt, immediate, maxLengthAllowed); final int maxLengthAllowed) {
return SPUITextFieldDecorator.decorate(caption, style, styleName, required, data, prompt, immediate,
maxLengthAllowed);
} }
/** /**
@@ -190,14 +194,16 @@ public final class SPUIComponentProvider {
* maximum characters allowed * maximum characters allowed
* @return TextArea text area * @return TextArea text area
*/ */
public static TextArea getTextArea(final String style, final String styleName, final boolean required, public static TextArea getTextArea(final String caption, final String style, final String styleName,
final String data, final String promt, final int maxLength) { final boolean required, final String data, final String promt, final int maxLength) {
return SPUITextAreaDecorator.decorate(style, styleName, required, data, promt, maxLength); return SPUITextAreaDecorator.decorate(caption, style, styleName, required, data, promt, maxLength);
} }
/** /**
* Get Label UI component. * Get Label UI component.
* *
* @param caption
* caption of the combo box
* @param height * @param height
* combo box height * combo box height
* @param width * @param width
@@ -214,9 +220,9 @@ public final class SPUIComponentProvider {
* input prompt * input prompt
* @return ComboBox * @return ComboBox
*/ */
public static ComboBox getComboBox(final String height, final String width, final String style, public static ComboBox getComboBox(final String caption, final String height, final String width,
final String styleName, final boolean required, final String data, final String promt) { final String style, final String styleName, final boolean required, final String data, final String promt) {
return SPUIComboBoxDecorator.decorate(height, width, style, styleName, required, data, promt); return SPUIComboBoxDecorator.decorate(caption, height, width, style, styleName, required, data, promt);
} }
/** /**

View File

@@ -8,6 +8,8 @@
*/ */
package org.eclipse.hawkbit.ui.decorators; package org.eclipse.hawkbit.ui.decorators;
import org.apache.commons.lang3.StringUtils;
import com.vaadin.ui.ComboBox; import com.vaadin.ui.ComboBox;
import com.vaadin.ui.themes.ValoTheme; import com.vaadin.ui.themes.ValoTheme;
@@ -29,6 +31,8 @@ public final class SPUIComboBoxDecorator {
/** /**
* Decorate. * Decorate.
* *
* @param caption
* caption of the combobox
* @param height * @param height
* as H * as H
* @param width * @param width
@@ -41,39 +45,42 @@ public final class SPUIComboBoxDecorator {
* as T|F * as T|F
* @param data * @param data
* as data * as data
* @param promt * @param prompt
* as promt * as promt
* @return ComboBox as comp * @return ComboBox as comp
*/ */
public static ComboBox decorate(final String height, final String width, final String style, final String styleName, public static ComboBox decorate(final String caption, final String height, final String width, final String style,
final boolean required, final String data, final String promt) { final String styleName, final boolean required, final String data, final String prompt) {
final ComboBox spUICombo = new ComboBox(); final ComboBox spUICombo = new ComboBox();
// Default settings // Default settings
spUICombo.setRequired(required); spUICombo.setRequired(required);
spUICombo.addStyleName(ValoTheme.COMBOBOX_TINY); spUICombo.addStyleName(ValoTheme.COMBOBOX_TINY);
if (StringUtils.isNotEmpty(caption)) {
spUICombo.setCaption(caption);
}
// Add style // Add style
if (null != style) { if (StringUtils.isNotEmpty(style)) {
spUICombo.setStyleName(style); spUICombo.setStyleName(style);
} }
// Add style Name // Add style Name
if (null != styleName) { if (StringUtils.isNotEmpty(styleName)) {
spUICombo.addStyleName(styleName); spUICombo.addStyleName(styleName);
} }
// Add height // Add height
if (null != height) { if (StringUtils.isNotEmpty(height)) {
spUICombo.setHeight(height); spUICombo.setHeight(height);
} }
// AddWidth // AddWidth
if (null != width) { if (StringUtils.isNotEmpty(width)) {
spUICombo.setWidth(width); spUICombo.setWidth(width);
} }
// Set promt // Set prompt
if (null != promt) { if (StringUtils.isNotEmpty(prompt)) {
spUICombo.setInputPrompt(promt); spUICombo.setInputPrompt(prompt);
} }
// Set Data // Set Data
if (null != data) { if (StringUtils.isNotEmpty(data)) {
spUICombo.setData(data); spUICombo.setData(data);
} }

View File

@@ -8,6 +8,8 @@
*/ */
package org.eclipse.hawkbit.ui.decorators; package org.eclipse.hawkbit.ui.decorators;
import org.apache.commons.lang3.StringUtils;
import com.vaadin.ui.TextArea; import com.vaadin.ui.TextArea;
import com.vaadin.ui.themes.ValoTheme; import com.vaadin.ui.themes.ValoTheme;
@@ -37,33 +39,36 @@ public final class SPUITextAreaDecorator {
* to set field as mandatory * to set field as mandatory
* @param data * @param data
* component data * component data
* @param promt * @param prompt
* as user for input * as user for input
* @param maxLength * @param maxLength
* maximum characters allowed * maximum characters allowed
* @return TextArea as comp * @return TextArea as comp
*/ */
public static TextArea decorate(String style, String styleName, boolean required, String data, String promt, public static TextArea decorate(final String caption, final String style, final String styleName,
int maxLength) { final boolean required, final String data, final String prompt, final int maxLength) {
final TextArea spUITxtArea = new TextArea(); final TextArea spUITxtArea = new TextArea();
// Default settings // Default settings
spUITxtArea.setRequired(false); spUITxtArea.setRequired(false);
spUITxtArea.addStyleName(ValoTheme.COMBOBOX_SMALL); spUITxtArea.addStyleName(ValoTheme.COMBOBOX_SMALL);
if (StringUtils.isNotEmpty(caption)) {
spUITxtArea.setCaption(caption);
}
if (required) { if (required) {
spUITxtArea.setRequired(true); spUITxtArea.setRequired(true);
} }
// Add style // Add style
if (null != style) { if (StringUtils.isNotEmpty(style)) {
spUITxtArea.setStyleName(style); spUITxtArea.setStyleName(style);
} }
// Add style Name // Add style Name
if (null != styleName) { if (StringUtils.isNotEmpty(styleName)) {
spUITxtArea.addStyleName(styleName); spUITxtArea.addStyleName(styleName);
} }
if (null != promt) { if (StringUtils.isNotEmpty(prompt)) {
spUITxtArea.setInputPrompt(promt); spUITxtArea.setInputPrompt(prompt);
} }
if (null != data) { if (StringUtils.isNotEmpty(data)) {
spUITxtArea.setData(data); spUITxtArea.setData(data);
} }

View File

@@ -8,6 +8,8 @@
*/ */
package org.eclipse.hawkbit.ui.decorators; package org.eclipse.hawkbit.ui.decorators;
import org.apache.commons.lang3.StringUtils;
import com.vaadin.ui.TextField; import com.vaadin.ui.TextField;
import com.vaadin.ui.themes.ValoTheme; import com.vaadin.ui.themes.ValoTheme;
@@ -27,8 +29,9 @@ public final class SPUITextFieldDecorator {
} }
/** /**
* Decorate.
* *
* @param caption
* set the caption of the textfield
* @param style * @param style
* set style * set style
* @param styleName * @param styleName
@@ -37,7 +40,7 @@ public final class SPUITextFieldDecorator {
* to set field as mandatory * to set field as mandatory
* @param data * @param data
* component data * component data
* @param promt * @param prompt
* prompt user for input * prompt user for input
* @param immediate * @param immediate
* as for display * as for display
@@ -45,9 +48,13 @@ public final class SPUITextFieldDecorator {
* maximum characters allowed * maximum characters allowed
* @return Text field as decorated * @return Text field as decorated
*/ */
public static TextField decorate(String style, String styleName, boolean required, String data, String promt, public static TextField decorate(final String caption, final String style, final String styleName,
boolean immediate, int maxLengthAllowed) { final boolean required, final String data, final String prompt, final boolean immediate,
final int maxLengthAllowed) {
final TextField spUITxtFld = new TextField(); final TextField spUITxtFld = new TextField();
if (StringUtils.isNotEmpty(caption)) {
spUITxtFld.setCaption(caption);
}
// Default settings // Default settings
spUITxtFld.setRequired(false); spUITxtFld.setRequired(false);
spUITxtFld.addStyleName(ValoTheme.TEXTFIELD_SMALL); spUITxtFld.addStyleName(ValoTheme.TEXTFIELD_SMALL);
@@ -58,17 +65,17 @@ public final class SPUITextFieldDecorator {
spUITxtFld.setImmediate(true); spUITxtFld.setImmediate(true);
} }
// Add style // Add style
if (null != style) { if (StringUtils.isNotEmpty(style)) {
spUITxtFld.setStyleName(style); spUITxtFld.setStyleName(style);
} }
// Add style Name // Add style Name
if (null != styleName) { if (StringUtils.isNotEmpty(styleName)) {
spUITxtFld.addStyleName(styleName); spUITxtFld.addStyleName(styleName);
} }
if (null != promt) { if (StringUtils.isNotEmpty(prompt)) {
spUITxtFld.setInputPrompt(promt); spUITxtFld.setInputPrompt(prompt);
} }
if (null != data) { if (StringUtils.isNotEmpty(data)) {
spUITxtFld.setData(data); spUITxtFld.setData(data);
} }
if (maxLengthAllowed > 0) { if (maxLengthAllowed > 0) {

View File

@@ -181,17 +181,17 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
comboLabel = SPUIComponentProvider.getLabel(i18n.get("label.choose.type"), null); comboLabel = SPUIComponentProvider.getLabel(i18n.get("label.choose.type"), null);
madatoryLabel = getMandatoryLabel(); madatoryLabel = getMandatoryLabel();
typeName = SPUIComponentProvider.getTextField("", typeName = SPUIComponentProvider.getTextField(i18n.get("textfield.name"), "",
ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.DIST_SET_TYPE_NAME, true, "", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.DIST_SET_TYPE_NAME, true, "",
i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
typeName.setId(SPUIDefinitions.NEW_DISTRIBUTION_TYPE_NAME); typeName.setId(SPUIDefinitions.NEW_DISTRIBUTION_TYPE_NAME);
typeKey = SPUIComponentProvider.getTextField("", typeKey = SPUIComponentProvider.getTextField(i18n.get("textfield.key"), "",
ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.DIST_SET_TYPE_KEY, true, "", i18n.get("textfield.key"), ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.DIST_SET_TYPE_KEY, true, "", i18n.get("textfield.key"),
true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
typeKey.setId(SPUIDefinitions.NEW_DISTRIBUTION_TYPE_KEY); typeKey.setId(SPUIDefinitions.NEW_DISTRIBUTION_TYPE_KEY);
typeDesc = SPUIComponentProvider.getTextArea("", typeDesc = SPUIComponentProvider.getTextArea(i18n.get("textfield.description"), "",
ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.DIST_SET_TYPE_DESC, false, "", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.DIST_SET_TYPE_DESC, false, "",
i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH); i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
@@ -199,8 +199,8 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
typeDesc.setImmediate(true); typeDesc.setImmediate(true);
typeDesc.setNullRepresentation(""); typeDesc.setNullRepresentation("");
typeNameComboBox = SPUIComponentProvider.getComboBox("", "", null, null, false, "", typeNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.type"), "", "", null, null, false,
i18n.get("label.combobox.type")); "", i18n.get("label.combobox.type"));
typeNameComboBox.setId(SPUIDefinitions.NEW_DISTRIBUTION_SET_TYPE_NAME_COMBO); typeNameComboBox.setId(SPUIDefinitions.NEW_DISTRIBUTION_SET_TYPE_NAME_COMBO);
typeNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE); typeNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE);
typeNameComboBox.setImmediate(true); typeNameComboBox.setImmediate(true);

View File

@@ -222,8 +222,9 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
} }
private TextField createNameTextField() { private TextField createNameTextField() {
final TextField nameField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null, final TextField nameField = SPUIComponentProvider.getTextField(i18n.get("textfield.customfiltername"), "",
i18n.get("textfield.customfiltername"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); ValoTheme.TEXTFIELD_TINY, false, null, i18n.get("textfield.customfiltername"), true,
SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
nameField.setId(SPUIComponetIdProvider.CUSTOM_FILTER_ADD_NAME); nameField.setId(SPUIComponetIdProvider.CUSTOM_FILTER_ADD_NAME);
nameField.setPropertyDataSource(nameLabel); nameField.setPropertyDataSource(nameLabel);
nameField.addTextChangeListener(event -> onFiterNameChange(event)); nameField.addTextChangeListener(event -> onFiterNameChange(event));
@@ -414,8 +415,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button
} }
private TextField createSearchField() { private TextField createSearchField() {
final TextField textField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, "", "", final TextField textField = SPUIComponentProvider.getTextField(null, "", ValoTheme.TEXTFIELD_TINY, false, "",
true, SPUILabelDefinitions.TARGET_FILTER_QUERY_TEXT_FIELD_LENGTH); "", true, SPUILabelDefinitions.TARGET_FILTER_QUERY_TEXT_FIELD_LENGTH);
textField.setId("custom.query.text.Id"); textField.setId("custom.query.text.Id");
textField.addStyleName("target-filter-textfield"); textField.addStyleName("target-filter-textfield");
textField.setWidth(900.0F, Unit.PIXELS); textField.setWidth(900.0F, Unit.PIXELS);

View File

@@ -124,7 +124,7 @@ public class TargetFilterHeader extends VerticalLayout {
} }
private TextField createSearchField() { private TextField createSearchField() {
final TextField campSearchTextField = SPUIComponentProvider.getTextField("filter-box", final TextField campSearchTextField = SPUIComponentProvider.getTextField(null, "filter-box",
"text-style filter-box-hide", false, "", "", false, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); "text-style filter-box-hide", false, "", "", false, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
campSearchTextField.setId("target.filter.search.text.Id"); campSearchTextField.setId("target.filter.search.text.Id");
campSearchTextField.setWidth(500.0f, Unit.PIXELS); campSearchTextField.setWidth(500.0f, Unit.PIXELS);

View File

@@ -160,24 +160,26 @@ public class DistributionAddUpdateWindowLayout extends VerticalLayout {
* Create required UI components. * Create required UI components.
*/ */
private void createRequiredComponents() { private void createRequiredComponents() {
distNameTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, true, null, distNameTextField = SPUIComponentProvider.getTextField(i18n.get("textfield.name"), "", ValoTheme.TEXTFIELD_TINY,
i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); true, null, i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
distNameTextField.setId(SPUIComponetIdProvider.DIST_ADD_NAME); distNameTextField.setId(SPUIComponetIdProvider.DIST_ADD_NAME);
distNameTextField.setNullRepresentation(""); distNameTextField.setNullRepresentation("");
distVersionTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, true, null, distVersionTextField = SPUIComponentProvider.getTextField(i18n.get("textfield.version"), "",
i18n.get("textfield.version"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); ValoTheme.TEXTFIELD_TINY, true, null, i18n.get("textfield.version"), true,
SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
distVersionTextField.setId(SPUIComponetIdProvider.DIST_ADD_VERSION); distVersionTextField.setId(SPUIComponetIdProvider.DIST_ADD_VERSION);
distVersionTextField.setNullRepresentation(""); distVersionTextField.setNullRepresentation("");
distsetTypeNameComboBox = SPUIComponentProvider.getComboBox("", "", null, "", false, "", distsetTypeNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.type"), "", "", null, "",
i18n.get("label.combobox.type")); false, "", i18n.get("label.combobox.type"));
distsetTypeNameComboBox.setImmediate(true); distsetTypeNameComboBox.setImmediate(true);
distsetTypeNameComboBox.setNullSelectionAllowed(false); distsetTypeNameComboBox.setNullSelectionAllowed(false);
distsetTypeNameComboBox.setId(SPUIComponetIdProvider.DIST_ADD_DISTSETTYPE); distsetTypeNameComboBox.setId(SPUIComponetIdProvider.DIST_ADD_DISTSETTYPE);
descTextArea = SPUIComponentProvider.getTextArea("text-area-style", ValoTheme.TEXTAREA_TINY, false, null, descTextArea = SPUIComponentProvider.getTextArea(i18n.get("textfield.description"), "text-area-style",
i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH); ValoTheme.TEXTAREA_TINY, false, null, i18n.get("textfield.description"),
SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
descTextArea.setId(SPUIComponetIdProvider.DIST_ADD_DESC); descTextArea.setId(SPUIComponetIdProvider.DIST_ADD_DESC);
descTextArea.setNullRepresentation(""); descTextArea.setNullRepresentation("");

View File

@@ -173,19 +173,20 @@ public abstract class CreateUpdateTagLayout extends CustomComponent implements C
colorLabel = SPUIComponentProvider.getLabel(i18n.get("label.choose.tag.color"), null); colorLabel = SPUIComponentProvider.getLabel(i18n.get("label.choose.tag.color"), null);
colorLabel.addStyleName(SPUIDefinitions.COLOR_LABEL_STYLE); colorLabel.addStyleName(SPUIDefinitions.COLOR_LABEL_STYLE);
tagName = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_NAME, tagName = SPUIComponentProvider.getTextField(i18n.get("textfield.name"), "",
true, "", i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_NAME, true, "", i18n.get("textfield.name"), true,
SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
tagName.setId(SPUIDefinitions.NEW_TARGET_TAG_NAME); tagName.setId(SPUIDefinitions.NEW_TARGET_TAG_NAME);
tagDesc = SPUIComponentProvider.getTextArea("", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_DESC, tagDesc = SPUIComponentProvider.getTextArea(null, "", ValoTheme.TEXTFIELD_TINY + " " + SPUIDefinitions.TAG_DESC,
false, "", i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH); false, "", i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
tagDesc.setId(SPUIDefinitions.NEW_TARGET_TAG_DESC); tagDesc.setId(SPUIDefinitions.NEW_TARGET_TAG_DESC);
tagDesc.setImmediate(true); tagDesc.setImmediate(true);
tagDesc.setNullRepresentation(""); tagDesc.setNullRepresentation("");
tagNameComboBox = SPUIComponentProvider.getComboBox("", "", null, null, false, "", tagNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.tag"), "", "", null, null, false,
i18n.get("label.combobox.tag")); "", i18n.get("label.combobox.tag"));
tagNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE); tagNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE);
tagNameComboBox.setImmediate(true); tagNameComboBox.setImmediate(true);

View File

@@ -105,17 +105,17 @@ public class TargetAddUpdateWindowLayout extends CustomComponent {
private void createRequiredComponents() { private void createRequiredComponents() {
/* Textfield for controller Id */ /* Textfield for controller Id */
controllerIDTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, true, null, controllerIDTextField = SPUIComponentProvider.getTextField( i18n.get("prompt.target.id"), "", ValoTheme.TEXTFIELD_TINY, true, null,
i18n.get("prompt.target.id"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); i18n.get("prompt.target.id"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
controllerIDTextField.setId(SPUIComponetIdProvider.TARGET_ADD_CONTROLLER_ID); controllerIDTextField.setId(SPUIComponetIdProvider.TARGET_ADD_CONTROLLER_ID);
/* Textfield for target name */ /* Textfield for target name */
nameTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null, nameTextField = SPUIComponentProvider.getTextField( i18n.get("textfield.name"), "", ValoTheme.TEXTFIELD_TINY, false, null,
i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
nameTextField.setId(SPUIComponetIdProvider.TARGET_ADD_NAME); nameTextField.setId(SPUIComponetIdProvider.TARGET_ADD_NAME);
/* Textarea for target description */ /* Textarea for target description */
descTextArea = SPUIComponentProvider.getTextArea("text-area-style", ValoTheme.TEXTFIELD_TINY, false, null, descTextArea = SPUIComponentProvider.getTextArea( i18n.get("textfield.description"), "text-area-style", ValoTheme.TEXTFIELD_TINY, false, null,
i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH); i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
descTextArea.setId(SPUIComponetIdProvider.TARGET_ADD_DESC); descTextArea.setId(SPUIComponetIdProvider.TARGET_ADD_DESC);
descTextArea.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY); descTextArea.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY);

View File

@@ -195,8 +195,9 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent {
} }
private TextArea getDescriptionTextArea() { private TextArea getDescriptionTextArea() {
final TextArea description = SPUIComponentProvider.getTextArea("text-area-style", ValoTheme.TEXTFIELD_TINY, final TextArea description = SPUIComponentProvider.getTextArea(i18n.get("textfield.description"),
false, null, i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH); "text-area-style", ValoTheme.TEXTFIELD_TINY, false, null, i18n.get("textfield.description"),
SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
description.setId(SPUIComponetIdProvider.BULK_UPLOAD_DESC); description.setId(SPUIComponetIdProvider.BULK_UPLOAD_DESC);
description.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY); description.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY);
description.setWidth("100%"); description.setWidth("100%");
@@ -205,8 +206,8 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent {
private ComboBox getDsComboField() { private ComboBox getDsComboField() {
final Container container = createContainer(); final Container container = createContainer();
final ComboBox dsComboBox = SPUIComponentProvider.getComboBox("", "", null, null, false, "", final ComboBox dsComboBox = SPUIComponentProvider.getComboBox(i18n.get("bulkupload.ds.name"), "", "", null,
i18n.get("bulkupload.ds.name")); null, false, "", i18n.get("bulkupload.ds.name"));
dsComboBox.setSizeUndefined(); dsComboBox.setSizeUndefined();
dsComboBox.addStyleName(SPUIDefinitions.BULK_UPLOD_DS_COMBO_STYLE); dsComboBox.addStyleName(SPUIDefinitions.BULK_UPLOD_DS_COMBO_STYLE);
dsComboBox.setImmediate(true); dsComboBox.setImmediate(true);

View File

@@ -27,7 +27,7 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupErrorCondit
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessAction; import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessAction;
import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition; import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition;
import org.eclipse.hawkbit.ui.UiProperties; import org.eclipse.hawkbit.ui.UiProperties;
import org.eclipse.hawkbit.ui.common.PopupWindowHelp; import org.eclipse.hawkbit.ui.common.CommonDialog;
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder;
import org.eclipse.hawkbit.ui.filtermanagement.TargetFilterBeanQuery; import org.eclipse.hawkbit.ui.filtermanagement.TargetFilterBeanQuery;
@@ -61,9 +61,10 @@ import com.vaadin.spring.annotation.ViewScope;
import com.vaadin.ui.Alignment; import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button; import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox; import com.vaadin.ui.ComboBox;
import com.vaadin.ui.CustomComponent; import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label; import com.vaadin.ui.Label;
import com.vaadin.ui.Link;
import com.vaadin.ui.OptionGroup; import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.TextArea; import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField; import com.vaadin.ui.TextField;
@@ -79,7 +80,7 @@ import com.vaadin.ui.themes.ValoTheme;
*/ */
@SpringComponent @SpringComponent
@ViewScope @ViewScope
public class AddUpdateRolloutWindowLayout extends CustomComponent { public class AddUpdateRolloutWindowLayout extends CommonDialog {
private static final long serialVersionUID = 2999293468801479916L; private static final long serialVersionUID = 2999293468801479916L;
@@ -113,6 +114,8 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
@Autowired @Autowired
private transient EventBus.SessionEventBus eventBus; private transient EventBus.SessionEventBus eventBus;
private Label madatoryLabel;
private TextField rolloutName; private TextField rolloutName;
private ComboBox distributionSet; private ComboBox distributionSet;
@@ -135,7 +138,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private OptionGroup errorThresholdOptionGroup; private OptionGroup errorThresholdOptionGroup;
// private Link linkToHelp; private Link linkToHelp;
private Window addUpdateRolloutWindow; private Window addUpdateRolloutWindow;
@@ -149,12 +152,21 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
private TextArea targetFilterQuery; private TextArea targetFilterQuery;
public AddUpdateRolloutWindowLayout() {
super();
}
public AddUpdateRolloutWindowLayout(final String title, final FormLayout form, final String helpLink) {
super(title, form, helpLink);
}
/** /**
* Create components and layout. * Create components and layout.
*/ */
public void init() { public void init() {
createRequiredComponents(); // createRequiredComponents();
buildLayout(); // buildLayout();
initForm();
} }
public Window getWindow() { public Window getWindow() {
@@ -202,17 +214,13 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
mainLayout.setSpacing(Boolean.TRUE); mainLayout.setSpacing(Boolean.TRUE);
mainLayout.setSizeUndefined(); mainLayout.setSizeUndefined();
// mainLayout.addComponents(getMandatoryLabelLinkToHelp(), rolloutName, mainLayout.addComponents(madatoryLabel, rolloutName, distributionSet, getTargetFilterLayout(),
// distributionSet, getTargetFilterLayout(), getGroupDetailsLayout(), getTriggerThresoldLayout(), getErrorThresoldLayout(), description,
// getGroupDetailsLayout(), getTriggerThresoldLayout(), actionTypeOptionGroupLayout, linkToHelp, getSaveDiscardButtonLayout());
// getErrorThresoldLayout(), description,
// actionTypeOptionGroupLayout, getSaveDiscardButtonLayout());
mainLayout.addComponents(new PopupWindowHelp(uiProperties.getLinks().getDocumentation().getRolloutView()), mainLayout.addComponent(new Label("TEST TEST TEST"));
createMandatoryLabel(), rolloutName, distributionSet, getTargetFilterLayout(), getGroupDetailsLayout(), mainLayout.setComponentAlignment(linkToHelp, Alignment.BOTTOM_RIGHT);
getTriggerThresoldLayout(), getErrorThresoldLayout(), description, actionTypeOptionGroupLayout, rolloutName.focus();
getSaveDiscardButtonLayout());
setCompositionRoot(mainLayout);
} }
private HorizontalLayout getGroupDetailsLayout() { private HorizontalLayout getGroupDetailsLayout() {
@@ -225,9 +233,12 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
} }
private HorizontalLayout getErrorThresoldLayout() { private HorizontalLayout getErrorThresoldLayout() {
createErrorThresold();
createErrorThresholdOptionGroup();
final HorizontalLayout errorThresoldLayout = new HorizontalLayout(); final HorizontalLayout errorThresoldLayout = new HorizontalLayout();
errorThresoldLayout.setSizeFull(); errorThresoldLayout.setSizeFull();
errorThresoldLayout.addComponents(errorThreshold, errorThresholdOptionGroup); errorThresoldLayout.addComponents(SPUIComponentProvider.getLabel(i18n.get("prompt.error.threshold"), null),
errorThreshold, errorThresholdOptionGroup);
errorThresoldLayout.setExpandRatio(errorThreshold, 1.0F); errorThresoldLayout.setExpandRatio(errorThreshold, 1.0F);
return errorThresoldLayout; return errorThresoldLayout;
} }
@@ -244,10 +255,12 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
} }
private HorizontalLayout getTriggerThresoldLayout() { private HorizontalLayout getTriggerThresoldLayout() {
createTriggerThresold();
final HorizontalLayout triggerThresholdLayout = new HorizontalLayout(); final HorizontalLayout triggerThresholdLayout = new HorizontalLayout();
triggerThresholdLayout.setSizeFull(); triggerThresholdLayout.setSizeFull();
triggerThresholdLayout.addComponents(triggerThreshold, getPercentHintLabel()); triggerThresholdLayout.addComponents(SPUIComponentProvider.getLabel(i18n.get("prompt.tigger.thresold"), null),
triggerThresholdLayout.setExpandRatio(triggerThreshold, 1.0F); triggerThreshold, getPercentHintLabel());
triggerThresholdLayout.setExpandRatio(triggerThreshold, 2.0F);
return triggerThresholdLayout; return triggerThresholdLayout;
} }
@@ -268,20 +281,28 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
return buttonsLayout; return buttonsLayout;
} }
// private HorizontalLayout getMandatoryLabelLinkToHelp() { private void initForm() {
// final HorizontalLayout mandatoryLabelLinkToHelpLayout = new
// HorizontalLayout(); getFormLayout().addComponent(createMandatoryLabel());
// mandatoryLabelLinkToHelpLayout.setSizeFull(); getFormLayout().addComponent(createRolloutNameField());
// mandatoryLabelLinkToHelpLayout.addComponents(madatoryLabel, linkToHelp); getFormLayout().addComponent(createDistributionSetCombo());
// mandatoryLabelLinkToHelpLayout.setComponentAlignment(madatoryLabel, populateDistributionSet();
// Alignment.MIDDLE_LEFT); getFormLayout().addComponent(createTargetFilterQueryCombo());
// mandatoryLabelLinkToHelpLayout.setComponentAlignment(linkToHelp, populateTargetFilterQuery();
// Alignment.MIDDLE_RIGHT); getFormLayout().addComponent(createNoOfGroupsField());
// mandatoryLabelLinkToHelpLayout.addStyleName("window-style"); getFormLayout().addComponent(createGroupSizeLabel());
// return mandatoryLabelLinkToHelpLayout; getFormLayout().addComponent(getTriggerThresoldLayout());
// } getFormLayout().addComponent(getErrorThresoldLayout());
getFormLayout().addComponent(createDescription());
getFormLayout().addComponent(actionTypeOptionGroupLayout);
actionTypeOptionGroupLayout.selectDefaultOption();
getFormLayout().addComponent(createTotalTargetsLabel());
getFormLayout().addComponent(createTargetFilterQuery());
}
private void createRequiredComponents() { private void createRequiredComponents() {
madatoryLabel = createMandatoryLabel();
rolloutName = createRolloutNameField(); rolloutName = createRolloutNameField();
distributionSet = createDistributionSetCombo(); distributionSet = createDistributionSetCombo();
populateDistributionSet(); populateDistributionSet();
@@ -291,10 +312,10 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
noOfGroups = createNoOfGroupsField(); noOfGroups = createNoOfGroupsField();
groupSizeLabel = createGroupSizeLabel(); groupSizeLabel = createGroupSizeLabel();
triggerThreshold = createTriggerThresold(); // triggerThreshold = createTriggerThresold();
errorThreshold = createErrorThresold(); // errorThreshold = createErrorThresold();
description = createDescription(); // description = createDescription();
errorThresholdOptionGroup = createErrorThresholdOptionGroup(); // errorThresholdOptionGroup = createErrorThresholdOptionGroup();
setDefaultSaveStartGroupOption(); setDefaultSaveStartGroupOption();
saveRolloutBtn = createSaveButton(); saveRolloutBtn = createSaveButton();
discardRollloutBtn = createDiscardButton(); discardRollloutBtn = createDiscardButton();
@@ -303,16 +324,11 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
totalTargetsLabel = createTotalTargetsLabel(); totalTargetsLabel = createTotalTargetsLabel();
targetFilterQuery = createTargetFilterQuery(); targetFilterQuery = createTargetFilterQuery();
// linkToHelp = createLinkToHelp(); linkToHelp = SPUIComponentProvider.getHelpLink(uiProperties.getLinks().getDocumentation().getRolloutView());
actionTypeOptionGroupLayout.addStyleName(SPUIStyleDefinitions.ROLLOUT_ACTION_TYPE_LAYOUT); actionTypeOptionGroupLayout.addStyleName(SPUIStyleDefinitions.ROLLOUT_ACTION_TYPE_LAYOUT);
} }
// private Link createLinkToHelp() {
// return
// SPUIComponentProvider.getHelpLink(uiProperties.getLinks().getDocumentation().getRolloutView());
// }
private Label createGroupSizeLabel() { private Label createGroupSizeLabel() {
final Label groupSize = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_LABEL_SIMPLE); final Label groupSize = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_LABEL_SIMPLE);
groupSize.addStyleName(ValoTheme.LABEL_TINY + " " + "rollout-target-count-message"); groupSize.addStyleName(ValoTheme.LABEL_TINY + " " + "rollout-target-count-message");
@@ -323,8 +339,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
} }
private TextArea createTargetFilterQuery() { private TextArea createTargetFilterQuery() {
final TextArea filterField = SPUIComponentProvider.getTextArea("text-area-style", ValoTheme.TEXTFIELD_TINY, final TextArea filterField = SPUIComponentProvider.getTextArea(null, "text-area-style",
false, null, null, SPUILabelDefinitions.TARGET_FILTER_QUERY_TEXT_FIELD_LENGTH); ValoTheme.TEXTFIELD_TINY, false, null, null,
SPUILabelDefinitions.TARGET_FILTER_QUERY_TEXT_FIELD_LENGTH);
filterField.setId(SPUIComponetIdProvider.ROLLOUT_TARGET_FILTER_QUERY_FIELD); filterField.setId(SPUIComponetIdProvider.ROLLOUT_TARGET_FILTER_QUERY_FIELD);
filterField.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY); filterField.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY);
filterField.setVisible(false); filterField.setVisible(false);
@@ -342,17 +359,17 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
return targetCountLabel; return targetCountLabel;
} }
private OptionGroup createErrorThresholdOptionGroup() { private void createErrorThresholdOptionGroup() {
final OptionGroup errorThresoldOptions = new OptionGroup(); errorThresholdOptionGroup = new OptionGroup();
for (final ERRORTHRESOLDOPTIONS option : ERRORTHRESOLDOPTIONS.values()) { for (final ERRORTHRESOLDOPTIONS option : ERRORTHRESOLDOPTIONS.values()) {
errorThresoldOptions.addItem(option.getValue()); errorThresholdOptionGroup.addItem(option.getValue());
} }
errorThresoldOptions.setId(SPUIComponetIdProvider.ROLLOUT_ERROR_THRESOLD_OPTION_ID); errorThresholdOptionGroup.setId(SPUIComponetIdProvider.ROLLOUT_ERROR_THRESOLD_OPTION_ID);
errorThresoldOptions.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL); errorThresholdOptionGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
errorThresoldOptions.addStyleName(SPUIStyleDefinitions.ROLLOUT_OPTION_GROUP); errorThresholdOptionGroup.addStyleName(SPUIStyleDefinitions.ROLLOUT_OPTION_GROUP);
errorThresoldOptions.setSizeUndefined(); errorThresholdOptionGroup.setSizeUndefined();
errorThresoldOptions.addValueChangeListener(event -> onErrorThresoldOptionChange(event)); errorThresholdOptionGroup.addValueChangeListener(event -> onErrorThresoldOptionChange(event));
return errorThresoldOptions; setDefaultSaveStartGroupOption();
} }
private void onErrorThresoldOptionChange(final ValueChangeEvent event) { private void onErrorThresoldOptionChange(final ValueChangeEvent event) {
@@ -361,21 +378,21 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
if (event.getProperty().getValue().equals(ERRORTHRESOLDOPTIONS.COUNT.getValue())) { if (event.getProperty().getValue().equals(ERRORTHRESOLDOPTIONS.COUNT.getValue())) {
errorThreshold.addValidator(new ErrorThresoldOptionValidator()); errorThreshold.addValidator(new ErrorThresoldOptionValidator());
} else { } else {
errorThreshold.addValidator(new ThresoldFieldValidator()); errorThreshold.addValidator(new ThresholdFieldValidator());
} }
errorThreshold.getValidators(); errorThreshold.getValidators();
} }
private ComboBox createTargetFilterQueryCombo() { private ComboBox createTargetFilterQueryCombo() {
final ComboBox targetFilter = SPUIComponentProvider.getComboBox("", "", null, null, true, "", targetFilterQueryCombo = SPUIComponentProvider.getComboBox(i18n.get("prompt.target.filter"), "", "", null, null,
i18n.get("prompt.target.filter")); true, "", i18n.get("prompt.target.filter"));
targetFilter.setImmediate(true); targetFilterQueryCombo.setImmediate(true);
targetFilter.setPageLength(7); targetFilterQueryCombo.setPageLength(7);
targetFilter.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME); targetFilterQueryCombo.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
targetFilter.setId(SPUIComponetIdProvider.ROLLOUT_TARGET_FILTER_COMBO_ID); targetFilterQueryCombo.setId(SPUIComponetIdProvider.ROLLOUT_TARGET_FILTER_COMBO_ID);
targetFilter.setSizeFull(); targetFilterQueryCombo.setSizeFull();
targetFilter.addValueChangeListener(event -> onTargetFilterChange()); targetFilterQueryCombo.addValueChangeListener(event -> onTargetFilterChange());
return targetFilter; return targetFilterQueryCombo;
} }
private void onTargetFilterChange() { private void onTargetFilterChange() {
@@ -606,37 +623,37 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
} }
private TextArea createDescription() { private TextArea createDescription() {
final TextArea descriptionField = SPUIComponentProvider.getTextArea("text-area-style", ValoTheme.TEXTFIELD_TINY, final TextArea descriptionField = SPUIComponentProvider.getTextArea(i18n.get("textfield.description"),
false, null, i18n.get("textfield.description"), SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH); "text-area-style", ValoTheme.TEXTFIELD_TINY, false, null, i18n.get("textfield.description"),
SPUILabelDefinitions.TEXT_AREA_MAX_LENGTH);
descriptionField.setId(SPUIComponetIdProvider.ROLLOUT_DESCRIPTION_ID); descriptionField.setId(SPUIComponetIdProvider.ROLLOUT_DESCRIPTION_ID);
descriptionField.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY); descriptionField.setNullRepresentation(HawkbitCommonUtil.SP_STRING_EMPTY);
descriptionField.setSizeFull(); descriptionField.setSizeFull();
return descriptionField; return descriptionField;
} }
private TextField createErrorThresold() { private void createErrorThresold() {
final TextField errorField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, true, null, errorThreshold = SPUIComponentProvider.getTextField(null, "", ValoTheme.TEXTFIELD_TINY, false, null,
i18n.get("prompt.error.threshold"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); i18n.get("prompt.error.threshold"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
errorField.addValidator(new ThresoldFieldValidator()); errorThreshold.addValidator(new ThresholdFieldValidator());
errorField.setId(SPUIComponetIdProvider.ROLLOUT_ERROR_THRESOLD_ID); errorThreshold.setId(SPUIComponetIdProvider.ROLLOUT_ERROR_THRESOLD_ID);
errorField.setMaxLength(7); errorThreshold.setMaxLength(7);
errorField.setSizeFull(); errorThreshold.setSizeFull();
return errorField;
} }
private TextField createTriggerThresold() { private void createTriggerThresold() {
final TextField thresholdField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, true, null, triggerThreshold = SPUIComponentProvider.getTextField(null, "", ValoTheme.TEXTFIELD_TINY, false, null,
i18n.get("prompt.tigger.thresold"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); i18n.get("prompt.tigger.thresold"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
thresholdField.setId(SPUIComponetIdProvider.ROLLOUT_TRIGGER_THRESOLD_ID); triggerThreshold.setId(SPUIComponetIdProvider.ROLLOUT_TRIGGER_THRESOLD_ID);
thresholdField.addValidator(new ThresoldFieldValidator()); triggerThreshold.addValidator(new ThresholdFieldValidator());
thresholdField.setSizeFull(); triggerThreshold.setSizeUndefined();
thresholdField.setMaxLength(3); triggerThreshold.setMaxLength(3);
return thresholdField;
} }
private TextField createNoOfGroupsField() { private TextField createNoOfGroupsField() {
final TextField noOfGroupsField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, true, null, final TextField noOfGroupsField = SPUIComponentProvider.getTextField(i18n.get("prompt.number.of.groups"), "",
i18n.get("prompt.number.of.groups"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); ValoTheme.TEXTFIELD_TINY, true, null, i18n.get("prompt.number.of.groups"), true,
SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
noOfGroupsField.setId(SPUIComponetIdProvider.ROLLOUT_NO_OF_GROUPS_ID); noOfGroupsField.setId(SPUIComponetIdProvider.ROLLOUT_NO_OF_GROUPS_ID);
noOfGroupsField.addValidator(new GroupNumberValidator()); noOfGroupsField.addValidator(new GroupNumberValidator());
noOfGroupsField.setSizeFull(); noOfGroupsField.setSizeFull();
@@ -655,14 +672,14 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
} }
private ComboBox createDistributionSetCombo() { private ComboBox createDistributionSetCombo() {
final ComboBox dsSet = SPUIComponentProvider.getComboBox("", "", null, null, true, "", distributionSet = SPUIComponentProvider.getComboBox(i18n.get("prompt.distribution.set"), "", "", null, null,
i18n.get("prompt.distribution.set")); true, "", i18n.get("prompt.distribution.set"));
dsSet.setImmediate(true); distributionSet.setImmediate(true);
dsSet.setPageLength(7); distributionSet.setPageLength(7);
dsSet.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME); distributionSet.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
dsSet.setId(SPUIComponetIdProvider.ROLLOUT_DS_ID); distributionSet.setId(SPUIComponetIdProvider.ROLLOUT_DS_ID);
dsSet.setSizeFull(); distributionSet.setSizeFull();
return dsSet; return distributionSet;
} }
private void populateDistributionSet() { private void populateDistributionSet() {
@@ -680,8 +697,9 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
} }
private TextField createRolloutNameField() { private TextField createRolloutNameField() {
final TextField rolloutNameField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, true, null, final TextField rolloutNameField = SPUIComponentProvider.getTextField(i18n.get("textfield.name"), "",
i18n.get("textfield.name"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); ValoTheme.TEXTFIELD_TINY, true, null, i18n.get("textfield.name"), true,
SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
rolloutNameField.setId(SPUIComponetIdProvider.ROLLOUT_NAME_FIELD_ID); rolloutNameField.setId(SPUIComponetIdProvider.ROLLOUT_NAME_FIELD_ID);
rolloutNameField.setSizeFull(); rolloutNameField.setSizeFull();
return rolloutNameField; return rolloutNameField;
@@ -728,7 +746,7 @@ public class AddUpdateRolloutWindowLayout extends CustomComponent {
return (int) Math.ceil((double) totalTargetsCount / Double.parseDouble(noOfGroups.getValue())); return (int) Math.ceil((double) totalTargetsCount / Double.parseDouble(noOfGroups.getValue()));
} }
class ThresoldFieldValidator implements Validator { class ThresholdFieldValidator implements Validator {
private static final long serialVersionUID = 9049939751976326550L; private static final long serialVersionUID = 9049939751976326550L;
@Override @Override

View File

@@ -54,7 +54,6 @@ import com.vaadin.server.FontAwesome;
import com.vaadin.spring.annotation.SpringComponent; import com.vaadin.spring.annotation.SpringComponent;
import com.vaadin.spring.annotation.ViewScope; import com.vaadin.spring.annotation.ViewScope;
import com.vaadin.ui.UI; import com.vaadin.ui.UI;
import com.vaadin.ui.Window;
import com.vaadin.ui.renderers.ClickableRenderer.RendererClickEvent; import com.vaadin.ui.renderers.ClickableRenderer.RendererClickEvent;
import com.vaadin.ui.renderers.HtmlRenderer; import com.vaadin.ui.renderers.HtmlRenderer;
@@ -77,7 +76,6 @@ public class RolloutListGrid extends AbstractGrid {
private static final String START_OPTION = "Start"; private static final String START_OPTION = "Start";
@Autowired @Autowired
private transient RolloutManagement rolloutManagement; private transient RolloutManagement rolloutManagement;
@@ -95,7 +93,6 @@ public class RolloutListGrid extends AbstractGrid {
private transient Map<RolloutStatus, StatusFontIcon> statusIconMap = new EnumMap<>(RolloutStatus.class); private transient Map<RolloutStatus, StatusFontIcon> statusIconMap = new EnumMap<>(RolloutStatus.class);
@EventBusListenerMethod(scope = EventScope.SESSION) @EventBusListenerMethod(scope = EventScope.SESSION)
void onEvent(final RolloutEvent event) { void onEvent(final RolloutEvent event) {
switch (event) { switch (event) {
@@ -393,10 +390,8 @@ public class RolloutListGrid extends AbstractGrid {
private void onUpdate(final ContextMenuData contextMenuData) { private void onUpdate(final ContextMenuData contextMenuData) {
addUpdateRolloutWindow.populateData(contextMenuData.getRolloutId()); addUpdateRolloutWindow.populateData(contextMenuData.getRolloutId());
final Window addTargetWindow = addUpdateRolloutWindow.getWindow(); UI.getCurrent().addWindow(addUpdateRolloutWindow);
addTargetWindow.setCaption(i18n.get("caption.update.rollout")); addUpdateRolloutWindow.setVisible(Boolean.TRUE);
UI.getCurrent().addWindow(addTargetWindow);
addTargetWindow.setVisible(Boolean.TRUE);
} }
private void refreshGrid() { private void refreshGrid() {

View File

@@ -27,7 +27,6 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label; import com.vaadin.ui.Label;
import com.vaadin.ui.UI; import com.vaadin.ui.UI;
import com.vaadin.ui.Window;
/** /**
* *
@@ -55,7 +54,6 @@ public class RolloutListHeader extends AbstractGridHeader {
@PostConstruct @PostConstruct
protected void init() { protected void init() {
super.init(); super.init();
addUpdateRolloutWindow.init();
} }
@Override @Override
@@ -91,11 +89,10 @@ public class RolloutListHeader extends AbstractGridHeader {
@Override @Override
protected void addNewItem(final ClickEvent event) { protected void addNewItem(final ClickEvent event) {
addUpdateRolloutWindow.resetComponents(); // addUpdateRolloutWindow.resetComponents();
final Window addTargetWindow = addUpdateRolloutWindow.getWindow(); addUpdateRolloutWindow.init();
UI.getCurrent().addWindow(addTargetWindow); UI.getCurrent().addWindow(addUpdateRolloutWindow);
addTargetWindow.setVisible(Boolean.TRUE); addUpdateRolloutWindow.setVisible(Boolean.TRUE);
} }
@Override @Override

View File

@@ -95,7 +95,7 @@ public class DefaultDistributionSetTypeLayout extends BaseConfigurationView impl
final Iterable<DistributionSetType> distributionSetTypeCollection = distributionSetManagement final Iterable<DistributionSetType> distributionSetTypeCollection = distributionSetManagement
.findDistributionSetTypesAll(pageReq); .findDistributionSetTypesAll(pageReq);
combobox = SPUIComponentProvider.getComboBox("", "330", null, null, false, "", "label.combobox.tag"); combobox = SPUIComponentProvider.getComboBox(null, "", "330", null, null, false, "", "label.combobox.tag");
combobox.setId(SPUIComponetIdProvider.SYSTEM_CONFIGURATION_DEFAULTDIS_COMBOBOX); combobox.setId(SPUIComponetIdProvider.SYSTEM_CONFIGURATION_DEFAULTDIS_COMBOBOX);
combobox.setNullSelectionAllowed(false); combobox.setNullSelectionAllowed(false);
for (final DistributionSetType distributionSetType : distributionSetTypeCollection) { for (final DistributionSetType distributionSetType : distributionSetTypeCollection) {

View File

@@ -70,8 +70,8 @@ public class CertificateAuthenticationConfigurationItem extends AbstractAuthenti
caRootAuthorityLabel.setDescription( caRootAuthorityLabel.setDescription(
"The SSL Issuer iRules.X509 hash, to validate against the controller request certifcate."); "The SSL Issuer iRules.X509 hash, to validate against the controller request certifcate.");
caRootAuthorityTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null, "", caRootAuthorityTextField = SPUIComponentProvider.getTextField(null, "", ValoTheme.TEXTFIELD_TINY, false, null,
true, 128); "", true, 128);
caRootAuthorityTextField.setWidth("500px"); caRootAuthorityTextField.setWidth("500px");
caRootAuthorityTextField.setImmediate(true); caRootAuthorityTextField.setImmediate(true);
caRootAuthorityTextField.addTextChangeListener(event -> caRootAuthorityChanged()); caRootAuthorityTextField.addTextChangeListener(event -> caRootAuthorityChanged());

View File

@@ -74,8 +74,8 @@ public class GatewaySecurityTokenAuthenticationConfigurationItem extends Abstrac
detailLayout = new VerticalLayout(); detailLayout = new VerticalLayout();
detailLayout.setImmediate(true); detailLayout.setImmediate(true);
gatewayTokenNameTextField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null, "", gatewayTokenNameTextField = SPUIComponentProvider.getTextField(null, "", ValoTheme.TEXTFIELD_TINY, false, null,
true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); "", true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH);
gatewayTokenNameTextField.setImmediate(true); gatewayTokenNameTextField.setImmediate(true);
// hide text field until we support multiple gateway tokens for a tenan // hide text field until we support multiple gateway tokens for a tenan
gatewayTokenNameTextField.setVisible(false); gatewayTokenNameTextField.setVisible(false);