@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); } }
private void initialiseValue() { final Widget editor = valueEditorFactory().getValueEditor(className, afv.getFieldName(), afv, oracle, false); valueHolder.clear(); if (editor != null) { valueHolder.add(editor); } }
@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)); }
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); }