Examples of AbstractComponent


Examples of com.vaadin.ui.AbstractComponent

    protected void getLayoutForLayoutSizing(final String compType) {

        l2.setSpacing(false);
        l2.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") {
                            l2.setHeight(size);
                            l2.setWidth(size);
                        } else if (compType == "component") {
                            c2.setHeight(size);
                            c2.setWidth(size);
                        } else {
                        }

                    }
                });
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

            e1.printStackTrace();
        }
        final Component[] components = new Component[CAPTIONS.length];

        for (int i = 0; i < components.length; i++) {
            AbstractComponent comp = null;
            try {
                comp = compType.newInstance();
            } catch (InstantiationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            components[i] = comp;
            comp.setCaption(CAPTIONS[i]);
            if (useIcon) {
                comp.setIcon(ICONS[i]);
            }
            if (ErrorMessage != null) {
                if (ErrorMessage.length() == 0) {
                    comp.setComponentError(new UserError(null));
                } else {
                    comp.setComponentError(new UserError(ErrorMessage));
                }
            }
            // if component is a tab sheet add two tabs for it
            if (comp instanceof TabSheet) {
                comp.setSizeUndefined();
                TabSheet tab = (TabSheet) comp;
                tab.addTab(new UndefWideLabel("TAB1"), "TAB1",
                        new ThemeResource(GLOBE_16_PNG));
                tab.addTab(new UndefWideLabel("TAB2"), "TAB2", null);
            }
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

        }

        t = findRelevantThrowable(t);

        // Finds the original source of the error/exception
        AbstractComponent component = findAbstractComponent(event);
        if (component != null) {
            // Shows the error in AbstractComponent
            ErrorMessage errorMessage = AbstractErrorMessage
                    .getErrorMessageForException(t);
            component.setComponentError(errorMessage);
        }

        // also print the error on console
        getLogger().log(Level.SEVERE, "", t);
    }
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

        Window parent = getParent();
        if (parent != null) {
            parent.removeWindow(this);
        }

        AbstractComponent comp = (AbstractComponent) event.getComponent();
        m_callback.onDialogResult((String) comp.getData());
    }
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

        StringBuilder sb = new StringBuilder();
        sb.append("*** Debug details of a component:  *** \n");
        sb.append("Type: ");
        sb.append(highLightedPaintable2.getClass().getName());
        if (highLightedPaintable2 instanceof AbstractComponent) {
            AbstractComponent component = (AbstractComponent) highLightedPaintable2;
            sb.append("\nId:");
            sb.append(paintableIdMap.get(component));
            if (component.getCaption() != null) {
                sb.append("\nCaption:");
                sb.append(component.getCaption());
            }

            printHighlightedComponentHierarchy(sb, component);
        }
        getLogger().info(sb.toString());
View Full Code Here

Examples of com.vaadin.ui.AbstractComponent

        if (parent != null) {
            parent.removeWindow(this);
            parent.focus();
        }

        AbstractComponent comp = (AbstractComponent) event.getComponent();
        m_callback.onDialogResult((String) comp.getData());
    }
View Full Code Here

Examples of com.zachsthings.libcomponents.AbstractComponent

                }
            }.display(sender, CommandBook.inst().getComponentManager().getComponents(), args.getFlagInteger('p', 1));

        } else {
            final String componentName = args.getString(0).replaceAll(" ", "-").toLowerCase();
            AbstractComponent component = CommandBook.inst().getComponentManager().getComponent(componentName);
            if (component == null) {
                throw new CommandException("No such component: " + componentName);
            }
            final ComponentInformation info = component.getInformation();
            sender.sendMessage(ChatColor.YELLOW + info.friendlyName() + " - " + info.desc());
            if (info.authors().length > 0 && info.authors()[0].length() > 0) {
                sender.sendMessage(ChatColor.YELLOW + "Authors: " +
                        Arrays.toString(info.authors()).replaceAll("[(.*)]", "$1"));
            }
            Map<String, String> commands = component.getCommands();
            if (commands.size() > 0) {
                new PaginatedResult<Map.Entry<String, String>>("    Command - Description") {
                    @Override
                    public String format(Map.Entry<String, String> entry) {
                        return "    /" + entry.getKey() + " " + entry.getValue();
View Full Code Here

Examples of gov.nasa.arc.mct.components.AbstractComponent

                            Class.forName(invocation.getArguments()[0].toString()).newInstance()
                            );
                }               
            });
       
        AbstractComponent comp = provider.createDropbox(id);
        Assert.assertEquals(comp.getClass(), TelemetryUserDropBoxComponent.class);
        Assert.assertEquals(comp.getOwner(), "*");
        Assert.assertEquals(comp.getCreator(), id);
       
        // Verify that policy allows Remove Manifestation here
        User mockUser = Mockito.mock(User.class);
        Mockito.when(mockPlatform.getCurrentUser()).thenReturn(mockUser);
        Mockito.when(mockUser.getUserId()).thenReturn(id);
       
        PolicyContext context = new PolicyContext();
        AbstractComponent mockChild = Mockito.mock(AbstractComponent.class);
        context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), comp);
        context.setProperty(PolicyContext.PropertyName.SOURCE_COMPONENTS.getName(), Collections.singleton(mockChild));
        Assert.assertTrue(new CanRemoveComponentPolicy().execute(context).getStatus());
    }
View Full Code Here

Examples of gov.nasa.arc.mct.components.AbstractComponent

   
    protected abstract AbstractComponent getTargetComponent(ActionContextImpl actionContext);
   
    @Override
    public boolean isEnabled() {
        AbstractComponent ac = getTargetComponent(actionContext);
        ObjectManager om = ac.getCapability(ObjectManager.class);
        Set<AbstractComponent> modified = om != null ?               
                om.getAllModifiedObjects() :
                Collections.<AbstractComponent>emptySet();
       
        // Should enable if at least one object can be saved
        boolean hasWriteableComponents =
                !ac.isStale() &&
                ac.isDirty() &&
                isComponentWriteableByUser(ac);
        if (!hasWriteableComponents) {
            for (AbstractComponent mod : modified) {
                if (isComponentWriteableByUser(mod)) {
                    hasWriteableComponents = true;
View Full Code Here

Examples of gov.nasa.arc.mct.components.AbstractComponent

    private void handleStaleObject(AbstractComponent ac) {
        overwritePreviousChanges(ac);
    }
   
    private void overwritePreviousChanges(AbstractComponent ac) {
        AbstractComponent updatedComp = PlatformAccess.getPlatform().getPersistenceProvider().getComponentFromStore(ac.getComponentId());
        ac.getCapability(Updatable.class).setVersion(updatedComp.getVersion());
        actionPerformed(null);
    }
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.