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

📄 hibernateproperty.java

📁 eclipse的hibernate插件,支持eclipse2.*版本
💻 JAVA
字号:
/* * Created on 2003-5-23 * */package com.tanghan.plugin.hibernate.editor.elements;import java.util.ArrayList;import java.util.List;import java.util.Properties;import java.util.ResourceBundle;import org.eclipse.ui.views.properties.IPropertyDescriptor;import org.eclipse.ui.views.properties.IPropertySource;import org.eclipse.ui.views.properties.PropertyDescriptor;import com.tanghan.plugin.TanghanPlugin;import com.tanghan.util.DealString;/** * @author Jerry Tang * @version v0.1.0 * @copyright  (C) 2003 Tanghan工作组 *  */public class HibernateProperty implements IPropertySource {	private static ResourceBundle res = TanghanPlugin.getDefault().getResourceBundle();	/**提供属性名称*/	private Properties propLabel ;	/**提供属性值*/	private Properties propValue ;	/**记录有多少属性*/	private List idList ;		private IPropertyDescriptor[] propDescriptors;		public HibernateProperty(HibernateTreeObject obj){		propLabel = new Properties();		propValue = new Properties();		idList = new ArrayList();		//表		HibernateElementAttributes heAttr = (HibernateElementAttributes)obj.getObject();				List attList = heAttr.getAllAttributes();		Properties prop = heAttr.getCurrentAttributes();				for(int i=0;i<attList.size();i++){			ElementAttribute elemAtt = (ElementAttribute)attList.get(i);			propLabel.setProperty(elemAtt.getAttributeName(),elemAtt.getAttributeName());			String value = DealString.trim(prop.getProperty(elemAtt.getAttributeName()));			propValue.setProperty(elemAtt.getAttributeName(),value);			idList.add(elemAtt.getAttributeName());		}						propDescriptors = new IPropertyDescriptor[idList.size()];		for(int i=0;i<idList.size();i++){			propDescriptors[i]=new PropertyDescriptor(idList.get(i),(String)propLabel.get(idList.get(i)));		}	}		/* (non-Javadoc)	 * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue()	 */	public Object getEditableValue() {		return null;	}	/* (non-Javadoc)	 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()	 */	public IPropertyDescriptor[] getPropertyDescriptors() {		return propDescriptors;	}	/* (non-Javadoc)	 * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)	 */	public Object getPropertyValue(Object id) {		return propValue.get(id);	}	/* (non-Javadoc)	 * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)	 */	public boolean isPropertySet(Object id) {		return false;	}	/* (non-Javadoc)	 * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object)	 */	public void resetPropertyValue(Object id) {	}	/* (non-Javadoc)	 * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)	 */	public void setPropertyValue(Object id, Object value) {	}}

⌨️ 快捷键说明

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