Package com.vaadin.ui

Examples of com.vaadin.ui.Component


            @Override
            protected String getCss(Component c) {
                return "display: block; padding:20px; border: 2px dotted black; background: #aaa;";
            }
        };
        Component l = new Label("Drag file on me");
        l.setSizeUndefined();
        cssLayout.addComponent(l);
        DragAndDropWrapper dragAndDropWrapper = new DragAndDropWrapper(
                cssLayout);
        dragAndDropWrapper.setSizeUndefined();
        dragAndDropWrapper.setDropHandler(new DropHandler() {
View Full Code Here


            public void valueChange(ValueChangeEvent event) {
                Testable t = (Testable) select.getValue();
                if (t != null) {
                    testPanelLayout.removeAllComponents();
                    try {
                        Component c = t.getComponent();
                        if (c != null) {
                            testPanelLayout.addComponent(c);
                        }
                    } catch (InstantiationException e) {
                        // TODO Auto-generated catch block
View Full Code Here

                            @Override
                            public Component getComponent()
                                    throws InstantiationException,
                                    IllegalAccessException {

                                Component c = super.getComponent();

                                VerticalLayout pl = new VerticalLayout();
                                pl.setMargin(true);
                                Panel p = new Panel(
                                        "Wrapper panel (400px*400px)", pl);
                                p.setContent(new VerticalLayout());
                                p.setWidth("400px");
                                p.setHeight("400px");
                                pl.addComponent(c);
                                p.addStyleName("testablew");
                                p.addStyleName("testable");
                                return p;
                            }

                        };
                        t.addConfiguration(new Configuration("100%*100%") {
                            @Override
                            void configure(Component c) {
                                c.setSizeFull();
                            }

                        });
                        cont.addItem(t);
                    }
View Full Code Here

            @Override
            public void buttonClick(ClickEvent event) {
                Random randomGenerator = new Random();
                int random = randomGenerator.nextInt(3);
                Component component;
                if (random % 3 == 0) {
                    component = new Label("A new label");
                } else if (random % 3 == 1) {
                    component = new Button("A button!");
                } else {
View Full Code Here

        return wrap(gl, "GridLayout");
    }

    protected void logLayoutClick(String layout, LayoutClickEvent event) {
        String target = "<none>";
        Component component = event.getChildComponent();
        if (component != null) {
            target = component.getCaption();
            if (target == null && component instanceof Label) {
                target = ((Label) component).getValue().toString();
            }
        }
        String button = event.getButtonName();
View Full Code Here

                    @Override
                    public void buttonClick(ClickEvent event) {
                        for (Iterator<Component> i = layout
                                .getComponentIterator(); i.hasNext();) {
                            final Component c = i.next();
                            if (c.isEnabled()) {
                                c.setEnabled(false);
                                c.setCaption(c.getCaption().replace("enabled",
                                        "disabled"));
                            } else {
                                c.setEnabled(true);
                                c.setCaption(c.getCaption().replace("disabled",
                                        "enabled"));
                            }
                        }
                        if (layout.getComponent(0).isEnabled()) {
                            enableDisableComponentsButton
View Full Code Here

                Transferable ctr = event.getTransferable();
                if (ctr.getSourceComponent() != null) {
                    // use "component" (from DragDropPane) if available, else
                    // take
                    // the source component
                    Component component = (Component) ctr.getData("component");
                    if (component == null) {
                        component = ctr.getSourceComponent();
                    }

                    if (component.getParent() != layout) {
                        if (ctr instanceof DataBoundTransferable) {
                            // Item has been dragged, construct a Label from
                            // Item id
                            Label l = new Label();
                            l.setSizeUndefined();
View Full Code Here

        WrapperTargetDetails ed = (WrapperTargetDetails) event
                .getTargetDetails();
        Transferable ctr = event.getTransferable();
        // use "component" (from DragDropPane) if available, else take
        // the source component
        Component component = null;
        if (ctr instanceof WrapperTransferable) {
            component = ((WrapperTransferable) ctr).getDraggedComponent();
        } else if (ctr instanceof DataBoundTransferable) {
            // Item has been dragged, construct a Label from
            // Item id
            Label l = new Label();
            l.setSizeUndefined();
            l.setValue("ItemId : " + ((DataBoundTransferable) ctr).getItemId());
            component = l;
        }

        if (component != null) {

            if (component.getParent() != root) {

                root.addComponent(component);

                Integer left = ed.getAbsoluteLeft();
                Integer top = ed.getAbsoluteTop();
View Full Code Here

            tf.setImmediate(true);
            tf.addListener(new ValueChangeListener() {

                @Override
                public void valueChange(ValueChangeEvent event) {
                    Component c = ((Component) event.getProperty());
                    c.setCaption("askfdj");

                }
            });
            if (r.nextBoolean()) {
                tf.setCaption("Caption");
View Full Code Here

        i.getItemProperty(CAPTION).setValue(locale.toString());

    }

    protected void setDateFieldLocale(Locale value) {
        Component n = getCustomFormats(value);
        if (customFormats == null) {
            addComponent(n);
        } else {
            replaceComponent(customFormats, n);
        }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Component

Copyright © 2018 www.massapicom. 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.