* Need to provide simple methods in the partitioner or document to
* retrieve the stored partition details.
*
*/
SyntaxDictionary sd = DictionaryManager.getDictionary(DictionaryManager.CFDIC);
Tag tg = null;
try
{
Set elements = ((ISyntaxDictionary)sd).getAllElements();
Iterator it = elements.iterator();
while(it.hasNext())
{
String ename = (String)it.next();
//System.out.println(ename);
tg = sd.getTag(ename);
rules.add(new NamedTagRule("<" + ename,">", CF_START_TAG, CF_TAG_ATTRIBS));
//if(!tg.isSingle())
//{
rules.add(new NamedTagRule("</" + ename,">", CF_END_TAG, CF_END_TAG));
//}
}
}
catch(Exception e)
{
e.printStackTrace(System.err);
}
//these are not really handled in the dictionary because you can call
//normal pages as cf_'s
rules.add(new CustomTagRule("<cf_",">", CF_START_TAG, CF_TAG_ATTRIBS));
rules.add(new CustomTagRule("</cf_",">", CF_END_TAG, CF_END_TAG));
//do the html tags now
sd = DictionaryManager.getDictionary(DictionaryManager.HTDIC);
try
{
Set elements = ((ISyntaxDictionary)sd).getAllElements();
//this is going to be used to tell if we need to add a form, table,
//or normal tag for the html tags
String startTokenType = HTM_START_TAG;
String endTokenType = HTM_END_TAG;
String midTokenType = HTM_TAG_ATTRIBS;
//loop over all the tags in the html dictionary and try to set the
//partition to the correct type
Iterator it = elements.iterator();
while(it.hasNext())
{
String ename = (String)it.next();
tg = sd.getTag(ename);
//colour form and table tags differently...
if(tg.isTableTag()) {
startTokenType = TABLE_START_TAG;
midTokenType = TABLE_TAG_ATTRIBS;