微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

com.vaadin.server.FontIcon的实例源码

项目:vaadin-medium-editor    文件ToolbarButton.java   
private ToolbarButton(ToolbarButtonBuilder builder) {
    FontIcon icon = builder.icon;
    if (icon != null) {
        contentFA = icon.getHtml();
        if (builder.iconText != null) {
            contentFA += builder.iconText;
        }
    }
    contentDefault = builder.iconFallback;
    if (builder.customTranslation) {
        aria = builder.aria;
    } else {
        // get buildin translations
        aria = builder.toolbarBuilder.getoptionsBuilder().getTranslation(builder.aria);
    }
    name = builder.name;
    action = builder.action;
    if (action == null) {
        action = name;
    }
    tagNames = builder.tagNames;
    style = builder.style;
    useQueryState = builder.useQueryState;
    classList = builder.classList;
    attrs = builder.attrs;
}
项目:holon-vaadin7    文件FontIconPresentationConverter.java   
@Override
public String convertToPresentation(FontIcon value,Class<? extends String> targettype,Locale locale)
        throws com.vaadin.data.util.converter.Converter.ConversionException {
    if (value != null) {
        return value.getHtml();
    }
    return null;
}
项目:holon-vaadin7    文件DefaultItemListing.java   
@SuppressWarnings({ "unchecked","rawtypes" })
protected Optional<Converter<?,?>> getDefaultPropertyConverter(final P property) {
    Converter<?,?> converter = null;
    Class<?> type = getPropertyColumnType(property);
    // FontIcons
    if (type != null && FontIcon.class.isAssignableFrom(type)) {
        converter = new FontIconPresentationConverter();
    } else {
        // Use default property presentation converter
        if (Property.class.isAssignableFrom(property.getClass())) {
            converter = new PropertyPresentationConverter<>((Property) property);
        }
    }
    return Optional.ofNullable(converter);
}
项目: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();
}
项目:material-theme-fw8    文件NavigationItem.java   
public void setIcon(Resource source) {
    if (source == null) {
        this.icon.setVisible(false);
    } else {
        this.icon.setVisible(true);
        this.icon.removeAllComponents();
        if (source instanceof FontIcon) {
            this.icon.addComponent(new Label(((FontIcon) source).getHtml(),ContentMode.HTML));
        } else {
            this.icon.addComponent(new Image(null,source));
        }
    }
}
项目:md-stepper    文件StepLabel.java   
@Override
public void setIcon(Resource icon) {
  if (icon != null && !(icon instanceof FontIcon)) {
    throw new IllegalArgumentException("Only FontIcons are allowed");
  }

  this.icon = (FontIcon) icon;
  markAsDirty();
}
项目:holon-vaadin    文件FontIconPresentationConverter.java   
@Override
public String convertToPresentation(FontIcon value,ValueContext context) {
    if (value != null) {
        return value.getHtml();
    }
    return null;
}
项目:holon-vaadin    文件DefaultPropertyListing.java   
@SuppressWarnings("unchecked")
@Override
protected Optional<ValueProvider<?,?>> getDefaultPropertyPresenter(Property property) {
    if (property != null) {
        if (Component.class.isAssignableFrom(property.getType())) {
            return Optional.empty();
        }
        if (FontIcon.class.isAssignableFrom(property.getType())) {
            return Optional.of(v -> ((FontIcon) v).getHtml());
        }
        return Optional.of(v -> property.present(v));
    }
    return super.getDefaultPropertyPresenter(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);
}
项目:bean-grid    文件FontIconToHtmlBeanConverter.java   
@Override
public String convertToPresentation(FontIcon value,ValueContext context) {
    if (value == null) {
        return null;
    }

    return value.getHtml();
}
项目:extacrm    文件FileUtil.java   
public static FontIcon getFileIconByMime(final String mimeType) {
    // Todo: Move to map
    if (!isNullOrEmpty(mimeType)) {
        if (mimeType.startsWith("image/"))
            return Fontello.FILE_IMAGE;
        else if (mimeType.equals("application/pdf"))
            return Fontello.FILE_PDF;
        else if (mimeType.equals("application/vnd.ms-excel")
                || mimeType.equals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))
            return Fontello.FILE_EXCEL;
        else if (mimeType.equals("application/msword")
                || mimeType.equals("application/vnd.openxmlformats-officedocument.wordprocessingml.document"))
            return Fontello.FILE_WORD;
        else if (mimeType.equals("application/vnd.ms-powerpoint")
                || mimeType.equals("application/vnd.openxmlformats-officedocument.presentationml.presentation"))
            return Fontello.FILE_POWERPOINT;
        else if (mimeType.equals("application/zip")
                || mimeType.equals("application/x-rar-compressed")
                || mimeType.equals("application/x-gzip"))
            return Fontello.FILE_ARCHIVE;
        else if (mimeType.startsWith("audio/"))
            return Fontello.FILE_AUdio;
        else if (mimeType.startsWith("video/"))
            return Fontello.FILE_VIDEO;
    }
    return Fontello.FILE_CODE;
}
项目:holon-vaadin7    文件FontIconPresentationConverter.java   
@Override
public Class<FontIcon> getModelType() {
    return FontIcon.class;
}
项目:holon-vaadin7    文件FontIconPresentationConverter.java   
@Override
public FontIcon convertToModel(String value,Class<? extends FontIcon> targettype,Locale locale)
        throws com.vaadin.data.util.converter.Converter.ConversionException {
    return null;
}
项目:md-stepper    文件StepLabel.java   
/**
 * Construct a new label with the given caption,description and icon.
 *
 * @param caption
 *     The caption to show
 * @param description
 *     The description to show
 * @param icon
 *     The icon to show
 */
public StepLabel(String caption,String description,FontIcon icon) {
  active = false;
  nexted = false;
  skipped = false;
  editable = false;
  clickable = false;

  iconLabel = new Label();
  iconLabel.setWidthUndefined();
  iconLabel.setContentMode(ContentMode.HTML);
  iconLabel.addStyleName(STYLE_STEP_ICON);

  captionLabel = new Label();
  captionLabel.setWidth(100,Unit.PERCENTAGE);
  captionLabel.addStyleName(STYLE_STEP_CAPTION);

  descriptionLabel = new Label();
  descriptionLabel.setWidth(100,Unit.PERCENTAGE);
  descriptionLabel.addStyleName(ValoTheme.LABEL_LIGHT);
  descriptionLabel.addStyleName(ValoTheme.LABEL_SMALL);
  descriptionLabel.addStyleName(STYLE_STEP_DESCRIPTION);

  captionWrapper = new VerticalLayout();
  captionWrapper.setSpacing(false);
  captionWrapper.setMargin(false);
  captionWrapper.setSizefull();
  captionWrapper.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
  captionWrapper.addComponent(captionLabel);
  captionWrapper.addComponent(descriptionLabel);

  rootLayout = new HorizontalLayout();
  rootLayout.setSpacing(false);
  rootLayout.setMargin(false);
  rootLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
  rootLayout.setWidth(100,Unit.PERCENTAGE);
  rootLayout.addComponent(iconLabel);
  rootLayout.addComponent(captionWrapper);
  rootLayout.setExpandratio(captionWrapper,1);

  setCompositionRoot(rootLayout);
  addStyleName(STYLE_ROOT_LAYOUT);
  setIcon(icon);
  setCaption(caption);
  setDescription(description);

  setIconNexted(DEFAULT_ICON_NEXTED);
  setIconSkipped(DEFAULT_ICON_SKIPPED);
  setIconEditable(DEFAULT_ICON_EDITABLE);
  setIconError(DEFAULT_ICON_ERROR);
}
项目:md-stepper    文件StepLabel.java   
@Override
public FontIcon getIcon() {
  return icon;
}
项目:md-stepper    文件TextIcon.java   
@Override
public String getMIMEType() {
  throw new UnsupportedOperationException(FontIcon.class.getSimpleName()
                                          + " should not be used where a MIME type is needed.");
}
项目:holon-vaadin    文件FontIconPresentationConverter.java   
@Override
public Result<FontIcon> convertToModel(String value,ValueContext context) {
    return null;
}
项目:bean-grid    文件TestBean.java   
@GridColumn(translationKey = "",defaultOrder = 0)
public FontIcon getIcon() {
    return VaadinIcons.VAADIN_H;
}
项目:bean-grid    文件FontIconToHtmlBeanConverter.java   
@Override
public Result<FontIcon> convertToModel(String value,ValueContext context) {
    throw new UnsupportedOperationException("Conversion is not supported from HTML to FontIcon");
}
项目:bean-grid    文件BeangridFontIconValueProvider.java   
@Override
public Converter<String,FontIcon> getConverter() {
    return converter;
}
项目:vaadin-grid-util    文件GridCellFilter.java   
public BooleanRepresentation(Boolean value,FontIcon icon,String caption) {
    this.value = value;
    this.icon = icon;
    this.caption = caption;
}
项目:vaadin-grid-util    文件GridCellFilter.java   
public FontIcon getIcon() {
    return icon;
}
项目:vaadin-grid-util    文件Inhabitants.java   
Gender(FontIcon icon) {
    this.icon = icon;
}
项目:vaadin-grid-util    文件Inhabitants.java   
public FontIcon getIcon() {
    return icon;
}
项目:vaadin-stackpanel    文件StackPanel.java   
public void setToggleDownIcon(FontIcon toggleDownIcon) {
    getState().setToggleDownHtml(toggleDownIcon.getHtml());
}
项目:vaadin-stackpanel    文件StackPanel.java   
public void setToggleUpIcon(FontIcon toggleUpIcon) {
    getState().setToggleUpHtml(toggleUpIcon.getHtml());
}
项目:viritin    文件disclosurePanel.java   
public FontIcon getClosedIcon() {
    return closedIcon;
}
项目:viritin    文件disclosurePanel.java   
public disclosurePanel setClosedIcon(FontIcon closedIcon) {
    this.closedIcon = closedIcon;
    return setopen(isopen());
}
项目:viritin    文件disclosurePanel.java   
public FontIcon getopenIcon() {
    return openIcon;
}
项目:viritin    文件disclosurePanel.java   
public disclosurePanel setopenIcon(FontIcon openIcon) {
    this.openIcon = openIcon;
    return setopen(isopen());
}
项目:mycollab    文件MetaFieldBuilder.java   
public MetaFieldBuilder withCaptionAndIcon(FontIcon icon,String caption) {
    captionHtml = icon.getHtml() + " " + StringUtils.trim(caption,20,true);
    return this;
}
项目:md-stepper    文件StepLabel.java   
/**
 * Get the icon for the label that is shown if it is <code><b>NEXTED</b></code>.
 *
 * @return The icon that is shown
 */
public FontIcon getIconNexted() {
  return iconNexted;
}
项目:md-stepper    文件StepLabel.java   
/**
 * Set the icon that is shown if it is <code><b>NEXTED</b></code>.
 *
 * @param iconNexted
 *     The icon to be shown
 */
public void setIconNexted(FontIcon iconNexted) {
  Objects.requireNonNull(iconNexted,"icon may not be null");
  this.iconNexted = iconNexted;
}
项目:md-stepper    文件StepLabel.java   
/**
 * Get the icon that is shown if it is <code><b>SKIPPED</b></code>.
 *
 * @return The icon that is shown
 */
public FontIcon getIconSkipped() {
  return iconSkipped;
}
项目:md-stepper    文件StepLabel.java   
/**
 * Set the icon that is shown if it is <code><b>SKIPPED</b></code>.
 *
 * @param iconSkipped
 *     The icon to be shown
 */
public void setIconSkipped(FontIcon iconSkipped) {
  Objects.requireNonNull(iconSkipped,"icon may not be null");
  this.iconSkipped = iconSkipped;
}
项目:md-stepper    文件StepLabel.java   
/**
 * Get the icon for the label that is shown if it is <code><b>EDITABLE</b></code>.
 *
 * @return The icon that is shown
 */
public FontIcon getIconEditable() {
  return iconEditable;
}
项目:md-stepper    文件StepLabel.java   
/**
 * Set the icon that is shown if it is <code><b>EDITABLE</b></code>.
 *
 * @param iconEditable
 *     The icon to be shown
 */
public void setIconEditable(FontIcon iconEditable) {
  Objects.requireNonNull(iconEditable,"icon may not be null");
  this.iconEditable = iconEditable;
}
项目:md-stepper    文件StepLabel.java   
/**
 * Get the icon for the label that is shown if it is <code><b>ERRONEOUS</b></code>.
 *
 * @return The icon that is shown
 */
public FontIcon getIconError() {
  return iconError;
}
项目:md-stepper    文件StepLabel.java   
/**
 * Set the icon that is shown if it is <code><b>ERRONEOUS</b></code>.
 *
 * @param iconError
 *     The icon to be shown
 */
public void setIconError(FontIcon iconError) {
  Objects.requireNonNull(iconError,"icon may not be null");
  this.iconError = iconError;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。