org.topbraid.sparql.editor
Class SPARQLRowEditorDriver

java.lang.Object
  extended by org.topbraid.sparql.editor.SPARQLRowEditorDriver
All Implemented Interfaces:
IRowEditorDriver, IStylingRowEditorDriver

public class SPARQLRowEditorDriver
extends java.lang.Object
implements IStylingRowEditorDriver


Constructor Summary
SPARQLRowEditorDriver()
           
 
Method Summary
 void addNewStyles(java.lang.String str, IRowEditorStyle res)
           
 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.
static java.lang.String extractErrorMessage(int i, java.lang.Throwable ex)
           
 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.
static java.lang.String getErrorMessage(java.lang.String rawErrorMessage)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPARQLRowEditorDriver

public SPARQLRowEditorDriver()
Method Detail

addNewStyles

public void addNewStyles(java.lang.String str,
                         IRowEditorStyle res)
Specified by:
addNewStyles in interface IStylingRowEditorDriver

createObject

public com.hp.hpl.jena.rdf.model.RDFNode createObject(java.lang.String text,
                                                      com.hp.hpl.jena.rdf.model.Statement s)
Description copied from interface: IRowEditorDriver
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.

Specified by:
createObject in interface IRowEditorDriver
Parameters:
text - the user input
s - the existing Statement
Returns:
a new RDFNode

extractErrorMessage

public static java.lang.String extractErrorMessage(int i,
                                                   java.lang.Throwable ex)

getError

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

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

getErrorMessage

public static java.lang.String getErrorMessage(java.lang.String rawErrorMessage)

isResponsibleForDisplay

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

Specified by:
isResponsibleForDisplay in interface IRowEditorDriver
Parameters:
s - the Statement (may have null object)
Returns:
true if this driver is responsible for displaying the given statement

isResponsibleForEditing

public boolean isResponsibleForEditing(java.lang.String text,
                                       com.hp.hpl.jena.rdf.model.Statement s)
Description copied from interface: IRowEditorDriver
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.

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