org.protege.editor.owl.ui.editor.OWLClassExpressionEditorPluginImpl Maven / Gradle / Ivy
The newest version!
package org.protege.editor.owl.ui.editor;
import org.eclipse.core.runtime.IExtension;
import org.protege.editor.core.plugin.AbstractProtegePlugin;
import org.protege.editor.owl.OWLEditorKit;
import org.semanticweb.owlapi.model.AxiomType;
/*
* Copyright (C) 2007, University of Manchester
*
*
*/
/**
* Author: drummond
* http://www.cs.man.ac.uk/~drummond/
* The University Of Manchester
* Bio Health Informatics Group
* Date: Feb 26, 2009
*/
public class OWLClassExpressionEditorPluginImpl extends AbstractProtegePlugin implements OWLClassExpressionEditorPlugin {
private OWLEditorKit editorKit;
public OWLClassExpressionEditorPluginImpl(OWLEditorKit editorKit, IExtension extension) {
super(extension);
this.editorKit = editorKit;
}
@SuppressWarnings("unchecked")
public boolean isSuitableFor(AxiomType type) {
String axiomTypes = getPluginProperty("axiomTypes");
if (axiomTypes == null){
return true;
}
if (type != null){
for(String axiomType : axiomTypes.split(",")){
if (type.toString().equals(axiomType.trim())){
return true;
}
}
}
return false;
}
public String getIndex() {
String index = getPluginProperty("index");
return index != null ? index : "ZZZ";
}
public OWLClassExpressionEditor newInstance() throws InstantiationException, ClassNotFoundException, IllegalAccessException {
OWLClassExpressionEditor editor = super.newInstance();
editor.setup(getId(), getPluginProperty("label"), editorKit);
return editor;
}
}