Skip to content

Instantly share code, notes, and snippets.

@tony1223
Created July 11, 2011 20:38
Show Gist options
  • Select an option

  • Save tony1223/1076737 to your computer and use it in GitHub Desktop.

Select an option

Save tony1223/1076737 to your computer and use it in GitHub Desktop.
AbstractComponent.java
protected int countChild(){
int n = getChildren().size();
List comps = getChildren();
for(int i = 0 ; i < comps.size() ;++i){
AbstractComponent comp = (AbstractComponent) comps.get(i);
n += comp.countChild();
}
return n;
}
/** Called by ({@link ComponentCtrl#redraw}) to render the
* properties, excluding the enclosing tag and children.
*
* <p>Default: it renders {@link #getId} if it was assigned,
* and event names if listened (and listed in {@link #getClientEvents}).
*
* <p>Note: it doesn't render {@link #getWidgetClass}, {@link #getUuid}
* and {@link #getMold}, which are caller's job.
*
* @since 5.0.0
*/
protected void renderProperties(ContentRenderer renderer)
throws IOException {
if(!this.isVisible()){
Integer amount = Integer.valueOf(0) ;
String key = "__amt";
if(this.getDesktop().hasAttribute(key)){
amount = (Integer) this.getDesktop().getAttribute(key);
}else{
System.err.println("----");
}
this.getDesktop().setAttribute(key, Integer.valueOf(amount.intValue()+1));
System.out.println("non-visible:"+amount.intValue()+":"+this.getUuid()+":"+this.countChild());
}
// ..........
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment