/*
 * 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.EditorContainer = function() {
};

cwe.transaction.EditorContainer = Ext.extend(cwe.editor.EditorContainer, {});

/**
 */
cwe.transaction.EditorContainer.prototype.loadOrShow = function(oid, label, newObject) {
	var editor = this.editors.get(oid);

	if (!editor) {
		editor = new cwe.transaction.Editor( {
		    oid : oid,
		    title : label || chi.Dict.translate("(no label)"),
		    newObject : newObject,
		    modelDescription : this.modelDescription,
		    editorContainer : this,
		    account : this.account
		});
		this.addEditor(oid, editor);
		this.add(editor);
	}

	editor.show();
	editor.doLayout();
};
