Java 类com.vaadin.ui.renderers.Renderer 实例源码

项目:holon-vaadin7    文件:DefaultItemListing.java   
/**
 * Get the default {@link Renderer} for given <code>property</code>.
 * @param property Property
 * @return The default {@link Renderer}, if available
 */
protected Optional<Renderer<?>> getDefaultPropertyRenderer(P property) {
    Class<?> type = getPropertyColumnType(property);
    // Images
    if (type != null
            && (ExternalResource.class.isAssignableFrom(type) || ThemeResource.class.isAssignableFrom(type))) {
        return Optional.of(new ImageRenderer());
    }
    if (type != null && FontIcon.class.isAssignableFrom(type)) {
        return Optional.of(new HtmlRenderer(""));
    }
    return Optional.empty();
}
项目:holon-vaadin7    文件:DefaultGridPropertyListingBuilder.java   
@Override
public <T, P> GridPropertyListingBuilder render(Property<T> property, Converter<P, T> converter,
        Renderer<? super P> renderer) {
    ObjectUtils.argumentNotNull(property, "Property must be not null");
    getInstance().getPropertyColumn(property).setConverter(converter);
    getInstance().getPropertyColumn(property).setRenderer(renderer);
    return builder();
}
项目:holon-vaadin7    文件:DefaultGridItemListingBuilder.java   
@Override
public <V, P> GridItemListingBuilder<T> render(String property, Converter<V, P> converter,
        Renderer<? super P> renderer) {
    ObjectUtils.argumentNotNull(property, "Property must be not null");
    getInstance().getPropertyColumn(property).setConverter(converter);
    getInstance().getPropertyColumn(property).setRenderer(renderer);
    return builder();
}
项目:esup-ecandidat    文件:GridFormatting.java   
/**
 * AJoute un renderer à une colonne
 * 
 * @param propertyId
 * @param renderer
 */
public void setColumnRenderer(String propertyId, Renderer<?> renderer) {
    Column col = getColumn(propertyId);
    if (col == null) {
        return;
    }
    col.setRenderer(renderer);
}
项目:vaadin-gridexport    文件:DefaultGridHolder.java   
@Override
public HorizontalAlignment getCellAlignment(final String propId) {
    final Renderer<?> renderer = getRenderer(propId);
    if (renderer != null) {
        if (ExcelExport.isNumeric(renderer.getPresentationType())) {
            return HorizontalAlignment.RIGHT;
        }
    }
    return defaultAlignment;
}
项目:vaadin-gridexport    文件:DefaultGridHolder.java   
protected Renderer<?> getRenderer(final String propId) {
    // Grid.Column (as of 8.0.3) does not expose its renderer, we have to get it from extensions
    final Column<T, ?> column = getColumn(propId);
    if (column != null) {
        for (Extension each : column.getExtensions()) {
            if (each instanceof Renderer<?>) {
                return (Renderer<?>) each;
            }
        }
    }
    return null;
}
项目:vaadin-gridexport    文件:DefaultGridHolder.java   
@Override
public Class<?> getPropertyType(final String propId) {
    Renderer<?> renderer = getRenderer(propId);
    if (renderer != null) {
        return renderer.getPresentationType();
    } else {
        return String.class;
    }
}
项目:holon-vaadin    文件:DefaultItemListing.java   
/**
 * Get the renderer to use with given property id.
 * @param property Property id
 * @return Optional property renderer
 */
protected Optional<Renderer<?>> getPropertyRenderer(P property) {
    Optional<Renderer<?>> propertyRenderer = getPropertyColumn(property).getRenderer();
    if (propertyRenderer.isPresent()) {
        return propertyRenderer;
    }
    return getDefaultPropertyRenderer(property);
}
项目:holon-vaadin    文件:DefaultPropertyListing.java   
@Override
protected Optional<Renderer<?>> getDefaultPropertyRenderer(Property property) {
    if (Component.class.isAssignableFrom(property.getType())) {
        return Optional.of(new ComponentRenderer());
    }
    if (FontIcon.class.isAssignableFrom(property.getType())) {
        return Optional.of(new HtmlRenderer(""));
    }
    if (ExternalResource.class.isAssignableFrom(property.getType())
            || ThemeResource.class.isAssignableFrom(property.getType())) {
        return Optional.of(new ImageRenderer());
    }
    return super.getDefaultPropertyRenderer(property);
}
项目:holon-vaadin    文件:DefaultGridPropertyListingBuilder.java   
@Override
public <T, P> GridPropertyListingBuilder render(Property<T> property, ValueProvider<T, P> presentationProvider,
        Renderer<? super P> renderer) {
    ObjectUtils.argumentNotNull(property, "Property must be not null");
    getInstance().getPropertyColumn(property).setPresentationProvider(presentationProvider);
    getInstance().getPropertyColumn(property).setRenderer(renderer);
    return builder();
}
项目:holon-vaadin    文件:DefaultGridItemListingBuilder.java   
@Override
public <V, P> GridItemListingBuilder<T> render(String property, ValueProvider<V, P> presentationProvider,
        Renderer<? super P> renderer) {
    ObjectUtils.argumentNotNull(property, "Property must be not null");
    getInstance().getPropertyColumn(property).setPresentationProvider(presentationProvider);
    getInstance().getPropertyColumn(property).setRenderer(renderer);
    return builder();
}
项目:cuba    文件:WebNumberRenderer.java   
@Override
protected Renderer<Number> createImplementation() {
    if (numberFormat != null) {
        return new NumberRenderer(numberFormat, getNullRepresentation());
    } else {
        checkNotNullArgument(formatString, "Format string may not be null");
        checkNotNullArgument(locale, "Locale may not be null");
        return new NumberRenderer(formatString, locale, getNullRepresentation());
    }
}
项目:cuba    文件:WebImageRenderer.java   
@Override
protected Renderer createImplementation() {
    if (listener != null) {
        return new CubaImageRenderer(createClickListenerWrapper(listener));
    } else {
        return new CubaImageRenderer();
    }
}
项目:cuba    文件:WebClickableTextRenderer.java   
@Override
protected Renderer<String> createImplementation() {
    if (listener != null) {
        return new CubaClickableTextRenderer(createClickListenerWrapper(listener), getNullRepresentation());
    } else {
        return new CubaClickableTextRenderer(getNullRepresentation());
    }
}
项目:holon-vaadin7    文件:DefaultGridPropertyListingBuilder.java   
@Override
public <T> GridPropertyListingBuilder render(Property<T> property, Renderer<? super T> renderer) {
    ObjectUtils.argumentNotNull(property, "Property must be not null");
    getInstance().getPropertyColumn(property).setRenderer(renderer);
    return builder();
}
项目:holon-vaadin7    文件:DefaultGridItemListingBuilder.java   
@Override
public GridItemListingBuilder<T> render(String property, Renderer<?> renderer) {
    ObjectUtils.argumentNotNull(property, "Property must be not null");
    getInstance().getPropertyColumn(property).setRenderer(renderer);
    return builder();
}
项目:holon-vaadin7    文件:DefaultPropertyColumn.java   
/**
 * {@inheritDoc}
 */
@Override
public Renderer<?> getRenderer() {
    return renderer;
}
项目:holon-vaadin7    文件:DefaultPropertyColumn.java   
/**
 * {@inheritDoc}
 */
@Override
public void setRenderer(Renderer<?> renderer) {
    this.renderer = renderer;
}
项目:holon-vaadin    文件:DefaultGridPropertyListingBuilder.java   
@Override
public <T> GridPropertyListingBuilder render(Property<T> property, Renderer<? super T> renderer) {
    ObjectUtils.argumentNotNull(property, "Property must be not null");
    getInstance().getPropertyColumn(property).setRenderer(renderer);
    return builder();
}
项目:holon-vaadin    文件:DefaultGridItemListingBuilder.java   
@Override
public GridItemListingBuilder<T> render(String property, Renderer<?> renderer) {
    ObjectUtils.argumentNotNull(property, "Property must be not null");
    getInstance().getPropertyColumn(property).setRenderer(renderer);
    return builder();
}
项目:holon-vaadin    文件:DefaultPropertyColumn.java   
@Override
public Optional<Renderer<?>> getRenderer() {
    return Optional.ofNullable(renderer);
}
项目:holon-vaadin    文件:DefaultPropertyColumn.java   
@Override
public void setRenderer(Renderer<?> renderer) {
    this.renderer = renderer;
}
项目:cuba    文件:WebCheckBoxRenderer.java   
@Override
protected Renderer<Boolean> createImplementation() {
    return new CubaCheckBoxRenderer();
}
项目:cuba    文件:WebComponentRenderer.java   
@Override
protected Renderer<com.vaadin.ui.Component> createImplementation() {
    return new ComponentRenderer();
}
项目:holon-vaadin7    文件:PropertyColumn.java   
/**
 * Gets the {@link Renderer} to use to display column value
 * @return The {@link Renderer} to use to display column value
 */
Renderer<?> getRenderer();
项目:holon-vaadin7    文件:PropertyColumn.java   
/**
 * Sets the {@link Renderer} to use to display column value
 * @param renderer The {@link Renderer} to use to display column value
 */
void setRenderer(Renderer<?> renderer);
项目:holon-vaadin7    文件:ItemListingBuilder.java   
/**
 * Set a custom {@link Renderer} for given item property.
 * @param property Item property to set the renderer for (not null)
 * @param renderer Renderer to use
 * @return this
 */
GridItemListingBuilder<T> render(String property, Renderer<?> renderer);
项目:holon-vaadin7    文件:ItemListingBuilder.java   
/**
 * Set a custom {@link Renderer} and {@link Converter} for given item property.
 * @param <V> Property value type
 * @param <P> Presentation value type
 * @param property Item property to set the renderer for
 * @param converter Conveter to use
 * @param renderer Renderer to use
 * @return this
 */
<V, P> GridItemListingBuilder<T> render(String property, Converter<V, P> converter,
        Renderer<? super P> renderer);
项目:holon-vaadin7    文件:PropertyListingBuilder.java   
/**
 * Set a custom {@link Renderer} for given item property.
 * @param <T> Property type
 * @param property Item property to set the renderer for (not null)
 * @param renderer Renderer to use
 * @return this
 */
<T> GridPropertyListingBuilder render(Property<T> property, Renderer<? super T> renderer);
项目:holon-vaadin7    文件:PropertyListingBuilder.java   
/**
 * Set a custom {@link Renderer} and {@link Converter} for given item property.
 * @param <T> Property type
 * @param <P> Presentation value type
 * @param property Item property to set the renderer for
 * @param converter Value converter
 * @param renderer Renderer to use
 * @return this
 */
<T, P> GridPropertyListingBuilder render(Property<T> property, Converter<P, T> converter,
        Renderer<? super P> renderer);
项目:holon-vaadin    文件:PropertyColumn.java   
/**
 * Gets the {@link Renderer} to use to display column value
 * @return The {@link Renderer} to use to display column value
 */
Optional<Renderer<?>> getRenderer();
项目:holon-vaadin    文件:PropertyColumn.java   
/**
 * Sets the {@link Renderer} to use to display column value
 * @param renderer The {@link Renderer} to use to display column value
 */
void setRenderer(Renderer<?> renderer);
项目:holon-vaadin    文件:DefaultItemListing.java   
/**
 * Get the default property {@link Renderer} to use for given property value.
 * @param property Property id
 * @return Optional default editor renderer
 */
protected Optional<Renderer<?>> getDefaultPropertyRenderer(P property) {
    return Optional.empty();
}
项目:holon-vaadin    文件:ItemListingBuilder.java   
/**
 * Set a custom {@link Renderer} for given item property.
 * @param property Item property to set the renderer for (not null)
 * @param renderer Renderer to use
 * @return this
 */
GridItemListingBuilder<T> render(String property, Renderer<?> renderer);
项目:holon-vaadin    文件:ItemListingBuilder.java   
/**
 * Set a custom {@link Renderer} and presentation provider for given item property.
 * @param <V> Property value type
 * @param <P> Presentation value type
 * @param property Item property to set the renderer for
 * @param presentationProvider Presentation provider
 * @param renderer Renderer to use
 * @return this
 */
<V, P> GridItemListingBuilder<T> render(String property, ValueProvider<V, P> presentationProvider,
        Renderer<? super P> renderer);
项目:holon-vaadin    文件:PropertyListingBuilder.java   
/**
 * Set a custom {@link Renderer} for given item property.
 * @param <T> Property type
 * @param property Item property to set the renderer for (not null)
 * @param renderer Renderer to use
 * @return this
 */
<T> GridPropertyListingBuilder render(Property<T> property, Renderer<? super T> renderer);
项目:holon-vaadin    文件:PropertyListingBuilder.java   
/**
 * Set a custom {@link Renderer} and presentation provider for given item property.
 * @param <T> Property type
 * @param <P> Presentation value type
 * @param property Item property to set the renderer for
 * @param presentationProvider Presentation provider
 * @param renderer Renderer to use
 * @return this
 */
<T, P> GridPropertyListingBuilder render(Property<T> property, ValueProvider<T, P> presentationProvider,
        Renderer<? super P> renderer);
项目:bean-grid    文件:BeanGridValueProvider.java   
/**
 * @param definition
 *            that can be used to configure the renderer if needed.
 * @return new {@link Renderer} instance that can be used to visualize the
 *         value provided by this {@link BeanGridValueProvider}
 */
Renderer<?> getRenderer(ColumnDefinition definition);