Ejemplo n.º 1
0
 /** 将WLayout转换为XLayoutContainer */
 @Override
 public void convert() {
   isRefreshing = true;
   WTitleLayout layout = this.toData();
   this.removeAll();
   for (int i = 0, num = layout.getWidgetCount(); i < num; i++) {
     BoundsWidget bw = (BoundsWidget) layout.getWidget(i);
     if (bw != null) {
       Rectangle bounds = bw.getBounds();
       XWidgetCreator comp = (XWidgetCreator) XCreatorUtils.createXCreator(bw.getWidget());
       String constraint =
           bw.getWidget().acceptType(Label.class) ? WTitleLayout.TITLE : WTitleLayout.BODY;
       this.add(comp, constraint);
       comp.setBounds(bounds);
     }
   }
   isRefreshing = false;
 }