Package org.qi4j.sample.dcicargo.sample_a.communication.query.dto

Examples of org.qi4j.sample.dcicargo.sample_a.communication.query.dto.HandlingEventDTO


        add( new ListView<HandlingEventDTO>( "handlingEvents", handlingEventsModel )
        {
            @Override
            protected void populateItem( ListItem<HandlingEventDTO> item )
            {
                HandlingEventDTO event = item.getModelObject();
                Boolean isLast = item.getIndex() == getList().size() - 1;
                Boolean isMisdirected = cargoModel.getObject().delivery().get().isMisdirected().get();

                // Status icon
                IModel iconName = Model.of( isLast && isMisdirected ? "cross.png" : "tick.png" );
                item.add( new WebMarkupContainer( "onTrackIcon" ).add( new AttributeAppender( "src", iconName, "" ) ) );

                // Date
                item.add( new Label( "completion", new Model<Date>( event.completionTime().get() ) ) );

                // Event description (data substitution in strings from HandlingHistoryPanel.properties)
                ValueMap map = new ValueMap();
                map.put( "type", event.handlingEventType().get().name() );
                map.put( "location", event.location().get().getString() );
                if( event.voyage().get() != null )
                {
                    map.put( "voyage", event.voyage().get().voyageNumber().get().number().get() );
                }
                IModel text = new StringResourceModel( "handlingEvent.${type}", this, new Model<ValueMap>( map ) );
                item.add( new Label( "event", text )
                              .add( new ErrorColor( isLast && isMisdirected ) )
                              .setEscapeModelStrings( false ) );
View Full Code Here

TOP

Related Classes of org.qi4j.sample.dcicargo.sample_a.communication.query.dto.HandlingEventDTO

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.