protected void addWidget(Widget widget){
  if (widget != null) {
    widgets.put(widget.getId(),widget);
    if (!widgetTypes.contains(widget.getType())) {
      widgetTypes.add(widget.getType());
    }
  }
}

protected void addWidget ( Widget widget ) { if ( widget != null ) { widgets . put ( widget . getId ( ) , widget ) ; if ( ! widgetTypes . contains ( widget . getType ( ) ) ) { widgetTypes . add ( widget . getType ( ) ) ; } } }
add a new widget to view
