当前位置: 首页>>代码示例>>Java>>正文


Java Step类代码示例

本文整理汇总了Java中org.tltv.gantt.client.shared.Step的典型用法代码示例。如果您正苦于以下问题:Java Step类的具体用法?Java Step怎么用?Java Step使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Step类属于org.tltv.gantt.client.shared包,在下文中一共展示了Step类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addViewGenericRoleMemberToStep

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
/**
 * Adds the view generic role member to step.
 *
 * @param stepName
 *            the step name
 * @param step
 *            the step
 * @param assignments
 *            the assignments
 * @param stepMapping
 *            the step mapping
 */
private void addViewGenericRoleMemberToStep(final String stepName, final Step step, final List<T> assignments,
		final StepMapping<T> stepMapping) {

	for (final T assignmentData : assignments) {

		String subStepName = "";

		if (stepMapping.getRoleCode(assignmentData) != null) {
			subStepName = new StringBuilder().append(stepMapping.getFirstName(assignmentData))
					.append(CONTENT_SEPARATOR).append(stepMapping.getLastName(assignmentData))
					.append(PARTY_START_TAG).append(stepMapping.getParty(assignmentData)).append(PARTY_END_TAG)
					.toString();
		}

		final SubStep sameRoleSubStep = new SubStep(stepName + '.' + subStepName,CaptionMode.HTML);
		sameRoleSubStep.setDescription(stepName + '.' + subStepName);			
		sameRoleSubStep.setBackgroundColor(stepMapping.getBackgroundColor(assignmentData));

		sameRoleSubStep.setStartDate(stepMapping.getFromDate(assignmentData).getTime());
		sameRoleSubStep.setEndDate(stripDatesAfterCurrentDate(stepMapping.getToDate(assignmentData)).getTime());

		step.addSubStep(sameRoleSubStep);
	}
}
 
开发者ID:Hack23,项目名称:cia,代码行数:37,代码来源:AbstractGhantChartManagerImpl.java

示例2: stepMoved

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
@Override
public void stepMoved(Step step, int newStepIndex, int oldStepIndex) {
    List<Step> path = getParents(step);

    // remove all childrens
    if (dataProvider.hasChildren(step)) {
        removeChildStepRecursively(ganttTreeGrid, step);
        dataProvider.getTreeData().getChildren(step).stream().collect(Collectors.toList())
                .forEach(dataProvider.getTreeData()::removeItem);
    }

    if (path.size() > 1) {
        Step s = path.remove(path.size() - 1);
        dataProvider.getTreeData().removeItem(s);
        dataProvider.getTreeData().addItem(null, s);
    }
    dataProvider.refreshAll();
}
 
开发者ID:tltv,项目名称:gantt,代码行数:19,代码来源:TreeGridGanttLayout.java

示例3: fillParentStepCanditatesToSelect

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
private void fillParentStepCanditatesToSelect(AbstractStep step, final NativeSelect<Step> parentStepSelect) {
    if (!gantt.getSteps().contains(step)) {
        // new step
        parentStepSelect.setEnabled(true);
        List<Step> items = new ArrayList<>();
        for (Step parentStepCanditate : gantt.getSteps()) {
            items.add(parentStepCanditate);
            if (step instanceof SubStep) {
                if (parentStepCanditate.getSubSteps().contains(step)) {
                    parentStepSelect.setValue(parentStepCanditate);
                    parentStepSelect.setEnabled(false);
                    break;
                }
            }
        }
        parentStepSelect.setItems(items);
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:19,代码来源:DemoUI.java

示例4: commit

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
private void commit(final Window win, final Binder<? extends AbstractStep> binder,
        final NativeSelect<Step> parentStepSelect) {
    AbstractStep step = binder.getBean();
    gantt.markStepDirty(step);
    if (parentStepSelect.isEnabled() && parentStepSelect.getValue() != null) {
        SubStep subStep = addSubStep(parentStepSelect, step);
        step = subStep;
    }
    if (step instanceof Step && !gantt.getSteps().contains(step)) {
        gantt.addStep((Step) step);
    }
    if (ganttListener != null && step instanceof Step) {
        ganttListener.stepModified((Step) step);
    }
    win.close();
}
 
开发者ID:tltv,项目名称:gantt,代码行数:17,代码来源:DemoUI.java

示例5: firePredecessorChangeEvent

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
protected void firePredecessorChangeEvent(String newPredecessorStepUid, String forTargetStepUid,
        String clearPredecessorForStepUid) {
    Step newPredecessorStep = (Step) getStep(newPredecessorStepUid);
    Step forTargetStep = (Step) getStep(forTargetStepUid);
    Step clearPredecessorForStep = (Step) getStep(clearPredecessorForStepUid);
    if (forTargetStep != null) {
        forTargetStep.setPredecessor(newPredecessorStep);
        stepComponents.get(forTargetStep).getState(true);
        fireEvent(new PredecessorChangeEvent(this, forTargetStep));
    }
    if (clearPredecessorForStep != null) {
        clearPredecessorForStep.setPredecessor(null);
        stepComponents.get(clearPredecessorForStep).getState(true);
        fireEvent(new PredecessorChangeEvent(this, clearPredecessorForStep));
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:17,代码来源:Gantt.java

示例6: moveDatesByOwnerStep

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
protected void moveDatesByOwnerStep(AbstractStep step, long previousStartDate, long previousEndDate) {
    if (!(step instanceof Step)) {
        return;
    }
    Step s = (Step) step;

    long startDelta = step.getStartDate() - previousStartDate;
    long endDelta = step.getEndDate() - previousEndDate;
    if (!s.getSubSteps().isEmpty()) {
        for (SubStep sub : s.getSubSteps()) {
            if (startDelta != 0) {
                sub.setStartDate(sub.getStartDate() + startDelta);
            }
            if (endDelta != 0) {
                sub.setEndDate(sub.getEndDate() + endDelta);
            }
            subStepMap.get(sub).getState(true);
        }
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:21,代码来源:Gantt.java

示例7: removeSteps_withTwoStepsOneHasSubStep_sizeIsZeroAndComponetHierarchyCleaned

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
@Test
public void removeSteps_withTwoStepsOneHasSubStep_sizeIsZeroAndComponetHierarchyCleaned() {
    Gantt gantt = new Gantt();

    SubStep subStep = new SubStep();
    Step stepWithSubStep = new Step();
    stepWithSubStep.addSubStep(subStep);
    gantt.addStep(stepWithSubStep);
    gantt.addStep(new Step());

    AbstractStepComponent stepWithSubStepComponent = gantt
            .getStepComponent(stepWithSubStep);
    AbstractStepComponent subStepComponent = gantt
            .getStepComponent(subStep);
    Assert.assertNotNull(stepWithSubStepComponent.getParent());
    Assert.assertNotNull(subStepComponent.getParent());

    gantt.removeSteps();
    Assert.assertEquals(0, gantt.getSteps().size());
    Assert.assertNull(stepWithSubStepComponent.getParent());
    Assert.assertNull(subStepComponent.getParent());
    Assert.assertNull(gantt.getStepComponent(stepWithSubStep));
    Assert.assertNull(gantt.getStepComponent(subStep));
}
 
开发者ID:tltv,项目名称:gantt,代码行数:25,代码来源:GanttTest.java

示例8: createGridForGantt

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
private Grid<Step> createGridForGantt() {

        dataProvider = new ListDataProvider<>(new ArrayList<>(gantt.getSteps()));
        Grid<Step> grid = new Grid<>(dataProvider);
        grid.setWidth(400, Unit.PIXELS);
        grid.setHeight(100, Unit.PERCENTAGE);

        Column<Step, ?> c = grid.addColumn(Step::getCaption);
        c.setSortable(false);
        c.setResizable(false);

        gantt.setVerticalScrollDelegateTarget(grid);

        return grid;
    }
 
开发者ID:tltv,项目名称:gantt,代码行数:16,代码来源:GridGanttLayout.java

示例9: stepModified

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
@Override
public void stepModified(Step step) {
    if (!dataProvider.getItems().contains(step)) {
        dataProvider.getItems().add(step);
    }
    dataProvider.refreshItem(step);
}
 
开发者ID:tltv,项目名称:gantt,代码行数:8,代码来源:GridGanttLayout.java

示例10: stepMoved

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
@Override
public void stepMoved(Step step, int newStepIndex, int oldStepIndex) {
    if (oldStepIndex < newStepIndex) {
        newStepIndex--;
    }
    dataProvider.getItems().remove(step);
    ((List<Step>) dataProvider.getItems()).add(newStepIndex, step);
    dataProvider.refreshAll();
}
 
开发者ID:tltv,项目名称:gantt,代码行数:10,代码来源:GridGanttLayout.java

示例11: addChildStepRecursively

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
/**
 * Add all child steps directed by the TreeGrid's hierarchical data source.
 */
private void addChildStepRecursively(TreeGrid<Step> grid, Step itemId, MutableInt index) {
    if (!dataProvider.hasChildren(itemId)) {
        return;
    }
    if (index.getValue() == 0) {
        index.setValue(gantt.getSteps().indexOf(itemId) + 1);
    }
    for (Step child : dataProvider.getTreeData().getChildren(itemId)) {
        gantt.addStep(index.getValue(), child);
        index.increment();
        addChildStepRecursively(grid, child, index);
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:17,代码来源:TreeGridGanttLayout.java

示例12: removeChildStepRecursively

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
/**
 * Remove all child steps directed by the TreeGrid's hierarchical data
 * source.
 */
private void removeChildStepRecursively(TreeGrid<Step> grid, Step itemId) {
    if (dataProvider.hasChildren(itemId)) {
        for (Step child : dataProvider.getTreeData().getChildren(itemId)) {
            gantt.removeStep(child);
            removeChildStepRecursively(grid, child);
        }
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:13,代码来源:TreeGridGanttLayout.java

示例13: stepModified

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
@Override
public void stepModified(Step step) {
    if (!dataProvider.getTreeData().contains(step)) {
        dataProvider.getTreeData().addItem(null, step);
        dataProvider.refreshAll();
    } else {
        dataProvider.refreshItem(step);
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:10,代码来源:TreeGridGanttLayout.java

示例14: getParents

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
private List<Step> getParents(Step step) {
    Integer parentIndex = ganttTreeGrid.getDataCommunicator().getParentIndex(step);
    List<Step> parentPath = new ArrayList<>();
    parentPath.add(step);
    while (parentIndex != null) {
        Step parentStep = gantt.getStep(parentIndex);
        if (parentStep != null) {
            parentPath.add(0, parentStep);
            parentIndex = ganttTreeGrid.getDataCommunicator().getParentIndex(parentStep);
        } else {
            parentIndex = null;
        }
    }
    return parentPath;
}
 
开发者ID:tltv,项目名称:gantt,代码行数:16,代码来源:TreeGridGanttLayout.java

示例15: buttonClick

import org.tltv.gantt.client.shared.Step; //导入依赖的package包/类
@Override
public void buttonClick(ClickEvent event) {
    Step newStep = new Step();
    Date now = new Date();
    newStep.setStartDate(now.getTime());
    newStep.setEndDate(now.getTime() + (7 * 24 * 3600000));
    openStepEditor(newStep);
}
 
开发者ID:tltv,项目名称:gantt,代码行数:9,代码来源:DemoUI.java


注:本文中的org.tltv.gantt.client.shared.Step类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。