@Test public void testRenderHeaderContentWithInformationItemCell() { final InformationItemCell.HasNameAndDataTypeCell informationItemCell = mock(InformationItemCell.HasNameAndDataTypeCell.class); final Name name = new Name(TITLE); when(informationItemCell.getName()).thenReturn(name); when(informationItemCell.getTypeRef()).thenReturn(TYPE_REF); when(informationItemCell.hasData()).thenReturn(true); RendererUtils.getNameAndDataTypeCellText(informationItemCell, bodyContext); assertHasNameAndDataTypeRendering(); }
public static Group getNameAndDataTypeCellText(final InformationItemCell.HasNameAndDataTypeCell hasNameAndDataTypeCell, final GridBodyCellRenderContext context) { if (!hasNameAndDataTypeCell.hasData()) { final BaseGridCellValue<String> cell = new BaseGridCellValue<>(null, hasNameAndDataTypeCell.getPlaceHolderText()); return getCenteredCellText(context, new BaseGridCell<>(cell)); } return getNameAndDataTypeText(context.getRenderer().getTheme(), hasNameAndDataTypeCell.getName().getValue(), hasNameAndDataTypeCell.getTypeRef(), context.getCellWidth(), context.getCellHeight()); }
RendererUtils { public static Group getNameAndDataTypeCellText(final InformationItemCell.HasNameAndDataTypeCell hasNameAndDataTypeCell, final GridBodyCellRenderContext context) { if (!hasNameAndDataTypeCell.hasData()) { final BaseGridCellValue<String> cell = new BaseGridCellValue<>(null, hasNameAndDataTypeCell.getPlaceHolderText()); return getCenteredCellText(context, new BaseGridCell<>(cell)); } return getNameAndDataTypeText(context.getRenderer().getTheme(), hasNameAndDataTypeCell.getName().getValue(), hasNameAndDataTypeCell.getTypeRef(), context.getCellWidth(), context.getCellHeight()); } }
RendererUtils { public static Group getNameAndDataTypeCellText(final InformationItemCell.HasNameAndDataTypeCell hasNameAndDataTypeCell, final GridBodyCellRenderContext context) { if (!hasNameAndDataTypeCell.hasData()) { final BaseGridCellValue<String> cell = new BaseGridCellValue<>(null, hasNameAndDataTypeCell.getPlaceHolderText()); return getCenteredCellText(context, new BaseGridCell<>(cell)); } return getNameAndDataTypeText(context.getRenderer().getTheme(), hasNameAndDataTypeCell.getName().getValue(), hasNameAndDataTypeCell.getTypeRef(), context.getCellWidth(), context.getCellHeight()); }  }
RendererUtils { public static Group getNameAndDataTypeCellText(final InformationItemCell.HasNameAndDataTypeCell hasNameAndDataTypeCell, final GridBodyCellRenderContext context) { if (!hasNameAndDataTypeCell.hasData()) { final BaseGridCellValue<String> cell = new BaseGridCellValue<>(null, hasNameAndDataTypeCell.getPlaceHolderText()); return getCenteredCellText(context, new BaseGridCell<>(cell)); } return getNameAndDataTypeText(context.getRenderer().getTheme(), hasNameAndDataTypeCell.getName().getValue(), hasNameAndDataTypeCell.getTypeRef(), context.getCellWidth(), context.getCellHeight()); }  static Group getExpressionCellText(final GridBodyCellRenderContext context,
                                              final GridCell<String> gridCell); static Group getCenteredCellText(final GridBodyCellRenderContext context,
                                            final GridCell<String> gridCell); static Group getNameAndDataTypeCellText(final InformationItemCell.HasNameAndDataTypeCell hasNameAndDataTypeCell,
                                                   final GridBodyCellRenderContext context); static Group getExpressionHeaderText(final EditableHeaderMetaData headerMetaData,
                                                final GridHeaderColumnRenderContext context); static Group getValueAndDataTypeHeaderText(final ValueAndDataTypeHeaderMetaData headerMetaData,
                                                      final GridHeaderColumnRenderContext context,
                                                      final double blockWidth,
                                                      final double blockHeight); static Group getEditableHeaderText(final EditableHeaderMetaData headerMetaData,
                                              final GridHeaderColumnRenderContext context,
                                              final double blockWidth,
                                              final double blockHeight); static Group getEditableHeaderPlaceHolderText(final EditableHeaderMetaData headerMetaData,
                                                         final GridHeaderColumnRenderContext context,
                                                         final double blockWidth,
                                                         final double blockHeight); static double getExpressionTextLineHeight(final GridRendererTheme theme); }
RendererUtils { public static Group getNameAndDataTypeCellText(final InformationItemCell.HasNameAndDataTypeCell hasNameAndDataTypeCell, final GridBodyCellRenderContext context) { if (!hasNameAndDataTypeCell.hasData()) { final BaseGridCellValue<String> cell = new BaseGridCellValue<>(null, hasNameAndDataTypeCell.getPlaceHolderText()); return getCenteredCellText(context, new BaseGridCell<>(cell)); } return getNameAndDataTypeText(context.getRenderer().getTheme(), hasNameAndDataTypeCell.getName().getValue(), hasNameAndDataTypeCell.getTypeRef(), context.getCellWidth(), context.getCellHeight()); }  static Group getExpressionCellText(final GridBodyCellRenderContext context,
                                              final GridCell<String> gridCell); static Group getCenteredCellText(final GridBodyCellRenderContext context,
                                            final GridCell<String> gridCell); static Group getNameAndDataTypeCellText(final InformationItemCell.HasNameAndDataTypeCell hasNameAndDataTypeCell,
                                                   final GridBodyCellRenderContext context); static Group getExpressionHeaderText(final EditableHeaderMetaData headerMetaData,
                                                final GridHeaderColumnRenderContext context); static Group getValueAndDataTypeHeaderText(final ValueAndDataTypeHeaderMetaData headerMetaData,
                                                      final GridHeaderColumnRenderContext context,
                                                      final double blockWidth,
                                                      final double blockHeight); static Group getEditableHeaderText(final EditableHeaderMetaData headerMetaData,
                                              final GridHeaderColumnRenderContext context,
                                              final double blockWidth,
                                              final double blockHeight); static Group getEditableHeaderPlaceHolderText(final EditableHeaderMetaData headerMetaData,
                                                         final GridHeaderColumnRenderContext context,
                                                         final double blockWidth,
                                                         final double blockHeight); static double getExpressionTextLineHeight(final GridRendererTheme theme); static final double EXPRESSION_TEXT_PADDING; static final String FONT_STYLE_TYPE_REF; static final double SPACING; }