/* D-RexGxt - D-RexGxt - GUI Design Tool for GWT
 * Copyright (c) 2008,  KPS Corporation
 * All rights reserved.
 *
 * Open Source License
 * ------------------------------------------------------------------------------------------
 * D-RexGxt is licensed under the terms of the Open Source GPL 3.0 license.
 *
 * http://www.gnu.org/licenses/gpl.html
 *
 * --
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */
package jp.co.kpscorp.gwt.client.design.gxt.delegate.layout;

import jp.co.kpscorp.gwt.client.design.WidgetService;
import jp.co.kpscorp.gwt.client.design.delegate.BaseDelegate;
import jp.co.kpscorp.gwt.client.design.gxt.widget.ArrayListWidget;
import jp.co.kpscorp.gwt.client.design.gxt.widget.ColumnConfigWidget;

import com.extjs.gxt.ui.client.widget.Component;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;


public class ArrayListDelegate extends BaseDelegate {

	private ArrayListWidget<ColumnConfig> comp;

	protected String[] props = {};

	public ArrayListDelegate(WidgetService service, Component widget) {
		super();
		this.comp = (ArrayListWidget<ColumnConfig>) widget;
	}

	@Override
	public Object exec(String mthodName, Object[] parms) {
		if ("add".equals(mthodName) && parms[0] instanceof ColumnConfigWidget) {
			ColumnConfigWidget ccw = (ColumnConfigWidget) parms[0];
			comp.add(ccw.getWrapConfig());
			return comp;
		}
		return null;
	}

}
