blob: 253736bacda16c81c5a19e4ceac59997e5210fa7 (
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
|
/*****************************************************************************
* Copyright (c) 2013 CEA LIST.
*
*
* 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:
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.eastadl.nattable.allocation.config.tester;
import org.eclipse.papyrus.eastadl.nattable.allocation.config.handler.CreateFunctionAllocationHandler;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.utils.NattableWidgetPropertyTester;
public class AllocationPropertyTester extends NattableWidgetPropertyTester {
private static final String IS_ALLOCATION_TABLE = "isAllocationTable"; //$NON-NLS-1$
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
final INattableModelManager manager = getNattableModelManager();
if(manager != null) {
if(IS_ALLOCATION_TABLE.equals(property) && expectedValue instanceof Boolean) {
return expectedValue.equals(manager.getTable().getTableConfiguration().getType().equals(CreateFunctionAllocationHandler.TABLE_ALLOCATION_TYPE));
}
}
return false;
}
}
|