- 直接通过反射让组建监听所有的SWT.xxx??
- ?Class?userClass;??
- ????????try ?{??
- ????????????userClass?=?Class.forName(SWT.class .getName());??
- ????????????//加载类??? ??
- ????????????Field[]?fields?=?userClass.getDeclaredFields();//获得对象方法集合??? ??
- ????????????String?fdname?=?null ;??
- ????????????for ?( final ?Field?field?:?fields)?{ //?遍历该数组 ??
- ????????????????field.setAccessible(true );??
- ????????????????fdname?=?field.getName();??
- ????????????????if ?( true )?{??
- ????????????????????try ?{??
- ????????????????????????Integer?value?=?(Integer)?field.get(userClass);??
- ????????????????????????this .addListener(value,? new ?Listener()?{??
- ????????????????????????????@Override ??
- ????????????????????????????public ? void ?handleEvent(Event?event)?{??
- ????????????????????????????????System.err.println("group---->>" ?+?field.getName());??
- ????????????????????????????}??
- ????????????????????????});??
- ????????????????????}??
- ????????????????????catch ?(Exception?e)?{??
- ????????????????????????System.out.println(fdname?+?"?is?char" );??
- ????????????????????}??
- ????????????????}??
- ????????????}??
- ????????}??
- ????????catch ?(ClassNotFoundException?e1)?{??
- ????????????e1.printStackTrace();??
- ????????}??
- ????????catch ?(IllegalArgumentException?e)?{??
- ????????????e.printStackTrace();??
-
????????}?
详细解决方案
测试rcp 跟 rap 何时触发 组建.addListener(SWT.xxx, new Listener() )的方法
热度:748 发布时间:2012-09-02 21:00:34.0
相关解决方案
- struts2开发时出现的异常 Exception sending context initialized event to listener instance
- ORA-12518, TNS:listener could not hand off client connection
- 求 Oracle Database Server 'TNS Listener'远路数据投毒漏洞 补丁
- listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigur解决方法
- servlet学习笔记(四)-listener
- Tomcat7中web应用加载原理(3)Listener、Filter、Servlet的加载和调用
- 紧急Error configuring application listener of class org.springframework.web.context.ContextLoaderListe
- tomcat起动报错:Error configuring application listener of class org.springframework.web.context.ContextLo
- listener、filter、servlet、beans执行顺序怎么
- web.xml的施行顺序context-param -> listener -> filter -> servlet
- Error configuring application listener of class org.springframework.web.context
- 测试rcp 跟 rap 何时触发 组建.addListener(SWT.xxx, new Listener() )的方法
- 紧急 Exception sending context initialized event to listener instance of class or
- filter,interceptor,listener,该怎么处理
- 项目出现有关问题,严重: Exception sending context initialized event to listener instance.
- 求大侠帮忙 Exception sending context initialized event to listener instance of class解决办法
- Listener refused the connection with the following error: ORA-12519解决思路
- Element type "listener" must be declared 如何解决
- [tomcat启动报错] 严重: Error configuring application listener of class .该如何处理
- Listener refused the connection with the following error: ORA-12505, TNS:listene解决思路
- Error configuring application listener of class org.springframework.web.context.解决办法
- Listener refused the connection with the following error:
- 做定时器时的监听器 报错 严重: Error configuring application listener of class test.timer.Time,该怎么处理
- 严重: Exception sending context initialized event to listener instance of class or解决方案
- Tomcat启动有关问题:The listener "listeners.SessionListener" is already configured for this context
- Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
- Servlet使用引文标注监听器(Listener)
- Eclipse插件开发中的取舍监听机制(Selection Provider-Listener)
- 惊人: Error configuring application listener of class sy.listener.RepairListener
- 怎么在Java类中初始化context-param -> listener -> filter -> servlet