@Test public void testRenderEditableHeaderPlaceHolderTextWhenEmpty() { when(headerMetaData.getPlaceHolder()).thenReturn(Optional.empty()); RendererUtils.getEditableHeaderPlaceHolderText(headerMetaData, headerContext, WIDTH, HEIGHT); verify(headerGroup, never()).add(any(IPrimitive.class)); }
public static Group getEditableHeaderPlaceHolderText(final EditableHeaderMetaData headerMetaData, final GridHeaderColumnRenderContext context, final double blockWidth, final double blockHeight) { final Group headerGroup = GWT.create(Group.class); headerMetaData.getPlaceHolder().ifPresent(placeHolder -> { final GridRenderer renderer = context.getRenderer(); final GridRendererTheme theme = renderer.getTheme(); final Text text = theme.getPlaceholderText(); text.setX(blockWidth / 2); text.setY(blockHeight / 2); text.setText(placeHolder); text.setListening(false); headerGroup.add(text); }); return headerGroup; }
RendererUtils { public static Group getEditableHeaderPlaceHolderText(final EditableHeaderMetaData headerMetaData, final GridHeaderColumnRenderContext context, final double blockWidth, final double blockHeight) { final Group headerGroup = GWT.create(Group.class); headerMetaData.getPlaceHolder().ifPresent(placeHolder -> { final GridRenderer renderer = context.getRenderer(); final GridRendererTheme theme = renderer.getTheme(); final Text text = theme.getPlaceholderText(); text.setX(blockWidth / 2); text.setY(blockHeight / 2); text.setText(placeHolder); text.setListening(false); headerGroup.add(text); }); return headerGroup; } }
RendererUtils { public static Group getEditableHeaderPlaceHolderText(final EditableHeaderMetaData headerMetaData, final GridHeaderColumnRenderContext context, final double blockWidth, final double blockHeight) { final Group headerGroup = GWT.create(Group.class); headerMetaData.getPlaceHolder().ifPresent(placeHolder -> { final GridRenderer renderer = context.getRenderer(); final GridRendererTheme theme = renderer.getTheme(); final Text text = theme.getPlaceholderText(); text.setX(blockWidth / 2); text.setY(blockHeight / 2); text.setText(placeHolder); text.setListening(false); headerGroup.add(text); }); return headerGroup; }  }
RendererUtils { public static Group getEditableHeaderPlaceHolderText(final EditableHeaderMetaData headerMetaData, final GridHeaderColumnRenderContext context, final double blockWidth, final double blockHeight) { final Group headerGroup = GWT.create(Group.class); headerMetaData.getPlaceHolder().ifPresent(placeHolder -> { final GridRenderer renderer = context.getRenderer(); final GridRendererTheme theme = renderer.getTheme(); final Text text = theme.getPlaceholderText(); text.setX(blockWidth / 2); text.setY(blockHeight / 2); text.setText(placeHolder); text.setListening(false); headerGroup.add(text); }); return headerGroup; }  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 getEditableHeaderPlaceHolderText(final EditableHeaderMetaData headerMetaData, final GridHeaderColumnRenderContext context, final double blockWidth, final double blockHeight) { final Group headerGroup = GWT.create(Group.class); headerMetaData.getPlaceHolder().ifPresent(placeHolder -> { final GridRenderer renderer = context.getRenderer(); final GridRendererTheme theme = renderer.getTheme(); final Text text = theme.getPlaceholderText(); text.setX(blockWidth / 2); text.setY(blockHeight / 2); text.setText(placeHolder); text.setListening(false); headerGroup.add(text); }); return headerGroup; }  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; }