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

📄 extendsconfig.java

📁 一个eclipse插件源代码。用于web开发
💻 JAVA
字号:
/*
 * $Header: /home/cvs/WEBPUMP2.0/WebPumpIDE_Src/WebPumpIDE/src/com/webpump/ui/project/ExtendsConfig.java,v 1.1.1.1 2004/07/01 09:07:51 wang_j Exp $
 * $Revision: 1.1.1.1 $
 * $Date: 2004/07/01 09:07:51 $
 *
 * ====================================================================
 *
 * 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.project;

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

import org.eclipse.pde.core.IModelChangedEvent;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

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

/**
 * web.xml extend Config
 * 
 * @author wang_j
 * @version 2.0 2004-02-11 
 */
public class ExtendsConfig extends BaseDataObject{
	
	//扩展配置信息
	private Vector m_vExtendsInfo;
	
	/**
	 * parse the document's node
	 */
	public void parse(Node node, Hashtable lineTable) 
	{
		bindSourceLocation(node, lineTable);
		NodeList children = node.getChildNodes();
		m_vExtendsInfo = new Vector();
		for (int i = 0; i < children.getLength(); i++) {
			Node child = children.item(i);
				parseChild(child, lineTable) ;
		}
		addComments(node);		    	
	}
	
	protected void parseChild(Node node, Hashtable lineTable) {
		String tag = node.getNodeName().toLowerCase();
		if (tag.equals("param")) {			
			
			ExtendsInfo objExtendsInfo = new ExtendsInfo();
			
			objExtendsInfo.setModel(getModel());
			objExtendsInfo.setParent(this); 
			objExtendsInfo.setInTheModel(true);	
			objExtendsInfo.parse(node,lineTable);
			objExtendsInfo.setInTheModel(true);
			objExtendsInfo.parse(node,lineTable);
			m_vExtendsInfo.add(objExtendsInfo);
		}    	
	}
	
	
	/**
	 * write the xml'info to file
	 */
	public void write(String indent, PrintWriter writer) {
	
		String indent2 = indent + INDENT;
		String indenta = indent + INDENT + INDENT;
				
		writeComments(writer);		
		writer.println(indent2 + "<extends-config>");
		writeChildren(indent2,m_vExtendsInfo,writer);
		writer.println(indent2 + "</extends-config>");			
	}
	
	/**
	 * return this data object's child
	 */
	public Object[] getChild() {
		return m_vExtendsInfo.toArray();
	}
	
	/**
	 * get the object's info
	 */
	public String toString()
	{
		return WebpumpIDEPlugin.getResourceString(MacroResource.EXTENDSCONFIG_TITLE);
	}
	
	/**
	 * add data object 
	 * @param object ExtendsInfo
	 */
	public void add(Object object)
	{
		if (object instanceof ExtendsInfo)		
		{
			ExtendsInfo objExtendsInfo = (ExtendsInfo)object;			
			objExtendsInfo.setModel(getModel());
			objExtendsInfo.setParent(this); 
			objExtendsInfo.setInTheModel(true);	
			m_vExtendsInfo.add(objExtendsInfo);
			
			fireStructureChanged(objExtendsInfo, IModelChangedEvent.INSERT);		
		}
	}
	
	/**
	 * remove data 
	 * @param object ExtendsInfo
	 */
	public void remove(Object object)
	{
		if (object instanceof ExtendsInfo)		
		{
			ExtendsInfo objExtendsInfo = (ExtendsInfo)object;			
			objExtendsInfo.setInTheModel(false);	
			m_vExtendsInfo.remove(objExtendsInfo);		
			fireStructureChanged(objExtendsInfo, IModelChangedEvent.REMOVE);	
		}
	}	
}

⌨️ 快捷键说明

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