Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ffb6f8160c0f5f24904727e35f8a7d2bbe1e4dd2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*****************************************************************************
 * Copyright (c) 2016 CEA LIST and others.
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
 *   
 *****************************************************************************/

package org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle;

import org.eclipse.nebula.widgets.nattable.NatTable;
import org.eclipse.nebula.widgets.nattable.command.ILayerCommand;
import org.eclipse.nebula.widgets.nattable.fillhandle.command.FillHandlePasteCommand.FillHandleOperation;
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.MoveDirectionEnum;
import org.eclipse.papyrus.infra.nattable.fillhandle.command.PapyrusFillHandlePasteCommand;
import org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
import org.eclipse.swt.graphics.Rectangle;
import org.junit.Before;

/**
 * This allows to manage the fill handle tests for integer column.
 */
@PluginResource("resources/fillhandle/FillHandleInteger_V1_V3_V1_Test.di") // NON-NLS-1
public class FillHandleInteger_V1_V3_V1_Test extends AbstractFillHandleTest {

	/**
	 * Constructor.
	 */
	public FillHandleInteger_V1_V3_V1_Test() {
		super();
	}
	
	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle.AbstractFillHandleTest#selectCellToFillToUp(org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager)
	 */
	@Override
	protected void selectCellToFillToUp(final TreeNattableModelManager treeManager) {
		treeManager.getBodyLayerStack().getSelectionLayer().setSelectedCell(0, 50);
	}
	
	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle.AbstractFillHandleTest#selectCellToFillToDown(org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager)
	 */
	@Override
	protected void selectCellToFillToDown(final TreeNattableModelManager treeManager) {
		treeManager.getBodyLayerStack().getSelectionLayer().setSelectedCell(0, 1);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle.AbstractFillHandleTest#setFillHandlerRegionToUp(org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager)
	 */
	@Override
	protected void setFillHandlerRegionToUp(final TreeNattableModelManager treeManager) {
		treeManager.getBodyLayerStack().getSelectionLayer().setFillHandleRegion(new Rectangle(0, 1, 1, 50));
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle.AbstractFillHandleTest#setFillHandlerRegionToDown(org.eclipse.papyrus.infra.nattable.manager.table.TreeNattableModelManager)
	 */
	@Override
	protected void setFillHandlerRegionToDown(final TreeNattableModelManager treeManager) {
		treeManager.getBodyLayerStack().getSelectionLayer().setFillHandleRegion(new Rectangle(0, 1, 1, 50));
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle.AbstractFillHandleTest#getCopyCommand()
	 */
	@Override
	protected ILayerCommand getCopyCommand(final NatTable natTable) {
		return new PapyrusFillHandlePasteCommand(FillHandleOperation.COPY, MoveDirectionEnum.DOWN, natTable.getConfigRegistry(), false, false);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle.AbstractFillHandleTest#getIncrementUpCommand(org.eclipse.nebula.widgets.nattable.NatTable)
	 */
	@Override
	protected ILayerCommand getIncrementUpCommand(final NatTable natTable) {
		return new PapyrusFillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.UP, natTable.getConfigRegistry(), true, false);
	}
	
	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle.AbstractFillHandleTest#getIncrementDownCommand(org.eclipse.nebula.widgets.nattable.NatTable)
	 */
	@Override
	protected ILayerCommand getIncrementDownCommand(final NatTable natTable) {
		return new PapyrusFillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.DOWN, natTable.getConfigRegistry(), true, false);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle.AbstractFillHandleTest#getDecrementUpCommand(org.eclipse.nebula.widgets.nattable.NatTable)
	 */
	@Override
	protected ILayerCommand getDecrementUpCommand(final NatTable natTable) {
		return new PapyrusFillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.UP, natTable.getConfigRegistry(), false, false);
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.papyrus.uml.nattable.clazz.config.tests.fillhandle.AbstractFillHandleTest#getDecrementDownCommand(org.eclipse.nebula.widgets.nattable.NatTable)
	 */
	@Override
	protected ILayerCommand getDecrementDownCommand(final NatTable natTable) {
		return new PapyrusFillHandlePasteCommand(FillHandleOperation.SERIES, MoveDirectionEnum.DOWN, natTable.getConfigRegistry(), false, false);
	}
}

Back to the top