package org.csstudio.utility.adlparser.fileParser;

import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLBasicAttribute;
import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLControl;
import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLDynamicAttribute;
import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLMonitor;
import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLObject;
import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLPoints;
import org.csstudio.utility.adlparser.fileParser.widgetParts.RelatedDisplayItem;

public class ADLWidgetUtils {
	public static Object[] getADLWidgetChildren(ADLWidget adlWidget){
		try {
			System.out.println("getADLWidgetChildren " + adlWidget.getType());
			if ( adlWidget.getType().equals("basic attribute")){
				return (new ADLBasicAttribute(adlWidget)).getChildren();
			}
			else if ( adlWidget.getType().equals("object")){
				return (new ADLObject(adlWidget)).getChildren();
			}
			else if ( adlWidget.getType().equals("control")){
				return (new ADLControl(adlWidget)).getChildren();
			}
			else if ( adlWidget.getType().equals("monitor")){
				return (new ADLMonitor(adlWidget)).getChildren();
			}
			else if ( adlWidget.getType().equals("points")){
				return (new ADLPoints(adlWidget)).getChildren();
			}
			else if ( adlWidget.getType().contains("display[")){
				return (new RelatedDisplayItem(adlWidget)).getChildren();
			}
			else if ( adlWidget.getType().equals("dynamic attribute")){
				System.out.println("Catching dynamic attribute");
				return (new ADLDynamicAttribute(adlWidget)).getChildren();
			}

		}
		catch (WrongADLFormatException ex){
			System.out.println("problem parsing " + adlWidget.getType());
			ex.printStackTrace();
		}
		return adlWidget.getObjects().toArray();
	}
	
}

@@ -272,32 +272,104 @@
 namicAttribute;%0A
+import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLLimits;%0A
 import org.csstu
@@ -1586,54 +1586,167 @@
 %09%09%09%09
-System.out.println(%22Catching dynamic attribute
+return (new ADLDynamicAttribute(adlWidget)).getChildren();%0A%09%09%09%7D%0A%09%09%09else if ( adlWidget.getType().equals(%22limits%22))%7B%0A%09%09%09%09System.out.println(%22--Processing limits
 %22);%0A
@@ -1764,32 +1764,22 @@
 (new ADL
-DynamicAttribute
+Limits
 (adlWidg

Add in ADLLimits part