@Test public void addPropertyTypeBrowseColumn() { FieldMetadataProvider fieldMetadataProvider = objectProperty -> { if ("testField".equals(objectProperty.getName())) { ImageWrapper imageWrapper = new ImageWrapper("testUri", "testDescription"); FieldMetadata fieldMetadata = new FieldMetadata(imageWrapper); return Optional.of(fieldMetadata); } return Optional.empty(); }; Instance<FieldMetadataProvider> fieldMetadataProviderInstance = new MockInstanceImpl<>(fieldMetadataProvider); view = new DataObjectBrowserViewImpl(validationPopup, fieldMetadataProviderInstance); Column<ObjectProperty, List<ImageWrapper>> column = view.createPropertyTypeBrowseColumn(); ObjectProperty matchingObjectProperty = new ObjectPropertyImpl("testField", "className", false); List<ImageWrapper> imageWrapperList = column.getValue(matchingObjectProperty); assertEquals(1, imageWrapperList.size()); ObjectProperty nonMatchingObjectProperty = new ObjectPropertyImpl("nonMatchingTestField", "className", false); imageWrapperList = column.getValue(nonMatchingObjectProperty); assertEquals(0, imageWrapperList.size()); }
private void addPropertyTypeBrowseColumn() { propertiesTable.addColumn(createPropertyTypeBrowseColumn(), " "); }
DataObjectBrowserViewImpl extends Composite implements DataObjectBrowserView { private void addPropertyTypeBrowseColumn() { propertiesTable.addColumn(createPropertyTypeBrowseColumn(), " "); } }
DataObjectBrowserViewImpl extends Composite implements DataObjectBrowserView { private void addPropertyTypeBrowseColumn() { propertiesTable.addColumn(createPropertyTypeBrowseColumn(), " "); } @Inject  DataObjectBrowserViewImpl(final ValidationPopup validationPopup,
                                     final Instance<FieldMetadataProvider> fieldMetadataProviderInstance); }
DataObjectBrowserViewImpl extends Composite implements DataObjectBrowserView { private void addPropertyTypeBrowseColumn() { propertiesTable.addColumn(createPropertyTypeBrowseColumn(), " "); } @Inject  DataObjectBrowserViewImpl(final ValidationPopup validationPopup,
                                     final Instance<FieldMetadataProvider> fieldMetadataProviderInstance); @Override void init(Presenter presenter); @Override void setDataProvider(ListDataProvider<ObjectProperty> dataProvider); void setObjectSelectorLabel(String label,
                                       String title); void setReadonly(boolean readonly); void enableNewPropertyAction(boolean enable); @Override void enableDeleteRowAction(boolean enable); @Override void redrawRow(int row); @Override void redrawTable(); @Override ObjectProperty getSelectedRow(); @Override void setSelectedRow(ObjectProperty objectProperty,
                               boolean select); @Override void setTableHeight(int height); @Override int getTableHeight(); @Override void showBusyIndicator(String message); @Override void hideBusyIndicator(); @Override void showYesNoCancelPopup(final String title,
                                     final String content,
                                     final Command yesCommand,
                                     final String yesButtonText,
                                     final ButtonType yesButtonType,
                                     final Command noCommand,
                                     final String noButtonText,
                                     final ButtonType noButtonType,
                                     final Command cancelCommand,
                                     final String cancelButtonText,
                                     final ButtonType cancelButtonType); @Override void showValidationPopupForDeletion(List<ValidationMessage> validationMessages,
                                               Command yesCommand,
                                               Command cancelCommand); }
DataObjectBrowserViewImpl extends Composite implements DataObjectBrowserView { private void addPropertyTypeBrowseColumn() { propertiesTable.addColumn(createPropertyTypeBrowseColumn(), " "); } @Inject  DataObjectBrowserViewImpl(final ValidationPopup validationPopup,
                                     final Instance<FieldMetadataProvider> fieldMetadataProviderInstance); @Override void init(Presenter presenter); @Override void setDataProvider(ListDataProvider<ObjectProperty> dataProvider); void setObjectSelectorLabel(String label,
                                       String title); void setReadonly(boolean readonly); void enableNewPropertyAction(boolean enable); @Override void enableDeleteRowAction(boolean enable); @Override void redrawRow(int row); @Override void redrawTable(); @Override ObjectProperty getSelectedRow(); @Override void setSelectedRow(ObjectProperty objectProperty,
                               boolean select); @Override void setTableHeight(int height); @Override int getTableHeight(); @Override void showBusyIndicator(String message); @Override void hideBusyIndicator(); @Override void showYesNoCancelPopup(final String title,
                                     final String content,
                                     final Command yesCommand,
                                     final String yesButtonText,
                                     final ButtonType yesButtonType,
                                     final Command noCommand,
                                     final String noButtonText,
                                     final ButtonType noButtonType,
                                     final Command cancelCommand,
                                     final String cancelButtonText,
                                     final ButtonType cancelButtonType); @Override void showValidationPopupForDeletion(List<ValidationMessage> validationMessages,
                                               Command yesCommand,
                                               Command cancelCommand);  }