当前位置: 首页>>代码示例>>Java>>正文


Java FontIcon类代码示例

本文整理汇总了Java中com.vaadin.server.FontIcon的典型用法代码示例。如果您正苦于以下问题:Java FontIcon类的具体用法?Java FontIcon怎么用?Java FontIcon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FontIcon类属于com.vaadin.server包,在下文中一共展示了FontIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ToolbarButton

import com.vaadin.server.FontIcon; //导入依赖的package包/类
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;
}
 
开发者ID:moberwasserlechner,项目名称:vaadin-medium-editor,代码行数:27,代码来源:ToolbarButton.java

示例2: convertToPresentation

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@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;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:9,代码来源:FontIconPresentationConverter.java

示例3: getDefaultPropertyConverter

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@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);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:16,代码来源:DefaultItemListing.java

示例4: getDefaultPropertyRenderer

import com.vaadin.server.FontIcon; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:18,代码来源:DefaultItemListing.java

示例5: setIcon

import com.vaadin.server.FontIcon; //导入依赖的package包/类
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));
        }
    }
}
 
开发者ID:vaadin,项目名称:material-theme-fw8,代码行数:14,代码来源:NavigationItem.java

示例6: setIcon

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@Override
public void setIcon(Resource icon) {
  if (icon != null && !(icon instanceof FontIcon)) {
    throw new IllegalArgumentException("Only FontIcons are allowed");
  }

  this.icon = (FontIcon) icon;
  markAsDirty();
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:10,代码来源:StepLabel.java

示例7: convertToPresentation

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@Override
public String convertToPresentation(FontIcon value, ValueContext context) {
	if (value != null) {
		return value.getHtml();
	}
	return null;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:8,代码来源:FontIconPresentationConverter.java

示例8: getDefaultPropertyPresenter

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@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);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:15,代码来源:DefaultPropertyListing.java

示例9: getDefaultPropertyRenderer

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@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);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:15,代码来源:DefaultPropertyListing.java

示例10: convertToPresentation

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@Override
public String convertToPresentation(FontIcon value, ValueContext context) {
	if (value == null) {
		return null;
	}

	return value.getHtml();
}
 
开发者ID:peterl1084,项目名称:bean-grid,代码行数:9,代码来源:FontIconToHtmlBeanConverter.java

示例11: getFileIconByMime

import com.vaadin.server.FontIcon; //导入依赖的package包/类
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;
}
 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:28,代码来源:FileUtil.java

示例12: getModelType

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@Override
public Class<FontIcon> getModelType() {
	return FontIcon.class;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:5,代码来源:FontIconPresentationConverter.java

示例13: convertToModel

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@Override
public FontIcon convertToModel(String value, Class<? extends FontIcon> targetType, Locale locale)
		throws com.vaadin.data.util.converter.Converter.ConversionException {
	return null;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:6,代码来源:FontIconPresentationConverter.java

示例14: StepLabel

import com.vaadin.server.FontIcon; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:61,代码来源:StepLabel.java

示例15: getIcon

import com.vaadin.server.FontIcon; //导入依赖的package包/类
@Override
public FontIcon getIcon() {
  return icon;
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:5,代码来源:StepLabel.java


注:本文中的com.vaadin.server.FontIcon类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。