//1、先创建控件对象
KDCheckBox chkkDCheckBox = new KDCheckBox();
//2、给控件对象赋值
Hashtable hashTable = new Hashtable();
DEPUtils.findComponent(this, new String[]{"chkkDCheckBox"},hashTable);
if(hashTable.size()> 0) {
if(hashTable.get("chkkDCheckBox")!=null){
chkkDCheckBox = (KDCheckBox)hashTable.get("chkkDCheckBox");
}
}
//3、拿该控件对象的值(此处的控件时boolean类型)
boolean boolean1 = chkkDCheckBox.isSelected();
//下面是工具类
/*jadclipse*/
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) radix(10) lradix(10)
// Source File Name: DEPUtils.java
package com.kingdee.eas.uushtg.util;
import com.kingdee.bos.metadata.IMetaDataLoader;
import com.kingdee.bos.metadata.MetaDataLoaderFactory;
import com.kingdee.bos.metadata.entity.EntityObjectInfo;
import com.kingdee.bos.util.BOSObjectType;
import java.awt.Component;
import java.awt.Container;
import java.util.Hashtable;
public class DEPUtils
{
public DEPUtils()
{
}
public static void findComponent(Component comp, String controls[], Hashtable found)
{
Container con = null;
boolean nameEquals = false;
String CompName = null;
if(comp instanceof Container)
{
CompName = comp.getName();
if(CompName != null)
{
for(int i = 0; i < controls.length; i++)
{
if(!CompName.equals(controls[i]) || found.containsKey(CompName))
continue;
found.put(CompName, comp);
nameEquals = true;
break;
}
}
if(found.size() != controls.length)
{
con = (Container)comp;
int count = con.getComponentCount();
for(int i = 0; i < count; i++)
{
findComponent(con.getComponent(i), controls, found);
if(found.size() == controls.length)
return;
}
}
}
}
public static String getEntityName(String bostype)
{
IMetaDataLoader imetadataloader = MetaDataLoaderFactory.getRemoteMetaDataLoader();
EntityObjectInfo entityobjectinfo = imetadataloader.getEntity(BOSObjectType.create(bostype));
return entityobjectinfo.getName();
}
}
/*
DECOMPILATION REPORT
Decompiled from: D:\BOS\shtg\Project_0\lib\sp\uushtg_class.jar
Total time: 52 ms
Jad reported messages/errors:
Exit status: 0
Caught exceptions:
*/
dep拓展的单头字段,如何用java代码拿该字段的值
最新推荐文章于 2020-11-20 14:52:39 发布