Java ThemeResource类代码示例

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


Java ThemeResource类代码示例

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

示例1: createEditFields

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
@Override
protected ComponentContainer createEditFields() {
    final ExtaFormLayout form = new ExtaFormLayout();

    appTitleField = new EditField("Заголовок приложения");
    form.addComponent(appTitleField);

    iconPathField = new ComboBox("Иконка приложения");
    for (final String icon : lookup(UserSettingsService.class).getFaviconPathList()) {
        iconPathField.addItem(icon);
        iconPathField.setItemIcon(icon, new ThemeResource(getLast(Splitter.on('/').split(icon))));
    }
    iconPathField.setItemCaptionMode(AbstractSelect.ItemCaptionMode.ICON_ONLY);
    iconPathField.setWidth(85, Unit.PIXELS);
    iconPathField.setTextInputAllowed(false);
    iconPathField.setNullSelectionAllowed(false);
    form.addComponent(iconPathField);

    isShowSalePointIdsField = new MCheckBox("Показывать раздел \"Идентификация\" в карточке торговой точки");
    form.addComponent(isShowSalePointIdsField);

    isDevServerField = new MCheckBox("Режим отладки");
    form.addComponent(isDevServerField);

    return form;
} 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:27,代码来源:MainSettingsForm.java

示例2: getLegendLineLayout

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
/**
 * @param txtCode
 * @return une ligne de légende
 */
private HorizontalLayout getLegendLineLayout(String txtCode) {
	HorizontalLayout hlLineLegend = new HorizontalLayout();
	hlLineLegend.setWidth(100, Unit.PERCENTAGE);
	hlLineLegend.setSpacing(true);

	Image flagImg = new Image(null, new ThemeResource("images/icon/Flag-" + txtCode + "-icon.png"));
	Label label = new Label(applicationContext.getMessage("formation.table.flagEtat.tooltip." + txtCode, null,
			UI.getCurrent().getLocale()));
	hlLineLegend.addComponent(flagImg);
	hlLineLegend.setComponentAlignment(flagImg, Alignment.MIDDLE_LEFT);
	hlLineLegend.addComponent(label);
	hlLineLegend.setComponentAlignment(label, Alignment.MIDDLE_LEFT);
	hlLineLegend.setExpandRatio(label, 1);
	return hlLineLegend;
} 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:20,代码来源:CtrCandFormationView.java

示例3: buildToolbarButton

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
/**
 * @param toolbar
 *            HorizontalLayout which contains all the action Buttons
 * @param toolbarButton
 *            Which Tool bar button to create (Provided using ENUM constant)
 * @param listner
 *            Click listener called when this button is clicked
 * @return
 */

public static Button buildToolbarButton(HorizontalLayout toolbar, ToolbarButtons toolbarButton,
        ClickListener listner) {
    Button button = new Button(toolbarButton.getText());
    button.addStyleName(StyleConstants.BUTTON_TOOLBAR);
    button.setDescription(toolbarButton.getTooltip());
    button.setStyleName(ValoTheme.BUTTON_LINK);
    if (StringUtils.isNotEmpty(toolbarButton.getImageLocation())) {
        button.setIcon(new ThemeResource(toolbarButton.getImageLocation()), toolbarButton.toString());
    }
    button.setEnabled(false);
    button.setId(toolbarButton.getId());
    button.addClickListener(listner);
    toolbar.addComponent(button);
    return button;
} 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:26,代码来源:ViewUtil.java

示例4: createHeader

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
@SuppressWarnings("serial")
private HorizontalLayout createHeader(String title) {
    HorizontalLayout header = ViewUtil.createSubHeader(title, getSubViewHelpGuid());
    Button refresh = new Button();
    refresh.setStyleName(Reindeer.BUTTON_LINK);
    refresh.setDescription("Refresh");
    refresh.setIcon(new ThemeResource("img/Refresh.png"));
    refresh.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            populateTable();
        }
    });
    header.addComponent(refresh);
    return header;
} 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:17,代码来源:CRUDBaseSubView.java

示例5: createDataSource

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
private Container createDataSource() {
	Container languageItems = new IndexedContainer();
	languageItems.addContainerProperty("icon", ThemeResource.class, null);
	languageItems.addContainerProperty("caption", String.class, "");

	fillItem(languageItems.addItem(Locale.ENGLISH), "English", "en");
	fillItem(languageItems.addItem(new Locale("pl")), "Polski", "pl");

	return languageItems;
} 
开发者ID:Horuss,项目名称:bbplay,代码行数:11,代码来源:LanguageComboBox.java

示例6: createDummyData

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
public static List<StaticCustomer> createDummyData() {
    LinkedList<StaticCustomer> list = new LinkedList<>();

    for (int i = 1; i <= 10000; i++) {

        StaticCustomer customer = new StaticCustomer();
        customer.setId(i);
        customer.setFirstName(testData.getFirstName());
        customer.setLastName(testData.getLastName());
        NativeSelect foodSelect = new NativeSelect(null, Arrays.asList(StaticCustomer.Food.values()));
        foodSelect.setValue(testData.getItem(StaticCustomer.Food.values()));
        customer.setFood(foodSelect);
        customer.setPhoto(new ThemeResource("../demotheme/demophotos/cat"
                                            + testData.getNumberBetween(1, 4)
                                            + ".jpg"));

        list.add(customer);
    }
    return list;
} 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:21,代码来源:StaticCustomerProvider.java

示例7: createDummyData

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
public static List<Customer> createDummyData() {
    LinkedList<Customer> list = new LinkedList<>();

    for (int i = 1; i <= 10000; i++) {

        Customer customer = new Customer();
        customer.setId(i);
        customer.setFirstName(testData.getFirstName());
        customer.setLastName(testData.getLastName());
        customer.setFood(testData.getItem(Customer.Food.values()));
        customer.setPhoto(new ThemeResource("../demotheme/demophotos/cat"
                                            + testData.getNumberBetween(1, 4)
                                            + ".jpg"));

        list.add(customer);
    }
    return list;
} 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:19,代码来源:CustomerProvider.java

示例8: createImageChild

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
private Component createImageChild() {
    String resourceName;
    switch (childCounter.incrementAndGet() % 4) {
        case 1:
            resourceName = "images/goldenbridge2.jpg";
            break;
        case 2:
            resourceName = "images/chavatar.png";
            break;
        case 3:
            resourceName = "images/goldenbridge.jpg";
            break;
        default:
            resourceName = "images/redwood.jpg";
            break;
    }

    ScaleImage image = new ScaleImage(new ThemeResource(resourceName));
    image.addStyleName("simple-cover");
    image.setSizeFull();
    return GridStackStyling.createPaperItemWrapper(image);
} 
开发者ID:alump,项目名称:GridStack,代码行数:23,代码来源:SimpleView.java

示例9: getIcon

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
/**
 * Gets getIcon corresponding to given localization key.
 * @param key The localization key.
 * @return The localized getIcon.
 */
public Resource getIcon(final String key) {
    if (PropertiesUtil.hasProperty("icon", key)) {
        final String value = PropertiesUtil.getProperty("icon", key).trim();
        if (value.startsWith("FontAwesome.")) {
            final String iconName = value.substring(value.indexOf('.') + 1);
            for (final FontAwesome icon : FontAwesome.values()) {
                if (icon.name().equals(iconName)) {
                    return icon;
                }
            }
            throw new IllegalArgumentException("No such icon in FontAwesome: " + iconName);
        } else {
            return new ThemeResource("icons/" + value + ".png");
        }

    }
    return new ThemeResource("icons/" + key + ".png");
} 
开发者ID:bubblecloud,项目名称:ilves,代码行数:24,代码来源:Site.java

示例10: createAddResidueMenu

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
public void createAddResidueMenu(MenuItem parent) {
	String notation=theCanvas.getWorkspace().getGlycanRenderer().getGraphicOptions().NOTATION;
	
	MenuItem structureMenu=parent.addItem("Add residue", null);

	for (String superclass : ResidueDictionary.getSuperclasses()) {
		MenuItem superClassMenu=structureMenu.addItem(superclass,null);
		for (ResidueType t : ResidueDictionary.getResidues(superclass)) {
			if (t.canHaveParent()){
				superClassMenu.addItem(t.getName(), new Command(){
					private static final long serialVersionUID=4750928193466060500L;

					@Override
					public void menuSelected(MenuItem selectedItem) {
						theCanvas.addResidueByNameToSelected(selectedItem.getText());
					}		
				}).setIcon(new ThemeResource("icons"+File.separator+"residues"+File.separator+notation+File.separator+t.getName()+".png"));
			}		
		}
		
		if(superClassMenu.getChildren()==null){
			structureMenu.removeChild(superClassMenu);
		}
	}
} 
开发者ID:alternativeTime,项目名称:GlycanBuilderVaadin7Version,代码行数:26,代码来源:VaadinGlycanCanvas.java

示例11: createChangeResidueMenu

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
private void createChangeResidueMenu(MenuItem parent) {
	MenuItem structureMenu=parent.addItem("Change residue", null);

	String notation=theCanvas.getWorkspace().getGlycanRenderer().getGraphicOptions().NOTATION;
	
	for (String superclass : ResidueDictionary.getSuperclasses()) {
		MenuItem superClassMenu=structureMenu.addItem(superclass,null);
		for (ResidueType t : ResidueDictionary.getResidues(superclass)){
			superClassMenu.addItem(t.getName(), new Command(){
				private static final long serialVersionUID=-7886271503255704127L;

				@Override
				public void menuSelected(MenuItem selectedItem) {
					theCanvas.changeSelectedToResidueByName(selectedItem.getText());
				}
			}).setIcon(new ThemeResource("icons"+File.separator+"residues"+File.separator+notation+File.separator+t.getName()+".png"));
		}
		if(superClassMenu.getChildren()==null){
			structureMenu.removeChild(superClassMenu);
		}
	}
	
	structureMenu.setEnabled(false);
	menuItemsWithResidueSelectionDependency.add(structureMenu);
} 
开发者ID:alternativeTime,项目名称:GlycanBuilderVaadin7Version,代码行数:26,代码来源:VaadinGlycanCanvas.java

示例12: buildUserMenu

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
private Component buildUserMenu() {
	final User user = getCurrentUser();

	final MenuBar settings = new MenuBar();
	settings.addStyleName("user-menu");
	settingsItem = settings.addItem("", new ThemeResource("img/profile-pic-300px.jpg"), null);

	if (!User.GUEST.equals(user)) {
		settingsItem.addItem(Messages.getString("Caption.Menu.EditProfile"),
				e -> userSettingsWindowPresenter.showWindow(user));

		settingsItem.addSeparator();
	}

	String itemCaption = Messages.getString("Caption.Menu.Logout");
	if (User.GUEST.equals(user)) {
		itemCaption = Messages.getString("Caption.Menu.LoginOther");
		user.setUsername(Messages.getString("Caption.User.Guest"));
	}

	settingsItem.addItem(itemCaption, e -> mainEvent.fire(new MainUIEvent.UserLoggedOutEvent()));

	updateUserName();

	return settings;
} 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:27,代码来源:HypothesisMenuPresenter.java

示例13: initLayoutHeader

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
private void initLayoutHeader() {
    headerLayout.setWidth("100%");
    headerLayout.setHeight("80px");
    headerLayout.setId("header");

    Link rdfunit = new Link("",
            new ExternalResource("http://rdfunit.aksw.org/"));
    rdfunit.setIcon(new ThemeResource("images/logo-rdfunit.png"));

    headerLayout.addComponent(rdfunit);

    Link aksw = new Link("",
            new ExternalResource("http://aksw.org/"));
    aksw.setIcon(new ThemeResource("images/logo-aksw.png"));
    aksw.addStyleName("align-right");
    headerLayout.addComponent(aksw);
} 
开发者ID:AKSW,项目名称:RDFUnit,代码行数:18,代码来源:RDFUnitDemo.java

示例14: Tabsheet

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
public Tabsheet() {
    TabBarView tabBarView = new TabBarView();

    tabBarView.addTab(getTable(), "First", new ThemeResource(
            "../runo/icons/64/folder.png"));
    tabBarView.addTab(getDateSelector(), "Other", new ThemeResource(
            "../runo/icons/64/document.png"));
    tabBarView.addTab(getComboBox(), "Third", new ThemeResource(
            "../runo/icons/64/document-pdf.png"));
    Tab tab = tabBarView.addTab(getFields(), "4th", new ThemeResource(
            "../runo/icons/64/email.png"));
    tabBarView.setSelectedTab(tab);

    makeSmallTabletSize(tabBarView);
    addComponent(tabBarView);

} 
开发者ID:vaadin,项目名称:touchkit,代码行数:18,代码来源:Tabsheet.java

示例15: AboutView

import com.vaadin.server.ThemeResource; //导入依赖的package包/类
public AboutView() {
	setCaption(Messages.getString("aboutTitle")); //$NON-NLS-1$
	setModal(true);
	setResizable(false);
	center();
	VerticalLayout main = new VerticalLayout();
	Resource logoResource = new ThemeResource("img/omc-logo.png"); //$NON-NLS-1$
	Image appLogoImage = new Image("",logoResource); //$NON-NLS-1$
	Label appLabel = new Label(appName + " v." + version); //$NON-NLS-1$
	Label developerLabel = new Label(developer);
   	Link githubLink = new Link(github, new ExternalResource(github));

	main.addComponents(appLogoImage, appLabel, developerLabel, githubLink);
	main.setComponentAlignment(appLabel, Alignment.MIDDLE_CENTER);
	main.setComponentAlignment(developerLabel, Alignment.MIDDLE_CENTER);
	main.setComponentAlignment(githubLink, Alignment.MIDDLE_CENTER);

	setContent(main);
} 
开发者ID:mwolski89,项目名称:own-music-cloud,代码行数:20,代码来源:AboutView.java

本文标签属性:

示例:示例是什么意思

代码:代码大全可复制

java:javascript什么意思

ThemeResource:ThemeResource

上一篇:Java ColumnModel类代码示例
下一篇:C# BuildingBlock类代码示例

为您推荐