org.xwiki.gwt.wysiwyg.client.syntax
Interface SyntaxValidator


public interface SyntaxValidator

A syntax validator ensures that the XHTML code generated by the editor can be converted without loss of information to the underlying syntax. it does this by restricting the user actions (UI features) when they can generate XHTML constructs that don't have a correspondent in the underlying syntax.

Version:
$Id: 34b2df7db96894676e3276f3fa963273ff19667d $

Method Summary
 void addValidationRule(ValidationRule rule)
          Adds a new validation rule to the list of rules this syntax validator obeys.
 String getSyntax()
           
 boolean isValid(String feature, RichTextArea textArea)
          Verifies if a specific feature of the editor should be enabled, considering the current list of validation rules and the current state of the given text area.
 void removeValidationRule(ValidationRule rule)
          Removes the specified rule from the list of validation rules this syntax validator obeys.
 

Method Detail

addValidationRule

void addValidationRule(ValidationRule rule)
Adds a new validation rule to the list of rules this syntax validator obeys.

Parameters:
rule - The validation rule to be added.

isValid

boolean isValid(String feature,
                RichTextArea textArea)
Verifies if a specific feature of the editor should be enabled, considering the current list of validation rules and the current state of the given text area.

Parameters:
feature - The feature to be tested.
textArea - The text area whose current state should be considered.
Returns:
true if there's no rule that disables the specified feature.

removeValidationRule

void removeValidationRule(ValidationRule rule)
Removes the specified rule from the list of validation rules this syntax validator obeys.

Parameters:
rule - The validation rule to be removed.

getSyntax

String getSyntax()
Returns:
A string identifier for the syntax characterized by the underlying validation rules.


Copyright © 2004–2014 XWiki. All rights reserved.