Commit df3089ab authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

add tester

git-svn-id: 7c539038-3410-0410-b1ec-0f2a7bf1c452
parent 25cba330
package info.textgrid.lab.sadepublish.tester;
import info.textgrid.lab.core.model.TGObjectReference;
import info.textgrid.lab.core.model.TextGridObject;
import info.textgrid.lab.core.swtutils.AdapterUtils;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.runtime.CoreException;
public class IsPublishableObject extends PropertyTester {
public boolean test(Object receiver, String property, Object[] args,
Object expectedValue) {
System.out.println("test content type");
if (receiver != null && receiver instanceof TGObjectReference) {
return isOK(AdapterUtils.getAdapter(receiver, TextGridObject.class));
return true;
private boolean isOK(TextGridObject tgo) {
String contentTypeId = "";
// reloadMetadata(tgo);
try {
contentTypeId = tgo.getContentTypeID();
if (contentTypeId.contains("tg.aggregation")) {
return true;
} catch (CoreException e) {
"Couldn't get the content type id of the selected textgrid object");
return false;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment