-
Notifications
You must be signed in to change notification settings - Fork 3
/
PropertyTester.java
38 lines (31 loc) · 1.12 KB
/
PropertyTester.java
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
/*******************************************************************************
* Copyright (c) 2024 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.acceleo.aql.ide.ui.property;
import org.eclipse.acceleo.aql.ide.AcceleoPlugin;
import org.eclipse.core.resources.IFile;
public class PropertyTester extends org.eclipse.core.expressions.PropertyTester {
@Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
final boolean res;
switch (property) {
case "isMain":
if (receiver instanceof IFile) {
res = AcceleoPlugin.isAcceleoMain((IFile)receiver);
} else {
res = false;
}
break;
default:
throw new IllegalStateException("Unkown property" + property);
}
return res;
}
}