package org.csstudio.opibuilder.adl2boy.translator;

import org.csstudio.opibuilder.model.AbstractContainerModel;
import org.csstudio.opibuilder.model.AbstractWidgetModel;
import org.csstudio.opibuilder.widgets.model.MenuButtonModel;
import org.csstudio.utility.adlparser.fileParser.ADLWidget;
import org.csstudio.utility.adlparser.fileParser.widgets.Menu;
import org.eclipse.swt.graphics.RGB;

public class Menu2Model extends AbstractADL2Model {
	MenuButtonModel menuModel = new MenuButtonModel();

	public Menu2Model(ADLWidget adlWidget, RGB[] colorMap, AbstractContainerModel parentModel) {
		super(adlWidget, colorMap, parentModel);
		parentModel.addChild(menuModel, true);

		Menu menuWidget = new Menu(adlWidget);
		if (menuWidget != null) {
			setADLObjectProps(menuWidget, menuModel);
			setADLControlProps(menuWidget, menuModel);
		}
		menuModel.setPropertyValue(MenuButtonModel.PROP_ACTIONS_FROM_PV, true);
		//TODO add color Mode to Menu2Model
	}

	@Override
	public	AbstractWidgetModel getWidgetModel() {
		return menuModel;
	}

}

@@ -161,24 +161,88 @@
 idgetModel;%0A
+import org.csstudio.opibuilder.widgets.model.ActionButtonModel;%0A
 import org.c
@@ -980,43 +980,518 @@
 ;%0A%09%09
-//TODO add color Mode to Menu2Model
+String color_mode = menuWidget.getColor_mode();%0A%09%09if ( color_mode.equals(%22static%22) )%7B%0A%09%09%09menuModel.setPropertyValue(ActionButtonModel.PROP_FORECOLOR_ALARMSENSITIVE, false);%0A%09%09%7D%0A%09%09else if (color_mode.equals(%22alarm%22) )%7B%0A%09%09%09menuModel.setPropertyValue(ActionButtonModel.PROP_FORECOLOR_ALARMSENSITIVE, true);%0A%09%09%7D%0A%09%09else if (color_mode.equals(%22discrete%22) )%7B%0A%09%09%09menuModel.setPropertyValue(ActionButtonModel.PROP_FORECOLOR_ALARMSENSITIVE, false);%0A%09%09%09//TODO Menu2Model Figure out what to do if colorMode is discrete%0A%09%09%7D
 %0A%09%7D%0A
@@ -1569,14 +1569,15 @@
 uModel;%0A
-
 %09%7D%0A%0A
+%0A
 %7D%0A

Add code to get alarm sensitive color mode.