Extending Rinzo

Although Rinzo tries to be as completed and generic as possible we understand the XML world and user needs are wider, we are starting to take advantage of Eclipse extensibility to leave some doors opened to allow the generation of new behaviors.

In order to use them it is required some knowledge on writing Eclipse plugins. At least how to contribute to an extension point

At this moment there is 3 extension points, 2 to contribute content assistance and 1 to add validators.

Examples of this extension points could be seen in the implementation of both Rinzo's plugins.

Content Assist Extension Point

ar.com.tadp.xml.rinzo.core.contentAssist

This extension point allows to add an Eclipse's generic content assist processor to the cycle of gathering proposals.

In order to use it you have to contribute a class implementing Eclipse's interface org.eclipse.jface.text.contentassist.IContentAssistProcessor where you must place the behavior you require to generate the list of proposals to be displayed to the end user.

ar.com.tadp.xml.rinzo.core.xmlContentAssist

This is a more specialized content assist processor a little bit more integrated with the XML domain modeling used by Rinzo to handle a document.

In this case you'll have to contribute a class implementing Rinzo's interface ar.com.tadp.xml.rinzo.core.contentassist.processors.IXMLContentAssistProcessor which defines the following callback methods:

public interface IXMLContentAssistProcessor {

  public void addBodyProposals(XMLNode currentNode, String prefix, ITextViewer viewer, int offset, 
                                        Collection results);

  public void addCloseTagProposals(XMLNode currentNode, String prefix, ITextViewer viewer, 
                                            int offset, Collection results);

  public void addAttributeValuesProposals(XMLNode currentNode, String attributeName, String prefix, 
                                            ITextViewer viewer, int offset, Collection results);

  public void addAttributeProposals(XMLNode currentNode, String prefix, ITextViewer viewer,int offset, 
                                        Collection results);
}

Each one of this methods will be called by Rinzo when proposals are required in each sections of the XML document and the proposals being generated by the custom implementation should be retrieved to Rinzo by adding them in the collection results.

Validation Extension Point

ar.com.tadp.xml.rinzo.core.validators

In order to use this extension point you should contribute a class implementing Rinzo's interface ar.com.tadp.xml.rinzo.core.resources.validation.XmlValidator

public interface XmlValidator {
        public void validate(RinzoXMLEditor editor);
}

Implementors of this interface will receive as a parameter the Rinzo's editor object from which can be taken the required context to implement a validator either by using the string content of the editor or the AST model generated by Rinzo.