package org.csstudio.utility.adlparser.fileParser.widgets;

import org.csstudio.utility.adlparser.fileParser.ADLWidget;
import org.csstudio.utility.adlparser.fileParser.WrongADLFormatException;
import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLControl;
import org.csstudio.utility.adlparser.fileParser.widgetParts.ADLObject;

public class Menu extends ADLAbstractWidget {

	public Menu(ADLWidget adlWidget) {
		super(adlWidget);
		try {
			for (ADLWidget childWidget : adlWidget.getObjects()) {
	        	if (childWidget.getType().equals("control")){
	        		_adlControl = new ADLControl(childWidget);
	        		if (_adlControl != null){
	        			_hasControl = true;
	        		}
	        	}
	        	else if (childWidget.getType().equals("object")){
	        		_adlObject = new ADLObject(childWidget);
	        		if (_adlObject != null){
	        			_hasObject = true;
	        		}
	        		
	        	}
	        }
		}
		catch (WrongADLFormatException ex) {
			ex.printStackTrace();
		}
		// TODO Add ColorMode to Menu
	}
}

@@ -113,16 +113,75 @@
 Widget;%0A
+import org.csstudio.utility.adlparser.fileParser.FileLine;%0A
 import o
@@ -395,54 +395,174 @@
 ct;%0A
-%0Apublic class Menu extends ADLAbstractWidget %7B
+import org.csstudio.utility.adlparser.internationalization.Messages;%0A%0Apublic class Menu extends ADLAbstractWidget %7B%0A%09private String color_mode = new String(%22static%22);
 %0A%0A%09p
@@ -1118,109 +1118,758 @@
 %7D%0A%09%09
-%7D%0A%09%09catch (WrongADLFormatException ex) %7B%0A%09%09%09ex.printStackTrace();%0A%09%09%7D%0A%09%09// TODO Add 
+%09for (FileLine fileLine : adlWidget.getBody())%7B%0A%09%09%09%09String bodyPart = fileLine.getLine();%0A%09%09%09%09String%5B%5D row = bodyPart.trim().split(%22=%22);%0A%09%09%09%09if (row.length %3C 2)%7B%0A%09%09%09%09%09throw new WrongADLFormatException(Messages.Label_WrongADLFormatException_Parameter_Begin + bodyPart + Messages.Label_WrongADLFormatException_Parameter_End);%0A%09%09%09%09%7D%0A%09%09%09%09if (FileLine.argEquals(row%5B0%5D, %22color mode%22))%7B%0A%09%09%09%09%09setColor_mode(FileLine.getTrimmedValue(row%5B1%5D));%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09catch (WrongADLFormatException ex) %7B%0A%09%09%09ex.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%09/**%0A%09 * @param color_mode the color_mode to set%0A%09 */%0A%09private void set
 Color
-Mode to Menu
+_mode(String color_mode) %7B%0A%09%09this.color_mode = color_mode;%0A%09%7D%0A%0A%09/**%0A%09 * @return the color_mode%0A%09 */%0A%09public String getColor_mode() %7B%0A%09%09return color_mode;
 %0A%09%7D%0A

Add code to get color mode