[zb4osgi-changeset] [scm] ZigBee 4 OSGi repository change: r565 - in /projects/zb4osgi/trunk/zigbee.tester/src/main/java/org/persona/zigbee/tester/gui: CommandActionPanel.java HADeviceTreeNode.java

scm-notify at zb4osgi.aaloa.org scm-notify at zb4osgi.aaloa.org
Wed Oct 24 09:38:32 CEST 2012


Author: stefano.lenzi
Date: Wed Oct 24 09:38:32 2012
New Revision: 565

Log:
Trying to show only the Command on the ZigBee Tester ( refs #150 )


Modified:
    projects/zb4osgi/trunk/zigbee.tester/src/main/java/org/persona/zigbee/tester/gui/CommandActionPanel.java
    projects/zb4osgi/trunk/zigbee.tester/src/main/java/org/persona/zigbee/tester/gui/HADeviceTreeNode.java

Modified: projects/zb4osgi/trunk/zigbee.tester/src/main/java/org/persona/zigbee/tester/gui/CommandActionPanel.java
==============================================================================
--- projects/zb4osgi/trunk/zigbee.tester/src/main/java/org/persona/zigbee/tester/gui/CommandActionPanel.java (original)
+++ projects/zb4osgi/trunk/zigbee.tester/src/main/java/org/persona/zigbee/tester/gui/CommandActionPanel.java Wed Oct 24 09:38:32 2012
@@ -89,7 +89,7 @@
 				if (argsModel.getRowCount()!= 0){
 					if (table.isEditing()) table.getCellEditor().stopCellEditing();
 					params = new String[argsModel.getRowCount()];
-					for (int i =0; i<argsModel.getRowCount(); i++){
+					for (int i = 0; i < argsModel.getRowCount(); i++){
 						params[i] = (String) argsModel.getValueAt(i,1);
 					}
 				}

Modified: projects/zb4osgi/trunk/zigbee.tester/src/main/java/org/persona/zigbee/tester/gui/HADeviceTreeNode.java
==============================================================================
--- projects/zb4osgi/trunk/zigbee.tester/src/main/java/org/persona/zigbee/tester/gui/HADeviceTreeNode.java (original)
+++ projects/zb4osgi/trunk/zigbee.tester/src/main/java/org/persona/zigbee/tester/gui/HADeviceTreeNode.java Wed Oct 24 09:38:32 2012
@@ -26,6 +26,7 @@
 import it.cnr.isti.zigbee.ha.cluster.glue.Cluster;
 import it.cnr.isti.zigbee.ha.driver.core.HADevice;
 import it.cnr.isti.zigbee.zcl.library.api.core.Attribute;
+import it.cnr.isti.zigbee.zcl.library.api.core.Response;
 
 import java.awt.Color;
 import java.awt.Component;
@@ -151,16 +152,21 @@
 			if( declaringClass == Cluster.class || declaringClass == Object.class ) {
 				continue;
 			}
-			String methodName = methods[i].getName();
+			final String methodName = methods[i].getName();
+			final Class<?> returnType = methods[i].getReturnType();
+			if (  returnType == void.class || Response.class.isAssignableFrom( returnType ) ) {
+				this.add(new HADeviceTreeNode(new Command(obj, methods[i])));
+			/*
 			if ( methodName.equals("subscribe") || methodName.equals("unsubscribe") ){
 				//We skip method that are only a way to access method available at level of attribute
 				continue;
 			} else if ( methodName.startsWith("get") && Attribute.class.isAssignableFrom(methods[i].getReturnType()) ) {
 				//We skip method that are only a way to access method available at level of attribute
-				continue;				
+				continue;
+			*/				
 			} else if ( methodName.startsWith("add") || methodName.startsWith("remove") ) {
 			    Class<?>[] args = methods[i].getParameterTypes();
-               if( args.length == 1 && args[0].getName().endsWith( "Listener" ) ){
+			    if( args.length == 1 && args[0].getName().endsWith( "Listener" ) ){
 	                String pairName = null;
 	                if ( ( pairName = checkForAddRemoveMethodsPair(methods,i) ) == null ) continue;
 	                int childCount = this.getChildCount();
@@ -176,7 +182,7 @@
 	                //TODO Add support for Specific Cluster Eventing
 			    }
 			}
-			this.add(new HADeviceTreeNode(new Command(obj, methods[i])));
+			
 		}
 		
 	}




More information about the Commit mailing list