/*
 * Copyright (c) 2009 The Olympos Development Team.
 * 
 * http://sourceforge.net/projects/olympos/
 * 
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html. If redistributing this code, this
 * entire header must remain intact.
 */
Ext.namespace("cwe.transaction");

/**
 */
cwe.transaction.Panel = function() {
};

cwe.transaction.Panel = Ext.extend(cwe.modelgrid.ModelGridPanel, {
	initComponent : function() {
		this.modelDescription = chi.model.ModelDescriptionContainer.getInstance().getDescription("Transaction");

		cwe.transaction.Panel.superclass.initComponent.apply(this, arguments);
	}
});

cwe.transaction.Panel.prototype.getTitle = function() {
	var title = this.account.get ? this.account.get("title") : this.account.getOid();
	
	return chi.Dict.translate("Transactions of ${1}", title);
};

cwe.transaction.Panel.prototype.createEditors = function() {
	return new cwe.transaction.EditorContainer( {
	    modelDescription : this.modelDescription,
	    account : this.account
	});
};

cwe.transaction.Panel.prototype.createGrid = function() {
	return new cwe.transaction.Grid( {
	    modelDescription : this.modelDescription,
	    editors : this.editors,
	    account : this.account
	});
};
