Package org.libreplan.business.orders.entities

Examples of org.libreplan.business.orders.entities.SchedulingState


                }
            });
        }

        public void addSchedulingStateCell(final T currentElement) {
            final SchedulingState schedulingState = getSchedulingStateFrom(currentElement);
            SchedulingStateToggler schedulingStateToggler = new SchedulingStateToggler(
                    schedulingState);
            schedulingStateToggler.setReadOnly(readOnly
                    || currentElement.isUpdatedFromTimesheets());
            final Treecell cell = addCell(
                    getDecorationFromState(getSchedulingStateFrom(currentElement)),
                    schedulingStateToggler);
            cell.addEventListener("onDoubleClick", new EventListener() {
                @Override
                public void onEvent(Event event) {

                    markModifiedTreeitem((Treerow) cell.getParent());
                    onDoubleClickForSchedulingStateCell(currentElement);
                }
            });
            cell.addEventListener(Events.ON_CLICK, new EventListener() {

                private Treeitem item = (Treeitem) getCurrentTreeRow().getParent();

                @Override
                public void onEvent(Event event) {
                    item.getTree().toggleItemSelection(item);
                }
            });
            schedulingState.addTypeChangeListener(
                    new ITypeChangedListener() {

                        @Override
                        public void typeChanged(Type newType) {
                            cell.setSclass(getDecorationFromState(schedulingState));
View Full Code Here


    private SchedulingState grandChildB2;

    @Before
    public void setUp() {
        root = new SchedulingState();
        root.add(childA = new SchedulingState());
        childA.add(grandChildA1 = new SchedulingState());
        childA.add(grandChildA2 = new SchedulingState());
        root.add(childB = new SchedulingState());
        childB.add(grandChildB1 = new SchedulingState());
        childB.add(grandChildB2 = new SchedulingState());
    }
View Full Code Here

                grandChildB1, grandChildB2);
    }

    @Test
    public void aNewlyCreatedSchedulingStateIsNoScheduled() {
        SchedulingState schedulingState = new SchedulingState();
        assertThat(schedulingState.getType(),
                equalTo(Type.NO_SCHEDULED));
    }
View Full Code Here

                equalTo(Type.NO_SCHEDULED));
    }

    @Test(expected = IllegalArgumentException.class)
    public void cannotCreateASchedulingStateWithChildrenAlreadyAssigned() {
        new SchedulingState(Type.NO_SCHEDULED, Arrays.asList(childA));
    }
View Full Code Here

    @Test
    public void addingANewChildToACompletelyScheduled() {
        childA.schedule();
        childB.schedule();
        root.add(new SchedulingState());
        assertThat(root, hasType(Type.PARTIALY_SCHEDULED_SUPERELEMENT));
    }
View Full Code Here

    }

    @Test
    public void addingAChildToASchedulingPointMakesItAScheduledSubelementAndAllItsDescendants() {
        childA.schedule();
        SchedulingState newChild = new SchedulingState();
        SchedulingState grandChild = new SchedulingState();
        newChild.add(grandChild);
        childA.add(newChild);
        assertThat(newChild, hasType(Type.SCHEDULED_SUBELEMENT));
        assertThat(grandChild, hasType(Type.SCHEDULED_SUBELEMENT));
    }
View Full Code Here

    }

    @Test
    public void addingAChildToAScheduledSubelementMakesItAScheduledSubelementAndAllItsDescendants() {
        childA.schedule();
        SchedulingState newChild = new SchedulingState();
        SchedulingState grandChild = new SchedulingState();
        newChild.add(grandChild);
        grandChildA1.add(newChild);
        assertThat(newChild, hasType(Type.SCHEDULED_SUBELEMENT));
        assertThat(grandChild, hasType(Type.SCHEDULED_SUBELEMENT));
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.orders.entities.SchedulingState

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.