}
public void tagFound(ParserEvent e) {
debug("tagFound " + e.getTag().name);
Locale locale = null;
LangElement le;
Tag tag = e.getTag();
String name = tag.name;
int x=0, y=0, width=0, height=0;
TagProperties attr = tag.atts;
Hashtable ht = (attr == null) ? null : attr.getHashtable();
if (attr != null) {
String lang = attr.getProperty("xml:lang");
locale = HelpUtilities.localeFromLang(lang);
viewMergeType = attr.getProperty("mergetype");
helpActionImage = attr.getProperty("image");
String value = null;
value = attr.getProperty("width");
if (value != null) {
width = Integer.parseInt(value);
}
value = null;
value = attr.getProperty("height");
if (value != null) {
height = Integer.parseInt(value);
}
value = null;
value = attr.getProperty("x");
if (value != null) {
x = Integer.parseInt(value);
}
value = null;
value = attr.getProperty("y");
if (value != null) {
y = Integer.parseInt(value);
}
value = null;
value = attr.getProperty("default");
if (value != null && value.equals("true")) {
defaultPresentation = true;
}
value = null;
value = attr.getProperty("displayviews");
if (value != null && value.equals("false")) {
displayViews = false;
}
value = null;
value = attr.getProperty("displayviewimages");
if (value != null && value.equals("false")) {
displayViewImages = false;
}
}
if (locale == null) {
locale = lastLocale;
}
if (name.equals("helpset")) {
if (tag.isEnd) {
removeTag(tag);
} else {
// Check and see if the locale is different from the
// defaultLocale. If it is then reset the locale.
if (! locale.equals(defaultLocale) &&
! locale.equals(myHSLocale)) {
if (locale != null) {
myHS.setLocale(locale);
defaultLocale = locale;
}
}
if (attr != null) {
String version = attr.getProperty("version");
if (version != null &&
(version.compareTo("1.0") != 0 &&
version.compareTo("2.0") != 0)) {
parsingError("helpset.unknownVersion", version);
}
}
addTag(tag, locale);
}
return;
}
if (tagStack.empty()) {
parsingError("helpset.wrongTopLevel", name);
}
// Get the parents name
le = (LangElement) tagStack.peek();
String pname = ((Tag) le.getTag()).name; // the parent
if (name.equals("title")) {
// TITLE tag
if (tag.isEnd) {
removeTag(tag); // processing was done in textFound()