public void add(Widget item) { items.add(item); }
public int addRow(final IsWidget widget) { final FormGroup formGroup; if (widget instanceof FormGroup) { formGroup = (FormGroup) widget; } else { formGroup = new FormGroup(); if (widget instanceof Column) { formGroup.add(widget); } else { formGroup.add(new Column(ColumnSize.MD_12) {{ add(widget); }}); } } add(formGroup); return getWidgetCount() - 1; }
public int addRow(final IsWidget widget) { final FormGroup formGroup; if (widget instanceof FormGroup) { formGroup = (FormGroup) widget; } else { formGroup = new FormGroup(); if (widget instanceof Column) { formGroup.add(widget); } else { formGroup.add(new Column(ColumnSize.MD_12) {{ add(widget); }}); } } add(formGroup); return getWidgetCount() - 1; }
@Override public void addSearchPanel(IsWidget searchPanel) { if (searchPanel != null) { searchBarContainer.add(searchPanel); searchBarContainer.setVisible(true); } else { searchBarContainer.clear(); searchBarContainer.setVisible(false); } }
private void initialiseValue() { final Widget editor = valueEditorFactory().getValueEditor(className, afv.getFieldName(), afv, oracle, false); valueHolder.clear(); if (editor != null) { valueHolder.add(editor); } }
public void addListBoxToFilter(String label, String fieldName, boolean multiselect, HashMap<String, String> listBoxInfo) { FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(label); HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>"); controlLabel.setHTML(lab.getHTML()); ListBox listBox = new ListBox(multiselect); if (listBoxInfo != null) { Set listBoxKeys = listBoxInfo.keySet(); Iterator it = listBoxKeys.iterator(); String key; while (it.hasNext()) { key = (String) it.next(); listBox.addItem(listBoxInfo.get(key), key); } } listBox.setName(fieldName); controlGroup.add(controlLabel); controlGroup.add(listBox); filterControlGroups.add(controlGroup); filterForm.add(controlGroup); }
public void addListBoxToFilter(String label, String fieldName, boolean multiselect, HashMap<String, String> listBoxInfo) { FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(label); HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>"); controlLabel.setHTML(lab.getHTML()); ListBox listBox = new ListBox(multiselect); if (listBoxInfo != null) { Set listBoxKeys = listBoxInfo.keySet(); Iterator it = listBoxKeys.iterator(); String key; while (it.hasNext()) { key = (String) it.next(); listBox.addItem(listBoxInfo.get(key), key); } } listBox.setName(fieldName); controlGroup.add(controlLabel); controlGroup.add(listBox); filterControlGroups.add(controlGroup); horizontalForm.add(controlGroup); }
public void addTextBoxToFilter(String label, String fieldName, String defaultValue) { FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(label); HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>"); controlLabel.setHTML(lab.getHTML()); TextBox textBox = new TextBox(); textBox.setName(fieldName); if (defaultValue != null && defaultValue.trim().length() > 0) { textBox.setText(defaultValue); } controlGroup.add(controlLabel); controlGroup.add(textBox); filterControlGroups.add(controlGroup); filterForm.add(controlGroup); }
public void addListBoxToFilter(String label, String fieldName, boolean multiselect, HashMap<String, String> listBoxInfo) { FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(label); HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>"); controlLabel.setHTML(lab.getHTML()); ListBox listBox = new ListBox(multiselect); if (listBoxInfo != null) { Set listBoxKeys = listBoxInfo.keySet(); Iterator it = listBoxKeys.iterator(); String key; while (it.hasNext()) { key = (String) it.next(); listBox.addItem(listBoxInfo.get(key), key); } } listBox.setName(fieldName); controlGroup.add(controlLabel); controlGroup.add(listBox); filterControlGroups.add(controlGroup); horizontalForm.add(controlGroup); }
public void addListBoxToFilter(String label, String fieldName, boolean multiselect, HashMap<String, String> listBoxInfo) { FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(label); HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>"); controlLabel.setHTML(lab.getHTML()); ListBox listBox = new ListBox(multiselect); if (listBoxInfo != null) { Set listBoxKeys = listBoxInfo.keySet(); Iterator it = listBoxKeys.iterator(); String key; while (it.hasNext()) { key = (String) it.next(); listBox.addItem(listBoxInfo.get(key), key); } } listBox.setName(fieldName); controlGroup.add(controlLabel); controlGroup.add(listBox); filterControlGroups.add(controlGroup); filterForm.add(controlGroup); }
private void initialiseValue() { final Widget editor = valueEditorFactory().getValueEditor(className, afv.getFieldName(), afv, oracle, false); valueHolder.clear(); if (editor != null) { valueHolder.add(editor); } }
public void addTextBoxToFilter(String label, String fieldName, String defaultValue) { FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(label); HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>"); controlLabel.setHTML(lab.getHTML()); TextBox textBox = new TextBox(); textBox.setName(fieldName); if (defaultValue != null && defaultValue.trim().length() > 0) { textBox.setText(defaultValue); } controlGroup.add(controlLabel); controlGroup.add(textBox); filterControlGroups.add(controlGroup); horizontalForm.add(controlGroup); }
public void addTextBoxToFilter(String label, String fieldName, String defaultValue) { FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(label); HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>"); controlLabel.setHTML(lab.getHTML()); TextBox textBox = new TextBox(); textBox.setName(fieldName); if (defaultValue != null && defaultValue.trim().length() > 0) { textBox.setText(defaultValue); } controlGroup.add(controlLabel); controlGroup.add(textBox); filterControlGroups.add(controlGroup); horizontalForm.add(controlGroup); }
public void addTextBoxToFilter(String label, String fieldName, String defaultValue) { FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(label); HTML lab = new HTML("<span style=\"margin-right:10px\">" + label + "</span>"); controlLabel.setHTML(lab.getHTML()); TextBox textBox = new TextBox(); textBox.setName(fieldName); if (defaultValue != null && defaultValue.trim().length() > 0) { textBox.setText(defaultValue); } controlGroup.add(controlLabel); controlGroup.add(textBox); filterControlGroups.add(controlGroup); filterForm.add(controlGroup); }
private void initButton(ActionButtonDefinition<T> buttonDef, ActionButton button) { button.setText(buttonDef.getText()); // Set button element ID for better accessibility String buttonId = buttonDef.getUniqueId(); if (buttonId != null) { button.asWidget().getElement().setId( ElementIdUtils.createElementId(getElementId(), buttonId)); } // No insert available so need to remove the kebab and then add it at the end. actionFormGroup.remove(actionKebab); if (buttonDef.getIndex() >= actionFormGroup.getWidgetCount()) { // Add the button at the end actionFormGroup.add(button); actionFormGroup.add(actionKebab); } else { // Re-create ordered button list List<Widget> currentButtons = new ArrayList<>(); for (int i = 0; i < actionFormGroup.getWidgetCount(); i++) { currentButtons.add(actionFormGroup.getWidget(i)); } currentButtons.add(buttonDef.getIndex(), button.asWidget()); // Re-add all buttons actionFormGroup.clear(); currentButtons.forEach(existingButton -> actionFormGroup.add(existingButton)); actionFormGroup.add(actionKebab); } actionItemMap.put(buttonDef, button); }
public void init() { basicTabPanel.clear(); filterControlGroups.clear(); filterForm.clear(); FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(CommonConstants.INSTANCE.Filter_Name()); HTML lab = new HTML("<span style=\"color:red\"> * </span>" + "<span style=\"margin-right:10px\">" + CommonConstants.INSTANCE.Filter_Name() + "</span>"); controlLabel.setHTML(lab.getHTML()); TextBox fieldTextBox = new TextBox(); fieldTextBox.setName(FILTER_TAB_NAME_PARAM); controlGroup.add(controlLabel); controlGroup.add(fieldTextBox); filterControlGroups.add(controlGroup); basicTabPanel.add(controlGroup); controlGroup = new FormGroup(); controlLabel = new FormLabel(); controlLabel.setTitle("Filter description"); lab = new HTML("<span style=\"color:red\"> * </span>" + "<span style=\"margin-right:10px\">" + "Filter description" + "</span>"); controlLabel.setHTML(lab.getHTML()); fieldTextBox = new TextBox(); fieldTextBox.setName(FILTER_TAB_DESC_PARAM); controlGroup.add(controlLabel); controlGroup.add(fieldTextBox); filterControlGroups.add(controlGroup); basicTabPanel.add(controlGroup); }
public void init() { basicTabPanel.clear(); filterControlGroups.clear(); filterForm.clear(); FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(CommonConstants.INSTANCE.Filter_Name()); HTML lab = new HTML("<span style=\"color:red\"> * </span>" + "<span style=\"margin-right:10px\">" + CommonConstants.INSTANCE.Filter_Name() + "</span>"); controlLabel.setHTML(lab.getHTML()); TextBox fieldTextBox = new TextBox(); fieldTextBox.setName(FILTER_TAB_NAME_PARAM); controlGroup.add(controlLabel); controlGroup.add(fieldTextBox); filterControlGroups.add(controlGroup); basicTabPanel.add(controlGroup); controlGroup = new FormGroup(); controlLabel = new FormLabel(); controlLabel.setTitle("Filter description"); lab = new HTML("<span style=\"color:red\"> * </span>" + "<span style=\"margin-right:10px\">" + "Filter description" + "</span>"); controlLabel.setHTML(lab.getHTML()); fieldTextBox = new TextBox(); fieldTextBox.setName(FILTER_TAB_DESC_PARAM); controlGroup.add(controlLabel); controlGroup.add(fieldTextBox); filterControlGroups.add(controlGroup); basicTabPanel.add(controlGroup); }
public void init() { horizontalForm.clear(); filterControlGroups.clear(); FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(CommonConstants.INSTANCE.Filter_Name()); HTML lab = new HTML("<span style=\"color:red\"> * </span>" + "<span style=\"margin-right:10px\">" + CommonConstants.INSTANCE.Filter_Name() + "</span>"); controlLabel.setHTML(lab.getHTML()); TextBox fieldTextBox = new TextBox(); fieldTextBox.setName(FILTER_NAME_PARAM); controlGroup.add(controlLabel); controlGroup.add(fieldTextBox); filterControlGroups.add(controlGroup); horizontalForm.add(controlGroup); existingFiltersPanel.clear(); existingFiltersPanel.add(existingFiltersGrid); existingFiltersGrid.loadPageSizePreferences(); existingFiltersGrid.setColumnPickerButtonVisible(false); existingFiltersGrid.setEmptyTableCaption(CommonConstants.INSTANCE.NoCustomFilterAvailable()); }
@Test public void checkInitializeFieldNamesWithModelFields() { final ModelField[] modelFields = new ModelField[]{ new ModelField("field1", String.class.getName(), ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS, ModelField.FIELD_ORIGIN.DECLARED, FieldAccessorsAndMutators.BOTH, DataType.TYPE_STRING) }; initialiseDataModelOracle(modelFields); doAnswer((invocation) -> { final int index = (int) invocation.getArguments()[0]; return modelFields[index].getName(); }).when(fieldListBox).getItemText(anyInt()); this.editor = new ActionFieldValueEditorFake(FACT_TYPE, afv, afvs, oracle, onDeleteCallback); verify(fieldListBox).setEnabled(eq(true)); verify(fieldListBox).setSelectedIndex(eq(0)); verify(valueHolder).clear(); verify(valueHolder).add(eq(widget)); }
public void init() { horizontalForm.clear(); filterControlGroups.clear(); FormGroup controlGroup = new FormGroup(); FormLabel controlLabel = new FormLabel(); controlLabel.setTitle(CommonConstants.INSTANCE.Filter_Name()); HTML lab = new HTML("<span style=\"color:red\"> * </span>" + "<span style=\"margin-right:10px\">" + CommonConstants.INSTANCE.Filter_Name() + "</span>"); controlLabel.setHTML(lab.getHTML()); TextBox fieldTextBox = new TextBox(); fieldTextBox.setName(FILTER_NAME_PARAM); controlGroup.add(controlLabel); controlGroup.add(fieldTextBox); filterControlGroups.add(controlGroup); horizontalForm.add(controlGroup); existingFiltersPanel.clear(); existingFiltersPanel.add(existingFiltersGrid); existingFiltersGrid.loadPageSizePreferences(); existingFiltersGrid.setColumnPickerButtonVisible(false); existingFiltersGrid.setEmptyTableCaption(CommonConstants.INSTANCE.NoCustomFilterAvailable()); }