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


Java ClassResource类代码示例

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


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

示例1: FileExample

import com.vaadin.server.ClassResource; //导入依赖的package包/类
public FileExample() {
    setCaption("Interactive SVG");
    addComponent(new MLabel(
            "A simple example from an svg file using Embedded component. Unlike with Image component, the SVGs JS etc are active. The example also demonstrates how to provide a trivial server side integration API for the SVG."));
    Embedded svg = new Embedded();
    svg.setWidth("400px");
    svg.setHeight("400px");
    svg.setSource(new ClassResource("/pull.svg"));

    // Expose a JS hook that pull.svg file calls when clicked
    JavaScript.getCurrent().addFunction("callMyVaadinFunction", (JsonArray arguments) -> {
        Notification.show("Message from SVG:" + arguments.getString(0));
    });

    addComponent(svg);
}
 
开发者ID:mstahv,项目名称:svgexamples,代码行数:17,代码来源:FileExample.java

示例2: SimplyAsAnImageOrIcon

import com.vaadin.server.ClassResource; //导入依赖的package包/类
public SimplyAsAnImageOrIcon() {
    setCaption("Image and icon");
    addComponent(new MLabel("Following Image component (rendered as IMG element) contains SVG image. Note, that by using SVG in this way, it is treated as a static image. For eample the js changing the color on click is not executed. See the file example to see how to render an interactive SVG.").withFullWidth());
    Image image = new Image(null, new ClassResource("/pull.svg"));
    image.setWidth("300px");
    addComponent(image);
    
    addComponent(new MLabel("Following Button has SVG logo as an icon.").withFullWidth());
    
    Button button = new Button();
    button.setIcon(new ClassResource("/vaadin-logo.svg"));
    button.addStyleNames(ValoTheme.BUTTON_ICON_ONLY, ValoTheme.BUTTON_HUGE);
    addComponent(button);
}
 
开发者ID:mstahv,项目名称:svgexamples,代码行数:15,代码来源:SimplyAsAnImageOrIcon.java

示例3: extendMenu

import com.vaadin.server.ClassResource; //导入依赖的package包/类
@Override
public void extendMenu(MenuBar menuBar, SharedProject project) {

	Command commit = createCommitCommand();
	Command github = createGitHubCommand();
	
	MenuItem gitItem = menuBar.addItem("Git", null);

	if (commit != null) {
		gitItem.addItem("Commit", commit);
	}
	
	if (github != null) {
		gitHubItem = gitItem.addItem("GitHub", github);
		gitHubItem.setIcon(new ClassResource("/org/vaadin/addon/oauthpopupbuttons/icons/github16.png"));
		gitHubItem.setEnabled(repo.hasCommit());
	}
}
 
开发者ID:ahn,项目名称:mideaas,代码行数:19,代码来源:GitPlugin.java

示例4: sourceGenerationExecuted

import com.vaadin.server.ClassResource; //导入依赖的package包/类
@Override
public void sourceGenerationExecuted(final Source source, final TestGenerationType generationType, final long testsCreated) {
    UI.getCurrent().access(() -> {
        Item item = resultsTable.getItem(source);
        if (testsCreated == 0 || item == null)
            return;

        String column = (generationType.equals(TestGenerationType.AutoGenerated) ? "Automatic" : "Manual");
        Property<Link> statusProperty = item.getItemProperty(column);
        String fileName;
        if (generationType.equals(TestGenerationType.AutoGenerated)) {
            fileName = CacheUtils.getSourceAutoTestFile(RDFUnitDemoSession.getBaseDir() + "tests/", source);
            statusProperty.setValue(new Link("" + testsCreated, new FileResource(new File(fileName))));
        } else {
            fileName = CacheUtils.getSourceManualTestFile("/org/aksw/rdfunit/tests/", source);
            statusProperty.setValue(new Link("" + testsCreated, new ClassResource(fileName)));
        }
        CommonAccessUtils.pushToClient();
    });

}
 
开发者ID:AKSW,项目名称:RDFUnit,代码行数:22,代码来源:TestGenerationView.java

示例5: AnimationExample

import com.vaadin.server.ClassResource; //导入依赖的package包/类
public AnimationExample() {
	setCaption("Animation");
	addComponent(new MLabel(
			"A simple example from an svg file. Also demonstrates SVG animations.").withFullWidth());
	Embedded svg = new Embedded();
	svg.setWidth("800px");
	svg.setHeight("400px");
	svg.setSource(new ClassResource("/svg2009.svg"));
	addComponent(svg);
}
 
开发者ID:mstahv,项目名称:svgexamples,代码行数:11,代码来源:AnimationExample.java

示例6: getRotatedMarkers

import com.vaadin.server.ClassResource; //导入依赖的package包/类
private LLayerGroup getRotatedMarkers() {
    LLayerGroup layerGroup = new LLayerGroup();

    Point p1 = new GeometryFactory().createPoint(new Coordinate(8.622, 45.819));
    Point p2 = new GeometryFactory().createPoint(new Coordinate(8.54724, 45.73686));
    Point p3 = new GeometryFactory().createPoint(new Coordinate(8.49243, 45.74453));

    LRotatedMarker rotatedMarker1 = new LRotatedMarker(p1);
    rotatedMarker1.setRotationAngle(35.0);
    rotatedMarker1.setPopup("35° rotated marker");

    LRotatedMarker rotatedMarker2 = new LRotatedMarker(p2);
    rotatedMarker2.setIcon(new ClassResource("testicon.png"));
    rotatedMarker2.setIconSize(new org.vaadin.addon.leaflet.shared.Point(24,24));
    rotatedMarker2.setRotationAngle(75.5);
    rotatedMarker2.setRotationOrigin("bottom right");
    rotatedMarker2.setPopup("75.5° rotated marker");

    LRotatedMarker rotatedMarker3 = new LRotatedMarker(p3);
    rotatedMarker3.setRotationAngle(225.2);
    rotatedMarker3.setPopup("225.2° rotated marker");

    layerGroup.addComponent(rotatedMarker1);
    layerGroup.addComponent(rotatedMarker2);
    layerGroup.addComponent(rotatedMarker3);

    return layerGroup;
}
 
开发者ID:octavm,项目名称:v-leaflet-rotatedmarker-parent,代码行数:29,代码来源:RotatedMarkerTest.java

示例7: showDetails

import com.vaadin.server.ClassResource; //导入依赖的package包/类
private void showDetails(Product product) {
    FreemarkerLayout productLayout = new FreemarkerLayout();
    productLayout.setTemplateFileName("templates/product-details.html");
    productLayout.setDataModel(product);
    productLayout.addComponent(new Image(null, new ClassResource(product.getImage())), "image");

    Window window = new Window("Details", productLayout);
    window.setModal(true);
    window.setResizable(false);
    UI.getCurrent().addWindow(window);
}
 
开发者ID:alejandro-du,项目名称:freemarker-layout,代码行数:12,代码来源:ProductsTable.java

示例8: createActionButton1

import com.vaadin.server.ClassResource; //导入依赖的package包/类
private Component createActionButton1() {
    Button button = new Button(null, this);
    button.setIcon(new ThemeResource("../runo/icons/64/email.png"));

    button.setIcon(new ClassResource("mail.png"));
    return button;
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:8,代码来源:NavPanelTestWithViews.java

示例9: TwitterButton

import com.vaadin.server.ClassResource; //导入依赖的package包/类
public TwitterButton(String key, String secret) {
	super(TwitterApi.class, key, secret);
	
	setIcon(new ClassResource("/org/vaadin/addon/oauthpopup/icons/twitter16.png"));
	setCaption("Twitter");
}
 
开发者ID:ahn,项目名称:vaadin-oauthpopup,代码行数:7,代码来源:TwitterButton.java

示例10: FacebookButton

import com.vaadin.server.ClassResource; //导入依赖的package包/类
public FacebookButton(String key, String secret) {
	super(FacebookApi.class, key, secret);
	
	setIcon(new ClassResource("/org/vaadin/addon/oauthpopup/icons/facebook16.png"));
	setCaption("Facebook");
}
 
开发者ID:ahn,项目名称:vaadin-oauthpopup,代码行数:7,代码来源:FacebookButton.java

示例11: LinkedInButton

import com.vaadin.server.ClassResource; //导入依赖的package包/类
public LinkedInButton(String key, String secret) {
	super(LinkedInApi.class, key, secret);
	
	setIcon(new ClassResource("/org/vaadin/addon/oauthpopup/icons/linkedin16.png"));
	setCaption("LinkedIn");
}
 
开发者ID:ahn,项目名称:vaadin-oauthpopup,代码行数:7,代码来源:LinkedInButton.java

示例12: GitHubButton

import com.vaadin.server.ClassResource; //导入依赖的package包/类
public GitHubButton(String key, String secret) {
	super(GitHubApi.class, key, secret);
	
	setIcon(new ClassResource("/org/vaadin/addon/oauthpopup/icons/github16.png"));
	setCaption("GitHub");
}
 
开发者ID:ahn,项目名称:vaadin-oauthpopup,代码行数:7,代码来源:GitHubButton.java


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