rcpとrapがいつ構築をトリガーするかをテストします.addListener(SWT.xxx,new Listener()の方法

1376 ワード

 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();
        }