edu.stanford.smi.protegex.owl.ui.editors
Class TimeValueEditor

java.lang.Object
  extended byedu.stanford.smi.protegex.owl.ui.editors.TimeValueEditor
All Implemented Interfaces:
PropertyValueEditor
Direct Known Subclasses:
TimeAnnotationsWidgetPlugin

public class TimeValueEditor
extends Object
implements PropertyValueEditor

Author:
Holger Knublauch

Constructor Summary
TimeValueEditor()
           
 
Method Summary
 boolean canEdit(RDFResource instance, RDFProperty property, Object value)
          Checks whether this is able to edit values for a certain predicate.
 Object createDefaultValue(RDFResource instance, RDFProperty property)
          Creates a default value for a given predicate at a given subject.
private  RDFSLiteral createRDFSLiteral(OWLModel owlModel, String str)
           
 Object editValue(Component parent, RDFResource instance, RDFProperty property, Object value)
          Edits a given value for a given resource/predicate pair.
 boolean mustEdit(RDFResource subject, RDFProperty predicate, Object value)
          Checks whether this is the only way to edit values for a certain predicate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeValueEditor

public TimeValueEditor()
Method Detail

canEdit

public boolean canEdit(RDFResource instance,
                       RDFProperty property,
                       Object value)
Description copied from interface: PropertyValueEditor
Checks whether this is able to edit values for a certain predicate.

Specified by:
canEdit in interface PropertyValueEditor
Parameters:
instance -
property -
value -
Returns:
true if this can edit such values

createDefaultValue

public Object createDefaultValue(RDFResource instance,
                                 RDFProperty property)
Description copied from interface: PropertyValueEditor
Creates a default value for a given predicate at a given subject. The hosting widget should call this method on each of its registered editors to see whether any of them defines a non-null default value.

Specified by:
createDefaultValue in interface PropertyValueEditor
Parameters:
instance - the RDFResource to create a default value for
property - the annotation predicate
Returns:
the default value or null if this does not define a default for this predicate

createRDFSLiteral

private RDFSLiteral createRDFSLiteral(OWLModel owlModel,
                                      String str)

editValue

public Object editValue(Component parent,
                        RDFResource instance,
                        RDFProperty property,
                        Object value)
Description copied from interface: PropertyValueEditor
Edits a given value for a given resource/predicate pair. For example, after the user has double-clicked on the value, the host widget could iterate on all editors to see whether any of them is ready to edit this value (returning true).

Specified by:
editValue in interface PropertyValueEditor
Parameters:
parent -
instance -
property -
value -
Returns:
the new value (!= null) if this has handled editing for the value

mustEdit

public boolean mustEdit(RDFResource subject,
                        RDFProperty predicate,
                        Object value)
Description copied from interface: PropertyValueEditor
Checks whether this is the only way to edit values for a certain predicate. This is used to force editing of value types like xsd:date, where simple string input fields would not be sufficient.

Specified by:
mustEdit in interface PropertyValueEditor
Parameters:
subject -
predicate -
value -
Returns:
true if this can edit such values