Source:
public void action ( final com.android.ide.common.api.MenuAction action , final java.lang.String valueId , final java.lang.Boolean newValue ) { java.lang.String fullActionId = action.getId ( ) ; boolean isProp = fullActionId.startsWith ( "@prop@" ) ; final java.lang.String actionId = ( isProp ) ? fullActionId.substring ( 6 ) : fullActionId ; final com.android.ide.common.api.INode node = selectedNode ; if ( fullActionId.equals ( "layout_1width" ) ) { if ( ! ( valueId.startsWith ( "z" ) ) ) { node.editXml ( ( "Change attribute " + ( com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH ) ) , new com.android.ide.common.api.INodeHandler ( ) { public void handle ( com.android.ide.common.api.INode n ) { n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH , valueId ) ; } } ) ; } return ; } else if ( fullActionId.equals ( "layout_2height" ) ) { if ( ! ( valueId.startsWith ( "z" ) ) ) { node.editXml ( ( "Change attribute " + ( com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT ) ) , new com.android.ide.common.api.INodeHandler ( ) { public void handle ( com.android.ide.common.api.INode n ) { n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT , valueId ) ; } } ) ; } return ; } if ( isProp ) { java.util.Map < java.lang.String , com.android.ide.common.layout.BaseViewRule.Prop > props = mAttributesMap.get ( key ) ; final com.android.ide.common.layout.BaseViewRule.Prop prop = ( props != null ) ? props.get ( actionId ) : null ; if ( prop != null ) { node.editXml ( ( "Change attribute " + actionId ) , new com.android.ide.common.api.INodeHandler ( ) { public void handle ( com.android.ide.common.api.INode n ) { if ( prop.isToggle ( ) ) { java.lang.String value = "" ; if ( valueId.equals ( "1t" ) ) { value = ( newValue ) ? "true" : "" ; } else if ( valueId.equals ( "2f" ) ) { value = ( newValue ) ? "false" : "" ; } n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , actionId , value ) ; } else if ( prop.isFlag ( ) ) { java.lang.String values = "" ; if ( ! ( valueId.equals ( "~2clr" ) ) ) { values = n.getStringAttr ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , actionId ) ; java.util.Set < java.lang.String > newValues = new java.util.HashSet < java.lang.String > ( ) ; if ( values != null ) { newValues.addAll ( java.util.Arrays.asList ( values.split ( "\\|" ) ) ) ; } if ( newValue ) { newValues.add ( valueId ) ; } else { newValues.remove ( valueId ) ; } values = com.android.ide.common.layout.BaseViewRule.join ( '|' , newValues ) ; } n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , actionId , values ) ; } else { java.lang.String value = "" ; if ( ! ( valueId.equals ( "~2clr" ) ) ) { value = ( newValue ) ? valueId : "" ; } n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , actionId , value ) ; } } } ) ; } } }

Target:
public void action ( final com.android.ide.common.api.MenuAction action , final java.lang.String valueId , final java.lang.Boolean newValue ) { java.lang.String fullActionId = action.getId ( ) ; boolean isProp = fullActionId.startsWith ( "@prop@" ) ; final java.lang.String actionId = ( isProp ) ? fullActionId.substring ( 6 ) : fullActionId ; final com.android.ide.common.api.INode node = selectedNode ; if ( fullActionId.equals ( "layout_1width" ) ) { final java.lang.String newAttrValue = getValue ( valueId , customWidth ) ; if ( newAttrValue != null ) { node.editXml ( ( "Change attribute " + ( com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH ) ) , new com.android.ide.common.api.INodeHandler ( ) { public void handle ( com.android.ide.common.api.INode n ) { n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH , newAttrValue ) ; } } ) ; } return ; } else if ( fullActionId.equals ( "layout_2height" ) ) { final java.lang.String newAttrValue = getValue ( valueId , customHeight ) ; if ( newAttrValue != null ) { node.editXml ( ( "Change attribute " + ( com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT ) ) , new com.android.ide.common.api.INodeHandler ( ) { public void handle ( com.android.ide.common.api.INode n ) { n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT , newAttrValue ) ; } } ) ; } return ; } if ( isProp ) { java.util.Map < java.lang.String , com.android.ide.common.layout.BaseViewRule.Prop > props = mAttributesMap.get ( key ) ; final com.android.ide.common.layout.BaseViewRule.Prop prop = ( props != null ) ? props.get ( actionId ) : null ; if ( prop != null ) { node.editXml ( ( "Change attribute " + actionId ) , new com.android.ide.common.api.INodeHandler ( ) { public void handle ( com.android.ide.common.api.INode n ) { if ( prop.isToggle ( ) ) { java.lang.String value = "" ; if ( valueId.equals ( "1t" ) ) { value = ( newValue ) ? "true" : "" ; } else if ( valueId.equals ( "2f" ) ) { value = ( newValue ) ? "false" : "" ; } n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , actionId , value ) ; } else if ( prop.isFlag ( ) ) { java.lang.String values = "" ; if ( ! ( valueId.equals ( "~2clr" ) ) ) { values = n.getStringAttr ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , actionId ) ; java.util.Set < java.lang.String > newValues = new java.util.HashSet < java.lang.String > ( ) ; if ( values != null ) { newValues.addAll ( java.util.Arrays.asList ( values.split ( "\\|" ) ) ) ; } if ( newValue ) { newValues.add ( valueId ) ; } else { newValues.remove ( valueId ) ; } values = com.android.ide.common.layout.BaseViewRule.join ( '|' , newValues ) ; } n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , actionId , values ) ; } else { java.lang.String value = "" ; if ( ! ( valueId.equals ( "~2clr" ) ) ) { value = ( newValue ) ? valueId : "" ; } n.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , actionId , value ) ; } } } ) ; } } }