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

📄 moduleinfo.java

📁 一个eclipse插件源代码。用于web开发
💻 JAVA
字号:
/*
 * $Header: /home/cvs/WEBPUMP2.0/WebPumpIDE_Src/WebPumpIDE/src/com/webpump/ui/project/ModuleInfo.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 org.w3c.dom.Node;
import org.w3c.dom.NodeList;

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

/**
 * Module Info's Object 
 * 
 * @author wang_j
 * @version 2.0 2004-02-11 
 */
public class ModuleInfo extends BaseObject{
	
	//模块名称
	private String m_strName     ;
	
	//模块路径
	private String m_strPath ;
	
	//备注
	private String m_strDescription   ;
	
	//Config扩展信息
	
	private String m_strConfig;
	
	/**
	 * parse the document's node
	 * @param node
	 * @param lineTable
	 */
	public void parse(Node node, Hashtable lineTable) {
		bindSourceLocation(node, lineTable);
		m_strName = getNodeAttribute(node,"name");
		m_strPath = getNodeAttribute(node,"path");
		m_strDescription = getNodeAttribute(node,"description");
		NodeList children = node.getChildNodes();

		for (int i = 0; i < children.getLength(); i++) {
			Node child = children.item(i);
				parseChild(child, lineTable) ;
		}
		addComments(node);
	}
	

	private void parseChild(Node node, Hashtable lineTable) {
		String tag = node.getNodeName().toLowerCase();
		if (tag.equals("config-extends")) m_strConfig = getNodeValue(node);
		
		if (m_strConfig==null) m_strConfig = "";
		
	}

	/**
	 * write the object to xml document
	 * @param indent 
	 * 		   write PrintWriter
	 */
	public void write(String indent, PrintWriter writer) {

		String indent2 = indent + INDENT;
		String indenta = indent + INDENT + INDENT;		
		writeComments(writer);
		writer.print(indent2 + "<module");
		writeIfDefined(" ", writer, "name", WebpumpIDEPlugin.filterXML(m_strName));
		writeIfDefined(" ", writer, "path", WebpumpIDEPlugin.filterXML(m_strPath));
		writeIfDefined(" ", writer, "description", WebpumpIDEPlugin.filterXML(m_strDescription));
		writer.println(">");
		writer.println(indenta + "<config-extends><![CDATA[");
		writer.println(indenta+ indent +m_strConfig.trim());
		writer.println(indenta+ indent+ "]]>");

		writer.println(indenta + "</config-extends>");

		writer.println(indent2 + "</module>");
				
	}
	
	/**
	 * the object's name
	 */	
	public String toString()
	{
		return m_strName;
	}
	
	/**
	 * return Model Info Array
	 * @return String[]
	 */
	public String[] getModelInfo()
	{
		String[] strModelInfoArray = new String[4];
		
		strModelInfoArray[0] = m_strName;
		strModelInfoArray[1] = m_strPath;
		strModelInfoArray[2] = m_strDescription;
		strModelInfoArray[3] = m_strConfig;
		
		return strModelInfoArray;
		
	}

	/**
	 * return Model Info Array
	 * @return String[]
	 */
	public void setModelInfo(String[] strModelInfoArray)
	{
		
		String[] strOldArray = getModelInfo();
		m_strName = strModelInfoArray[0];
		m_strPath = strModelInfoArray[1];
		m_strDescription = strModelInfoArray[2];
		m_strConfig = strModelInfoArray[3];
		

		firePropertyChanged("ModuleInfo",strOldArray,strModelInfoArray);
	}
}

⌨️ 快捷键说明

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