org.topbraid.strings
Interface IRowEditorDriver

All Known Subinterfaces:
IStylingRowEditorDriver
All Known Implementing Classes:
JenaRulesRowEditorDriver, SPARQLRowEditorDriver, SWRLRowEditorDriver

public interface IRowEditorDriver

An interface for extensions that control the look and feel of a row editor on a form. Implementations of this interface can be declared using the org.topbraidcomposer.editors.forms.rowEditorDrivers extension point. For example, the editors for SWRL and SPARQL queries are implemented this way. Note that the sub-interface IStylingRowEditorDriver can be used to implement syntax highlighting (e.g. done in the SPARQL editor in TBC).

Author:
Holger Knublauch

Method Summary
 com.hp.hpl.jena.rdf.model.RDFNode createObject(java.lang.String text, com.hp.hpl.jena.rdf.model.Statement s)
          Creates a new object from a given user input, to replace a given statement.
 java.lang.String getError(java.lang.String text, com.hp.hpl.jena.rdf.model.Statement s)
          Checks if a given user input is valid, and returns an error message if not.
 boolean isResponsibleForDisplay(com.hp.hpl.jena.rdf.model.Statement s)
          Checks if this driver assumes responsibility for a given Statement.
 boolean isResponsibleForEditing(java.lang.String text, com.hp.hpl.jena.rdf.model.Statement s)
          Checks if this driver assumes responsibility for control editing and error checking a given text and Statement combination.
 

Method Detail

createObject

com.hp.hpl.jena.rdf.model.RDFNode createObject(java.lang.String text,
                                               com.hp.hpl.jena.rdf.model.Statement s)
Creates a new object from a given user input, to replace a given statement. This method is called to create the new value when the user is assigning a value in a row editor. For example, in the SWRL editor, this would return a new swrl:Imp and add its depending triples to the model.

Parameters:
text - the user input
s - the existing Statement
Returns:
a new RDFNode

getError

java.lang.String getError(java.lang.String text,
                          com.hp.hpl.jena.rdf.model.Statement s)
Checks if a given user input is valid, and returns an error message if not.

Parameters:
text - the text to verify
s - the existing Statement that is being edited (may have null object)
Returns:
an error message or null

isResponsibleForDisplay

boolean isResponsibleForDisplay(com.hp.hpl.jena.rdf.model.Statement s)
Checks if this driver assumes responsibility for a given Statement. If yes, then this will be called to update style ranges.

Parameters:
s - the Statement (may have null object)
Returns:
true if this driver is responsible for displaying the given statement

isResponsibleForEditing

boolean isResponsibleForEditing(java.lang.String text,
                                com.hp.hpl.jena.rdf.model.Statement s)
Checks if this driver assumes responsibility for control editing and error checking a given text and Statement combination. If this takes responsibility then it will be asked to check errors, and to generate the new object value.

Parameters:
text - the current text entered by the user
s - the old Statement (may have a null object)
Returns:
true if this takes responsibility