Package com.vaadin.ui

Examples of com.vaadin.ui.Component


    public ControlsContext getContext() {
        return context;
    }

    public Component getControl(Class<? extends Component> type) {
        Component component = null;
        if (hasControls()) {
            for (Component c: getContext().getControls()) {
                if (c.getClass().equals(type)) {
                    component = c;
                    break;
View Full Code Here


    // this is kind of hacky!
    // since all presenters are UI-scoped we need to call them into being before publishing events
    // that can be received and handled by them
    public void selectedTabChange(final SelectedTabChangeEvent event) {
        eventBus.publish(context.getBean(HeaderView.class), ControlsContext.empty());
        Component c = event.getTabSheet().getSelectedTab();
        if (View.class.isAssignableFrom(c.getClass())) {
            View v = (View) c;
            Annotation[] annotations = v.getClass().getAnnotations();
            if (ArrayUtils.isNotEmpty(annotations)) {
                for (Annotation a: annotations) {
                    if (a instanceof VaadinView) {
View Full Code Here

        if (getComponentCount() > 0) {
            removeAllComponents();
        }
        if (CollectionUtils.isNotEmpty(targets)) {
            setVisible(true);
            Component c;
            String viewName;
            for (NavElement target: targets) {
                viewName = getViewName(origin, target);
                c = generateTab(viewName);
                if (c != null) {
View Full Code Here

                }
                for (Entry<String, String> item : menuItems.entrySet()) {
                    if (event.getViewName().equals(item.getKey())) {
                        for (Iterator<Component> it = menuItemsLayout
                                .iterator(); it.hasNext();) {
                            Component c = it.next();
                            if (c.getCaption() != null
                                    && c.getCaption().startsWith(
                                            item.getValue())) {
                                c.addStyleName("selected");
                                break;
                            }
                        }
                        break;
                    }
View Full Code Here

        sb.append("Type: ");
        sb.append(connector.getClass().getName());
        sb.append("\nId:");
        sb.append(connector.getConnectorId());
        if (connector instanceof Component) {
            Component component = (Component) connector;
            if (component.getCaption() != null) {
                sb.append("\nCaption:");
                sb.append(component.getCaption());
            }
        }
        writeHierarchyInformation(connector, sb);
        return sb.toString();
    }
View Full Code Here

        public TabComposite() {
            Layout mainLayout = new VerticalLayout();
            addComponent(mainLayout);
            setCompositionRoot(mainLayout);

            Component table = new Table();
            table.setWidth("100%");
            table.setId(TABLE);
            mainLayout.addComponent(table);
        }
View Full Code Here

        }

        @Override
        public void drop(final DragAndDropEvent dropEvent) {
            final Transferable transferable = dropEvent.getTransferable();
            final Component sourceComponent = transferable.getSourceComponent();
            if (sourceComponent instanceof WrappedComponent) {
                final TargetDetails dropTargetData = dropEvent
                        .getTargetDetails();
                final DropTarget target = dropTargetData.getTarget();

                // find the location where to move the dragged component
                boolean sourceWasAfterTarget = true;
                int index = 0;
                final Iterator<Component> componentIterator = layout
                        .getComponentIterator();
                Component next = null;
                while (next != target && componentIterator.hasNext()) {
                    next = componentIterator.next();
                    if (next != sourceComponent) {
                        index++;
                    } else {
View Full Code Here

        rta.setVisible(!rta.isVisible());

    }

    protected void showHide() {
        Component c = containerToComponent.get(ts.getSelectedTab());
        c.setVisible(!c.isVisible());
    }
View Full Code Here

        textArea.setVisible(false);
        textArea.setCaption("This is the textArea");
        textArea.setWidth("200px");
        textArea.setHeight("100px");
        textAreas.add(textArea);
        Component cc = null;

        try {
            cc = c.newInstance();
        } catch (Exception e) {
            // TODO Auto-generated catch block
View Full Code Here

        excludedMethods.add("getConnectorId");
    }

    public void testGetDoesntMarkStateDirty() throws Exception {
        for (Class<? extends Component> c : VaadinClasses.getComponents()) {
            Component newInstance = construct(c);
            prepareMockUI(newInstance);

            Set<Method> methods = new HashSet<Method>();
            methods.addAll(Arrays.asList(c.getMethods()));
            methods.addAll(Arrays.asList(c.getDeclaredMethods()));
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.