//----------------------------BEGIN LICENSE----------------------------
/* 
 * Willow : the Open Source WorkFlow Project
 * Distributable under GNU LGPL license by gun.org
 *
 * Copyright (C) 2004-2010 huihoo.org 
 * Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com> 
 * 
 * ====================================================================
 * Project Homepage : http://www.huihoo.org/god4j
 * Source Forge     : http://sourceforge.net/projects/huihoo
 * Mailing list     : god4j@lists.sourceforge.net 
 */
//----------------------------END  LICENSE-----------------------------
package org.huihoo.god4j.editor.elements.atoms;
import org.huihoo.god4j.editor.XPDLComplexComponent;
import org.huihoo.god4j.editor.XPDLSimpleComponent;
import org.huihoo.god4j.editor.panels.JavaMultiLineTextPanel;
import org.huihoo.god4j.editor.panels.JavaPanel;
// This is not a real definition, but it's simple type replacement
/**
* Represents a WfMC DTD element that has the similar name.
* <p>NOTE: This element is not implemented as WfMC requires.
*/
public class XPDLXpression extends XPDLSimpleComponent
{ 
	public XPDLXpression(XPDLComplexComponent parent)
	{
		super("Xpression",parent);
	}
	
	/**
	* Prepares the panel for expression definition.
	*
	* @return XPDLPanel to be shown.
	*/
	public JavaPanel getJavaPanel()
	{
		return new JavaMultiLineTextPanel(this);
	}
	
//==================================================================
	/**
	* The classes that are derived from this class has to give its
	* definition for this method. It is used to insert all members
	* of those classes that are derived from XPDLComp
	* class (or classes that are derived from that class) into
	* one list, and the members that are derived from
	* XPDLAttribute class also to insert into other list.
	* Many methods of this class uses those lists:
	* <code>toXPDL</code> method uses them to properly write an element
	* tag to the XPDL file,
	* <code>fromXPDL</code> method uses them to properly read an element
	* tag from the XPDL file,
	* <code>getPanel</code> method uses them to properly display members
	* of this class,
	* <code>get</code> and <code>set</code> uses them to properly
	* retrieve/set the elements from list, ... and so on
	* <p>NOTE: The order of inserted elements is relevant for XPDL to be
	*          valid (members of classes derived from this class must be
	*          inserted into first mentioned list in the same order that
	*          they are within a corresponding tag for those classes
	*          within WfMC XPDL).
	*/
	public void initComponent()
	{
//	-----------------------------------------------
		super.initComponent();
//	-----------------------------------------------	
	}

	public void structComponent()
	{
		//	-----------------------------------------------
		super.structComponent();
		//	-----------------------------------------------
	}
	
	/**
	* Supposed to be overriden by derived classes to implement
	* element specific reading from an XPDL Model. This implementation
	* satisfies only "simple" elements.
	*/
	public void loadComponent() 
	{
//	-----------------------------------------------
		super.loadComponent();
//	-----------------------------------------------
	}

	/**
	* Supposed to be overriden by derived classes to implement
	* element specific writting to an XPDL Model.
	*
	*/
	public void saveComponent() 
	{
    if(isReadOnly())
    {
      return;
    }
    
//	-----------------------------------------------
		super.saveComponent();
//	-----------------------------------------------
	}
	
//==================================================================
}
