com.vaadin.client.widget.grid.RendererCellReference Java Examples

The following examples show how to use com.vaadin.client.widget.grid.RendererCellReference. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HtmlLabelRenderer.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void render(RendererCellReference cell, String input, VLabel label) {
    Map<String, String> map = formatInput(input);
    String value = map.containsKey("value") ? map.get("value") : null;
    String style = map.containsKey("style") ? map.get("style") : null;
    String title = map.containsKey("title") ? map.get("title") : null;
    String id = map.containsKey("id") ? map.get("id") : null;

    if (value != null) {
        label.setHTML("<span>&#x" + Integer.toHexString(Integer.parseInt(value)) + ";</span>");
    } else {
        label.setHTML("<span></span>");
    }
    applyStyle(label, style);
    label.getElement().setId(id);
    label.getElement().setTitle(title);
}
 
Example #2
Source File: RolloutRenderer.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void render(RendererCellReference cell, RolloutRendererData text, VButton button) {
    final String creating = "CREATING";
    button.setText(text.getName());
    applystyle(button);
    // this is to allow the button to disappear, if the text is null
    button.setVisible(text.getName() != null);
    button.getElement().setId(new StringBuilder("link").append(".").append(text.getName()).toString());
    /*
     * checking Rollout Status for applying button style. If Rollout status
     * is not "CREATING", then the Rollout button is applying hyperlink
     * style
     */
    final boolean isStatusCreate = text.getStatus() != null && creating.equalsIgnoreCase(text.getStatus());
    if (isStatusCreate) {
        button.addStyleName(getStyle("boldhide"));
        button.setEnabled(false);
    } else {
        button.setEnabled(true);
    }
}
 
Example #3
Source File: CubaImageRenderer.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void render(RendererCellReference cell, String url, Image image) {
    super.render(cell, url, image);
    if (url == null) {
        image.getElement().getStyle().setDisplay(Style.Display.NONE);
    }
}
 
Example #4
Source File: CubaIconRenderer.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void render(RendererCellReference cell, Icon icon) {
    if (icon instanceof ImageIcon) {
        // onload will set appropriate size later
        icon.setWidth("0");
        icon.setHeight("0");
    }

    Element iconElement = icon.getElement();
    cell.getElement().setInnerHTML(getOuterHtml(iconElement));

}
 
Example #5
Source File: HtmlButtonRenderer.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void render(final RendererCellReference cell, final String text, final Button button) {
    final boolean buttonEnable = isButtonEnable(cell.getElement().getClassName());
    if (text != null) {
        button.setHTML(text);
    }
    applystyles(button, buttonEnable);
    // this is to allow the button to disappear, if the text is null
    button.setVisible(text != null);
    button.getElement().setId(UIComponentIdProvider.ROLLOUT_ACTION_ID + "." + cell.getColumnIndex());
    button.setEnabled(buttonEnable);
}
 
Example #6
Source File: GridButtonRenderer.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void render(final RendererCellReference cell, final FontIconData iconMetadata, final Button button) {
    if (iconMetadata.getFontIconHtml() != null) {
        button.setHTML(iconMetadata.getFontIconHtml());
    }
    applyStyles(button, iconMetadata.isDisabled(), iconMetadata.getStyle());
    button.getElement().setId(iconMetadata.getId());
    button.getElement().setTitle(iconMetadata.getTitle());
    button.setEnabled(!iconMetadata.isDisabled());
    // this is to allow the button to disappear, if the text is null
    button.setVisible(iconMetadata.getFontIconHtml() != null);
}
 
Example #7
Source File: VBooleanRenderer.java    From vaadin-grid-util with MIT License 5 votes vote down vote up
@Override
public void render(final RendererCellReference cell, final Boolean data) {
	String output = "<center><span class=\"v-icon v-grid-cell-boolean ";
	if (data != null) {
		output = output + (data ? "boolean-true" : "boolean-false");
	} else {
		output = output + "boolean-null";
	}
	output = output + "\"></span></center>";
	cell.getElement()
			.setInnerHTML(output);
}
 
Example #8
Source File: CubaCheckBoxRenderer.java    From cuba with Apache License 2.0 4 votes vote down vote up
@Override
public void render(RendererCellReference cell, Boolean data) {
    cell.getElement().setInnerHTML(getHtmlString(data));
}
 
Example #9
Source File: CubaClickableTextRenderer.java    From cuba with Apache License 2.0 4 votes vote down vote up
@Override
public void render(RendererCellReference cell, String text, InlineHTML inlineHTML) {
    inlineHTML.setText(text);
}
 
Example #10
Source File: VButtonValueRenderer.java    From vaadin-grid-util with MIT License 4 votes vote down vote up
@Override
public void render(final RendererCellReference cell, final String text, final FlowPanel panel) {
	((HTML) panel.getWidget(1)).setHTML(text);
}
 
Example #11
Source File: VIndicatorRenderer.java    From vaadin-grid-util with MIT License 4 votes vote down vote up
@Override
public void render(RendererCellReference cell, Double data,
    VIndicator indicator) {
    indicator.setValue(data, startGreen, startRed);
}