Package com.vaadin.ui

Examples of com.vaadin.ui.Component$Event


         * @throws InstantiationException
         * @throws IllegalAccessException
         */
        public Component getComponent() throws InstantiationException,
                IllegalAccessException {
            Component c = (Component) classToTest.newInstance();

            if (c instanceof Button) {
                ((AbstractComponent) c).setCaption("test");
            }
            if (AbstractSelect.class.isAssignableFrom(c.getClass())) {
                if (c instanceof Table) {
                    Table new_name = (Table) c;
                    new_name.setContainerDataSource(TestForTablesInitialColumnWidthLogicRendering
                            .getTestTable(5, 100).getContainerDataSource());

View Full Code Here


        }

        // Iteration should be in indexed order
        int idx = 0;
        for (Iterator<Component> i = aol.getComponentIterator(); i.hasNext();) {
            Component c = i.next();
            assert (aol.getComponentIndex(c) == idx++);
        }
    }
View Full Code Here

        button.setErrorHandler(new NotificationErrorHandler());
        return button;
    }

    protected static String getErrorMessage(com.vaadin.server.ErrorEvent event) {
        Component c = DefaultErrorHandler.findAbstractComponent(event);
        String errorMsg = "Error: '" + getMessage(event) + "' in ";
        errorMsg += c.getClass().getSimpleName() + " with caption '"
                + c.getCaption() + "'";
        return errorMsg;
    }
View Full Code Here

    @Override
    protected void init(VaadinRequest request) {

        // Create a text editor
        Component editor = createEditor("Lorem ipsum dolor sit amet, lacus pharetra sed, sit a "
                + "tortor. Id aliquam lorem pede, orci ut enim metus, diam nulla mi "
                + "suspendisse tempor tortor. Eleifend lorem proin, morbi vel diam ut. "
                + "Tempor est tellus vitae, pretium condimentum facilisis sit. Sagittis "
                + "quam, ac urna eros est cras id cras, eleifend eu mattis nec."
                + "Lorem ipsum dolor sit amet, lacus pharetra sed, sit a "
View Full Code Here

            public void drop(DragAndDropEvent event) {
                WrapperTargetDetails ed = (WrapperTargetDetails) event
                        .getTargetDetails();
                Transferable transferable = event.getTransferable();
                TransferableImpl ctr = (TransferableImpl) transferable;
                Component component = ctr.getSourceComponent();
                if (component == wrapper) {
                    // if the drag source was wrapper we are interested about
                    // the dragged component
                    WrapperTransferable tr = (WrapperTransferable) transferable;
                    component = tr.getDraggedComponent();
                    // html5 drag created by wrapper set component null
                }

                if (component != null) {

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

                 */

                if (dropEvent.getTransferable() instanceof WrapperTransferable) {
                    WrapperTransferable transferable = (WrapperTransferable) dropEvent
                            .getTransferable();
                    Component sourceComponent = transferable
                            .getSourceComponent();

                    Component draggedComponent = transferable
                            .getDraggedComponent();

                    DropTarget target = dropEvent.getTargetDetails()
                            .getTarget();

                    WrappedLabel wrappedLabel = new WrappedLabel(
                            draggedComponent.toString());
                    if (target instanceof WrappedLabel) {
                        int i = 1; // add next to reference by default
                        Iterator<Component> componentIterator = cssLayout
                                .getComponentIterator();
                        Component next = componentIterator.next();
                        while (next != target && componentIterator.hasNext()) {
                            if (next != sourceComponent) {
                                // don't count on index if component is being
                                // moved
                                i++;
View Full Code Here

                // // TODO Auto-generated catch block
                // e.printStackTrace();
                // }
                // System.out.println("Done get to work.");

                Component component = (Component) transferable
                        .getData("component");
                if (component == null) {
                    component = transferable.getSourceComponent();
                }

                if (component != null) {
                    if (component.toString() != null
                            && component.toString().contains("Bar")) {
                        return true;
                    }
                }
                return false;
            }
View Full Code Here

        getLayout().addComponent(reorderTabs);

    }

    private void closeCurrentTab() {
        Component c = accordion.getSelectedTab();
        if (c != null) {
            accordion.removeComponent(c);
        }
    }
View Full Code Here

        accordion.removeComponent(accordion.iterator().next());
    }

    private void closeLastTab() {
        Iterator<Component> i = accordion.iterator();
        Component last = null;
        while (i.hasNext()) {
            last = i.next();

        }
        accordion.removeComponent(last);
View Full Code Here

        if (container != null) {
            List<Component> c = new ArrayList<Component>();
            Iterator<Component> i = container.iterator();
            while (i.hasNext()) {
                Component comp = i.next();
                c.add(comp);
            }
            container.removeAllComponents();

            for (int j = c.size() - 1; j >= 0; j--) {
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Component$Event

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.