package com.hp.cp.pm.gwt.ui.client.controls;

import com.google.gwt.core.client.JavaScriptObject;
import com.smartgwt.client.types.MenuFieldID;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.menu.SelectionTreeMenu;

public class PMDarkPickTreeMenu extends SelectionTreeMenu {
	public PMDarkPickTreeMenu() {
		super();
		init();
	}
	
	public PMDarkPickTreeMenu(String id) {
		super.setID(id);
		init();
	}
	
	public PMDarkPickTreeMenu(JavaScriptObject jsObj) {
		super(jsObj);
		init();
	}
	
	@Override
	public void onDraw() {
		super.onDraw();
		hideField(MenuFieldID.ICON.getValue());
		
		ListGridField titleField = getField(MenuFieldID.TITLE.getValue());
		titleField.setBaseStyle("pm-darkMenuTitleField"); //$NON-NLS-1$
		
		redraw("changed field styles"); //$NON-NLS-1$
	}
	
	private void init() {
		setBodyStyleName("pm-darkMenuBody"); //$NON-NLS-1$
		setIconBodyStyleName("pm-darkMenuBody"); //$NON-NLS-1$
		setBackgroundColor(null);
		setBaseStyle("pm-darkMenuEmptyField"); //$NON-NLS-1$
		setStyleName("pm-darkMenu"); //$NON-NLS-1$
		setShowKeys(false);
		setShowAnimationEffect("fade"); //$NON-NLS-1$
	}
}
