⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 validationform.java

📁 一个eclipse插件源代码。用于web开发
💻 JAVA
字号:
/*
 * $Header: /home/cvs/WEBPUMP2.0/WebPumpIDE_Src/WebPumpIDE/src/com/webpump/ui/validation/ValidationForm.java,v 1.1.1.1 2004/07/01 09:07:53 wang_j Exp $
 * $Revision: 1.1.1.1 $
 * $Date: 2004/07/01 09:07:53 $
 *
 * ====================================================================
 *
 * The NanJing HopeRun(IT-FOREST) Software License, Version 2.0.0
 *
 * Copyright 2003-2004 by NanJing HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and
 *                        IT Forest Corporation
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
 * You shall not disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into with
 * HopeRun(IT-FOREST) Information System Co., Ltd, CHINA and IT Forest Corporation.
 */
package com.webpump.ui.validation;

import java.util.Hashtable;
import java.util.Vector;
import java.io.PrintWriter;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.core.*;
import org.w3c.dom.*;

import com.webpump.ui.base.data.*;
import com.webpump.ui.perspective.MacroResource;
import com.webpump.ui.perspective.WebpumpIDEPlugin;

/**
 * Class for defining the data structure of the child node <form> in "validation.xml".
 * 
 * @author zhao_f
 * @version 2.0.0 2004-1-13
 */
public class ValidationForm extends BaseDataObject{	
	final static String INDENT = "   ";
	    
	//结点名称
	private String m_strForm = WebpumpIDEPlugin.getResourceString(MacroResource.VALIDATIONFORM_STRING_FORM);	
	    
	//子结点集合
    private Vector vFields;
    
	private Object[] objParameterInfo;
		
   /**
	* Parse the given node by searching all its children repeatingly and parsing each of them respectively
	* @param node the node which is going to be parsed
	* @param lineTable
	*/
	public void parse(Node node, Hashtable lineTable)  {
		
	    bindSourceLocation(node, lineTable);
	    
		if (vFields==null) vFields = new Vector();
		
		//获得结点的属性	 
		m_strForm = getNodeAttribute(node, "name");

		NodeList children = node.getChildNodes();
		for (int i = 0; i < children.getLength(); i++) {
			Node child = children.item(i);
			parseChild(child,vFields,lineTable);
		}
		addComments(node);			
	}
	
	/**
	 * Parse the children nodes got from the method above
	 * @param node the node whihch is going to be parsed
	 * @param vInfo a group of objects which is used to store the children nodes
	 * @param lineTable
	 */	
    protected void parseChild(Node node,Vector vInfo, Hashtable lineTable)   {
		//Get the tag of the given node
		String tag = node.getNodeName().toLowerCase();
		
		//Identify whether the tag of the node is "field" and handle it accordingly
		if (tag.equals("field")) {			
			
			String strProperty = getNodeAttribute(node,"property");
			
			ValidationFields objValidationFields = null;
			
			for (int j=0;j<vFields.size();j++)
			{
				String strExistField = ((ValidationFields)vFields.elementAt(j)).toString() ;
				if (strExistField.equals(strProperty))
				{
					objValidationFields = (ValidationFields)vFields.elementAt(j);
					break;
				}
			}
			
			if (objValidationFields!=null)
			{			
				
				objValidationFields.setModel(getModel());
				objValidationFields.setParent(this); 
				objValidationFields.setInTheModel(true);
				//Parse the child node in ValidationForm	
				objValidationFields.parse(node,lineTable);
			}

		}
	}
		
	/**
	 * Restore the Property
	 * @param name
	 * @param oldValue
	 * @param newValue
	 */	
	public void restoreProperty(String name, Object oldValue, Object newValue)
		throws CoreException {
		super.restoreProperty(name, oldValue, newValue);
	}
	
	/**
	 * Write this node in "exception.xml"
	 * @param indent
	 * @param writer
	 */
	public void write(String indent, PrintWriter writer) {
	    writeComments(writer);
	    String indent2 = indent + INDENT;
	    String indenta = indent + INDENT + INDENT;
		
		//判断是不是该结点的所有Field子结点的depends参

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -