Examples of AbstractComponent


Examples of com.vaadin.ui.AbstractComponent

        component.removeStyleName(" style1  style3 ");
        assertEquals(component.getStyleName(), "style2");
    }

    public void testSetWithExtraSpaces() {
        AbstractComponent component = getComponent();
        component.setStyleName(" style1  style2 ");
        assertEquals(component.getStyleName(), "style1 style2");
    }
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

        component.setStyleName(" style1  style2 ");
        assertEquals(component.getStyleName(), "style1 style2");
    }

    private AbstractComponent getComponent() {
        return new AbstractComponent() {
        };
    }
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

    protected void setup(VaadinRequest request) {
        GridLayout layout = new GridLayout(5, 5);
        setContent(layout);
        for (Class<? extends Component> cls : VaadinClasses.getComponents()) {
            try {
                AbstractComponent c = (AbstractComponent) cls.newInstance();
                if (c instanceof LegacyWindow) {
                    continue;
                }

                c.setId(cls.getName());
                c.setCaption(cls.getName());
                c.setDescription(cls.getName());
                c.setWidth("100px");
                c.setHeight("100px");
                layout.addComponent(c);
                System.out.println("Added " + cls.getName());
            } catch (Exception e) {
                System.err.println("Could not instatiate " + cls.getName());
            }
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

        // extra layout from which components will be moved
        final HorizontalLayout source = new HorizontalLayout();
        source.addComponent(new Label("OTHER LABEL 1"));
        source.addComponent(new Label("OTHER LABEL 2"));

        final AbstractComponent c1 = new Label("<b>LABEL</b>", ContentMode.HTML);
        final AbstractComponent c2 = new Label("<b>LABEL</b>", ContentMode.HTML);
        final AbstractComponent c3 = new Table("TABLE");
        c3.setHeight("100px");
        c3.setWidth("100%");

        final Button btnAdd = new Button("Test add");
        final Button btnReplace = new Button("Test replace");
        final Button btnMove = new Button("Test move");
        final Button btnRemove = new Button("Test remove");
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

            List<Class<? extends Component>> components) {
        HorizontalLayout layout = new HorizontalLayout();
        layout.setCaption(caption);
        for (Class<? extends Component> cls : components) {
            try {
                AbstractComponent c = (AbstractComponent) cls.newInstance();
                if (firstDownloadComponent == null) {
                    firstDownloadComponent = c;
                }

                c.setId(cls.getName() + caption.replace(" ", ""));
                c.setCaption(cls.getName());
                c.setDescription(resource.getMIMEType() + " / "
                        + resource.getClass());
                c.setWidth("100px");
                c.setHeight("100px");

                layout.addComponent(c);

                new FileDownloader(resource).extend(c);
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

        final HorizontalLayout source = new HorizontalLayout();
        source.addComponent(new Label("OTHER LABEL 1"));
        source.addComponent(new Label("OTHER LABEL 2"));

        final AbstractComponent c1 = new Label("<b>LABEL</b>", ContentMode.HTML);
        final AbstractComponent c2 = new Label("<b>LABEL</b>", ContentMode.HTML);
        final AbstractComponent c3 = new Table("TABLE");
        c3.setHeight("100px");
        c3.setWidth("100%");

        final Button btnAdd = new Button("Test add");
        final Button btnReplace = new Button("Test replace");
        final Button btnMove = new Button("Test move");
        final Button btnRemove = new Button("Test remove");
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

    protected void getLayoutForLayoutSizing(final String compType) {

        layout.setSpacing(false);
        layout.setMargin(false);

        final AbstractComponent c1 = getTestTable();
        c1.setSizeFull();
        final AbstractComponent c2 = getTestTable();
        c2.setSizeFull();

        class SetSizeButton extends Button {
            SetSizeButton(final String size) {
                super();
                setCaption("Set size " + size);
                addClickListener(new ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        if (compType == "layout") {
                            layout.setHeight(size);
                            layout.setWidth(size);
                        } else if (compType == "component") {
                            c2.setHeight(size);
                            c2.setWidth(size);
                        } else {
                        }

                    }
                });
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

        GridLayout l = new GridLayout(3, 1);
        l.setCaption("Buttons");
        l.setMargin(true);
        l.setSpacing(true);

        AbstractComponent b = new Button("Normal Button");
        b.setDescription("This is a tooltip!");
        l.addComponent(b);

        b = new NativeButton("Native Button");
        b.setDescription("<h2><img src=\"/html/VAADIN/themes/runo/icons/16/globe.png\"/>A richtext tooltip</h2>"
                + "<ul>"
                + "<li>HTML formatting</li><li>Images<br/>"
                + "</li><li>etc...</li></ul>");
        l.addComponent(b);

        b = new CheckBox("Checkbox");
        l.addComponent(b);

        b = new Button("Disabled");
        b.setEnabled(false);
        l.addComponent(b);

        b = new NativeButton("Disabled");
        b.setEnabled(false);
        l.addComponent(b);

        b = new CheckBox("Disabled");
        b.setEnabled(false);
        l.addComponent(b);

        b = new Button("OK");
        b.setIcon(ICON_OK);
        l.addComponent(b);

        b = new NativeButton("OK");
        b.setIcon(ICON_OK);
        l.addComponent(b);

        b = new CheckBox("OK");
        b.setIcon(ICON_OK);
        l.addComponent(b);

        b = new Button("Link Button");
        b.setStyleName(LiferayTheme.BUTTON_LINK);
        l.addComponent(b);

        b = new NativeButton("Link Button");
        b.setStyleName(LiferayTheme.BUTTON_LINK);
        l.addComponent(b);

        l.newLine();

        b = new Button("Link Button");
        b.setIcon(ICON_OK);
        b.setStyleName(LiferayTheme.BUTTON_LINK);
        l.addComponent(b);

        b = new NativeButton("Link Button");
        b.setIcon(ICON_OK);
        b.setStyleName(LiferayTheme.BUTTON_LINK);
        l.addComponent(b);

        return l;
    }
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

                    IndexedContainer container = new IndexedContainer();
                    container.addContainerProperty("caption", String.class, "");
                    Iterator<Component> componentIterator = l
                            .getComponentIterator();
                    while (componentIterator.hasNext()) {
                        AbstractComponent next = (AbstractComponent) componentIterator
                                .next();
                        Item item = container.addItem(next);

                        String caption = next.getClass().getSimpleName();

                        caption += "; cap: " + next.getCaption() + "; debugid"
                                + getId();

                        if (next instanceof Property) {
                            caption += " value:"
                                    + ((Property<?>) next).getValue();
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

    }

    private Component newTestComponent() {
        Class<?> componentClass = (Class<?>) ns2.getValue();
        AbstractComponent newInstance = null;
        try {
            newInstance = (AbstractComponent) componentClass.newInstance();
        } catch (InstantiationException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if (componentClass == Label.class) {
            ((Label) newInstance).setValue("Test l " + (i++));
            ((Label) newInstance).setSizeUndefined();
        } else {
            newInstance.setCaption("Test l " + (i++));
        }
        return newInstance;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.