Package org.apache.wicket.markup.repeater

Examples of org.apache.wicket.markup.repeater.RepeatingView


     * @param id
     */
    private ToolbarsContainer(final String id)
    {
      super(id);
      toolbars = new RepeatingView("toolbars");
      add(toolbars);
    }
View Full Code Here


            final ActionModel actionModel = getActionModel();
            final ObjectAction ObjectAction = actionModel.getActionMemento().getAction();

            final List<ObjectActionParameter> parameters = ObjectAction.getParameters();

            final RepeatingView rv = new RepeatingView(ID_ACTION_PARAMETERS);
            add(rv);
            final List<ActionParameterMemento> mementos = buildParameterMementos(parameters);
            for (final ActionParameterMemento apm : mementos) {
                final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
                rv.add(container);

                final ScalarModel argumentModel = actionModel.getArgumentModel(apm);
                getComponentFactoryRegistry().addOrReplaceComponent(container, ComponentType.SCALAR_NAME_AND_VALUE, argumentModel);
            }
        }
View Full Code Here

            final ObjectAdapter adapter = entityModel.getObject();
            final ObjectSpecification noSpec = adapter.getSpecification();

            final List<ObjectAssociation> associations = visibleAssociations(adapter, noSpec);

            final RepeatingView rv = new RepeatingView(ID_PROPERTIES_AND_OR_COLLECTIONS);
            final EvenOrOddCssClassAppenderFactory eo = new EvenOrOddCssClassAppenderFactory();
            add(rv);

            @SuppressWarnings("unused")
            Component component;
            for (final ObjectAssociation association : associations) {
                final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
                rv.add(container);
                container.add(eo.nextClass());
                if (association instanceof OneToOneAssociation) {
                    final OneToOneAssociation otoa = (OneToOneAssociation) association;
                    final PropertyMemento pm = new PropertyMemento(otoa);

                    final ScalarModel scalarModel = entityModel.getPropertyModel(pm);
                    component = getComponentFactoryRegistry().addOrReplaceComponent(container, ID_PROPERTY_OR_COLLECTION, ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
                } else {
                    final OneToManyAssociation otma = (OneToManyAssociation) association;

                    final EntityCollectionModel entityCollectionModel = EntityCollectionModel.createParented(entityModel, otma);
                    final CollectionPanel collectionPanel = new CollectionPanel(ID_PROPERTY_OR_COLLECTION, entityCollectionModel);
                    container.addOrReplace(collectionPanel);

                    component = getComponentFactoryRegistry().addOrReplaceComponent(container, ID_PROPERTY_OR_COLLECTION, ComponentType.COLLECTION_NAME_AND_CONTENTS, entityCollectionModel);
                }
            }

            // massive hack: an empty property line to get CSS correct...!
            final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
            rv.add(container);
            container.add(new Label(ID_PROPERTY_OR_COLLECTION, Model.of(" ")));
            container.add(eo.nextClass());
        }
View Full Code Here

        super(id, new MyModel(topLevelMenuItems));
        this.styleAppender = new StyleAppender(style);

        add(styleAppender);

        final RepeatingView menuItemRv = new RepeatingView(CssMenuPanel.ID_MENU_ITEMS);
        add(menuItemRv);

        for (final CssMenuItem cssMenuItem : this.getModel().getObject()) {
            final WebMarkupContainer menuItemMarkup = new WebMarkupContainer(menuItemRv.newChildId());
            menuItemRv.add(menuItemMarkup);

            menuItemMarkup.add(new CssMenuItemPanel(CssMenuPanel.ID_MENU_ITEM, cssMenuItem));
        }

    }
View Full Code Here

        final ObjectSpecification typeOfSpec = model.getTypeOfSpecification();
        final List<? extends ObjectAssociation> propertyList = typeOfSpec.getAssociations(ObjectAssociationFilters.PROPERTIES);

        add(new Label("title", adapter.titleString()));

        final RepeatingView propertyValues = new RepeatingView("propertyValue");
        add(propertyValues);

        for (final ObjectAssociation property : propertyList) {
            final ObjectAdapter propertyValueAdapter = property.get(adapter);
            Component component;
            if (propertyValueAdapter == null) {
                component = new Label(property.getId(), "(null)");
            } else {
                if (propertyValueAdapter.getSpecification().getFacet(ValueFacet.class) == null) {
                    // TODO: make more sophisticated, eg with Links if an object
                    component = new Label(property.getId(), propertyValueAdapter.titleString());
                } else {
                    component = new Label(property.getId(), propertyValueAdapter.titleString());
                }
            }
            propertyValues.add(component);
        }
    }
View Full Code Here

    }

    private void addTableHeader() {
        final EntityCollectionModel model = getModel();
        final ObjectSpecification typeOfSpec = model.getTypeOfSpecification();
        final RepeatingView propertyNames = new RepeatingView("propertyName");
        add(propertyNames);

        final List<? extends ObjectAssociation> propertyList = typeOfSpec.getAssociations(ObjectAssociationFilters.PROPERTIES);
        for (final ObjectAssociation property : propertyList) {
            propertyNames.add(new Label(property.getId(), property.getName()));
        }
    }
View Full Code Here

    }

    private void addTableRows() {
        final EntityCollectionModel model = getModel();
        final List<ObjectAdapter> adapterList = model.getObject();
        final RepeatingView entityInstances = new RepeatingView("entityInstance");
        add(entityInstances);
        for (final ObjectAdapter adapter : adapterList) {
            final String childId = entityInstances.newChildId();
            entityInstances.add(new CollectionContentsInstanceAsTableRow(childId, new EntityModel(adapter)));
        }
    }
View Full Code Here

    }

    private void buildGui() {
        final EntityCollectionModel model = getModel();
        final List<ObjectAdapter> adapterList = model.getObject();
        final RepeatingView entityInstances = new RepeatingView(ID_ENTITY_INSTANCE);
        add(entityInstances);
        for (final ObjectAdapter adapter : adapterList) {
            final String childId = entityInstances.newChildId();
            final EntityModel entityModel = new EntityModel(adapter);
            final EntitySummaryPanel entitySummaryPanel = new EntitySummaryPanel(childId, entityModel);
            entityInstances.add(entitySummaryPanel);
        }
    }
View Full Code Here

        final ObjectAdapter adapter = entityModel.getObject();
        final ObjectSpecification noSpec = adapter.getSpecification();

        final List<OneToOneAssociation> properties = visibleProperties(adapter, noSpec);

        final RepeatingView rv = new RepeatingView(idProperties);
        mc.add(rv);
        final List<PropertyMemento> mementos = buildPropertyMementos(properties);
        for (final PropertyMemento pm : mementos) {
            final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
            rv.add(container);

            final ScalarModel scalarModel = entityModel.getPropertyModel(pm);
            getComponentFactoryRegistry().addOrReplaceComponent(container, idProperty, ComponentType.SCALAR_NAME_AND_VALUE, scalarModel);
        }
    }
View Full Code Here

        if( tabs == null || tabs.isEmpty() )
        {
            throw new RuntimeException( "Please register one or more tabs." );
        }

        RepeatingView tabsView = new RepeatingView( "tabsView" );

        // Loop "mounted" tabs
        for( Map.Entry<Class, String[]> tab : tabs.entrySet() )
        {
            Class pageClass = tab.getKey();
            String tabReference = tab.getValue()[ 0 ];
            String tabLabel = tab.getValue()[ 1 ];

            WebMarkupContainer tabView = new WebMarkupContainer( tabsView.newChildId() );
            if( tabReference.equals( activeTab ) )
            {
                tabView.add( new AttributeModifier( "id", "current" ) );
            }

            BookmarkablePageLink link = new BookmarkablePageLink( "link", pageClass )// unchecked

            Label label = new Label( "label", tabLabel );

            tabsView.add( tabView.add( link.add( label ) ) );
        }
        add( tabsView );
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.repeater.RepeatingView

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.