當前位置: 首頁>>代碼示例>>Java>>正文


Java ThemeResource類代碼示例

本文整理匯總了Java中com.vaadin.server.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


注:本文中的com.vaadin.server.ThemeResource類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。