if (f == null || !f.exists())
return;
TaglibHelper helper = TaglibHelperManager.getInstance().getTaglibHelper(f);
String decl = ""; //$NON-NLS-1$
List problems = new ArrayList();
CustomTag tag = helper.getCustomTag(tagToAdd, getStructuredDocument(), customTag, problems);
TaglibVariable[] taglibVars = tag.getTagVariables();
fTranslationProblems.addAll(problems);
/*
* Add AT_BEGIN variables
*/
for (int i = 0; i < taglibVars.length; i++) {
if (taglibVars[i].getScope() == VariableInfo.AT_BEGIN) {
decl = taglibVars[i].getDeclarationString();
appendToBuffer(decl, fUserCode, false, customTag);
}
}
boolean isEmptyTag = false;
if (index != -1)
isEmptyTag= isEmptyTag(customTag, index);
else
isEmptyTag= isEmptyTag(customTag);
/*
* Add a single { to limit the scope of NESTED variables
*/
StringBuffer text = new StringBuffer();
if (!isEmptyTag && tag.isIterationTag() && tag.getTagClassName() != null) {
text.append("\nwhile(true) "); //$NON-NLS-1$
}
text.append("{ // <"); //$NON-NLS-1$
text.append(tagToAdd);
if (isEmptyTag)