Package org.zkoss.ganttz.data

Examples of org.zkoss.ganttz.data.TaskContainer$IExpandListener


        public void render(final Treeitem item, Object data) throws Exception {
            Task task = (Task) data;
            item.setOpen(isOpened(task));
            if (task instanceof TaskContainer) {
                final TaskContainer container = (TaskContainer) task;
                IExpandListener expandListener = new IExpandListener() {

                    @Override
                    public void expandStateChanged(boolean isNowExpanded) {
                        item.setOpen(isNowExpanded);
                    }
                };
                expandListeners.put(container, expandListener);
                container.addExpandListener(expandListener);

            }
            LeftTasksTreeRow leftTasksTreeRow = LeftTasksTreeRow.create(
                    disabilityConfiguration, task, new TreeNavigator(
                            tasksTreeModel, task), planner);
View Full Code Here


        accumulatedDependencies.addAll(adapter.getIncomingDependencies(data));

        final Task result = build(data);

        if (!navigator.isLeaf(data)) {
            TaskContainer container = (TaskContainer) result;
            int i = 0;
            for (T child : navigator.getChildren(data)) {
                container.add(buildAndRegister(position.down(container, i),
                        accumulatedDependencies, child));
                i++;
            }
        } else if (navigator.isMilestone(data)) {
            Milestone milestone = (Milestone) result;
View Full Code Here

        if (navigator.isMilestone(data)) {
            return new Milestone(adapted);
        } else if (navigator.isLeaf(data)) {
            return new TaskLeaf(adapted);
        } else {
            return new TaskContainer(adapted,
                    planner.areContainersExpandedByDefault());
        }
    }
View Full Code Here

        updateTimeTracker(tasksCreated);
        if (position.isAppendToTop() || position.isAtTop()) {
            this.diagramGraph.addTopLevel(tasksCreated);
        } else {
            this.diagramGraph.addTasks(tasksCreated);
            TaskContainer parent = position.getParent();
            parent.addAll(position.getInsertionPosition(), tasksCreated);
            this.diagramGraph.childrenAddedTo(parent);
        }
        for (Dependency dependency : DomainDependency.toDependencies(mapper,
                totalDependencies)) {
            this.diagramGraph.addWithoutEnforcingConstraints(dependency);
View Full Code Here

    private void updateTimeTracker(List<Task> tasksCreated) {
        for (Task task : tasksCreated) {
            timeTracker.trackPosition(task);
            if (task.isContainer()) {
                TaskContainer container = (TaskContainer) task;
                updateTimeTracker(container.getTasks());
            }
        }
    }
View Full Code Here

        void remove(T domainObject) {
            Task toBeRemoved = findAssociatedBean(domainObject);
            fromDomainToTask.remove(domainObject);
            fromTaskToDomain.remove(toBeRemoved);
            TaskContainer parent = fromTaskToParent.get(toBeRemoved);
            if (parent != null) {
                parent.remove(toBeRemoved);
            }
            fromTaskToParent.remove(toBeRemoved);
            topLevel.remove(toBeRemoved);
        }
View Full Code Here

        public Position findPositionFor(Task task) {
            List<TaskContainer> ancestors = ancestorsOf(task);
            if (ancestors.isEmpty()) {
                return Position.createAtTopPosition(topLevel.indexOf(task));
            }
            TaskContainer parent = ancestors.get(0);
            return Position.createPosition(ancestors, parent.getTasks()
                    .indexOf(task));
        }
View Full Code Here

            return findPositionFor(findAssociatedBean(domainObject));
        }

        private List<TaskContainer> ancestorsOf(Task task) {
            ArrayList<TaskContainer> result = new ArrayList<TaskContainer>();
            TaskContainer taskContainer = fromTaskToParent.get(task);
            while (taskContainer != null) {
                result.add(taskContainer);
                taskContainer = fromTaskToParent.get(taskContainer);
            }
            return result;
View Full Code Here

TOP

Related Classes of org.zkoss.ganttz.data.TaskContainer$IExpandListener

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.