use of kutch.biff.marvin.widget.QuickViewLCDWidget in project Board-Instrumentation-Framework by intel.
the class QuickViewLCDWidgetBuilder method Build.
public static QuickViewLCDWidget Build(FrameworkNode masterNode, String widgetDefFilename) {
QuickViewLCDWidget _widget = new QuickViewLCDWidget();
for (FrameworkNode node : masterNode.getChildNodes()) {
if (BaseWidget.HandleCommonDefinitionFileConfig(_widget, node)) {
} else if (node.getNodeName().equalsIgnoreCase("#comment")) {
} else if (node.getNodeName().equalsIgnoreCase("RowWidth")) {
String str = node.getTextContent();
try {
_widget.setRowWidth(Integer.parseInt(str));
} catch (NumberFormatException ex) {
LOGGER.severe("Invalid <RowWidth> in QuickViewWidget Widget Definition File : " + str);
return null;
}
} else if (node.getNodeName().equalsIgnoreCase("EvenBackgroundStyle")) {
_widget.setEvenBackgroundStyle(node.getTextContent());
} else if (node.getNodeName().equalsIgnoreCase("EvenStyle")) {
String ID = "";
if (node.hasAttribute("ID")) {
ID = node.getAttribute("ID");
}
_widget.setEvenStyle(ID, node.getTextContent());
} else if (node.getNodeName().equalsIgnoreCase("OddBackgroundStyle")) {
_widget.setOddBackgroundStyle(node.getTextContent());
} else if (node.getNodeName().equalsIgnoreCase("OddStyle")) {
String ID = "";
if (node.hasAttribute("ID")) {
ID = node.getAttribute("ID");
}
_widget.setOddStyle(ID, node.getTextContent());
} else if (node.getNodeName().equalsIgnoreCase("Order")) {
String strVal = node.getTextContent();
if (strVal.equalsIgnoreCase(QuickViewWidget.SortMode.Ascending.toString())) {
_widget.setSortMode(QuickViewLCDWidget.SortMode.Ascending);
} else if (strVal.equalsIgnoreCase(QuickViewLCDWidget.SortMode.Descending.toString())) {
_widget.setSortMode(QuickViewLCDWidget.SortMode.Descending);
} else if (strVal.equalsIgnoreCase(QuickViewWidget.SortMode.None.toString())) {
_widget.setSortMode(QuickViewLCDWidget.SortMode.None);
} else {
LOGGER.severe("Invalid <Order> Tag in QuickViewLCDWidget Widget Definition File. " + strVal);
return null;
}
} else {
LOGGER.severe("Invalid QuickViewLCDWidget Widget Definition File. Unknown Tag: " + node.getNodeName());
return null;
}
}
return _widget;
}
Aggregations