Ejemplo n.º 1
0
  private Layout getLayout(String caption, Class<? extends Layout> layoutClass, String width) {
    Layout l;
    if (layoutClass == VerticalLayout.class) {
      if (verticalLayout == null) {
        verticalLayout = new VerticalLayout();
        verticalLayout.setStyleName("borders");
      }
      l = verticalLayout;
    } else if (layoutClass == HorizontalLayout.class) {
      if (horizontalLayout == null) {
        horizontalLayout = new HorizontalLayout();
        horizontalLayout.setStyleName("borders");
      }
      l = horizontalLayout;
    } else if (layoutClass == GridLayout.class) {
      if (gridLayout == null) {
        gridLayout = new GridLayout();
        gridLayout.setStyleName("borders");
      }
      l = gridLayout;
    } else if (layoutClass == CssLayout.class) {
      if (cssLayout == null) {
        cssLayout = new CssLayout();
        cssLayout.setStyleName("borders");
      }
      l = cssLayout;
    } else if (layoutClass == FormLayout.class) {
      if (formLayout == null) {
        formLayout = new FormLayout();
        formLayout.setStyleName("borders");
      }
      l = formLayout;
    } else {
      return null;
    }

    l.setCaption(caption);
    if (width.equals("auto")) {
      width = null;
    }

    l.setWidth(width);

    // addComponent(l);

    return l;
  }
    BasicInfo() {
      setCaption(ViewProperties.getCaption("table.serverBasicInfo"));
      setHeight("100%");
      setStyleName("server-desc-basic-panel");

      VerticalLayout vlay = (VerticalLayout) getContent();
      vlay.setStyleName("server-desc-basic-panel");
      vlay.setMargin(true);

      layout = new GridLayout(2, CAPNAME.length);

      layout.setWidth("100%");
      layout.setStyleName("server-desc-basic-info");
      layout.setColumnExpandRatio(0, 35);
      layout.setColumnExpandRatio(1, 65);
      vlay.addComponent(layout);

      // 項目名設定
      for (int i = 0; i < CAPNAME.length; i++) {
        Label lbl1 = new Label(CAPNAME[i], Label.CONTENT_XHTML);
        Label lbl2 = new Label("");
        lbl1.setHeight(COLUMN_HEIGHT);
        layout.addComponent(lbl1, 0, i);
        layout.addComponent(lbl2, 1, i);
      }

      // EC2 Windows用パスワード取得ボタン
      getPassword = new Button(ViewProperties.getCaption("button.getPassword"));
      getPassword.setDescription(ViewProperties.getCaption("description.getPassword"));
      getPassword.setIcon(Icons.LOGIN.resource());
      getPassword.addStyleName("getpassword");
      getPassword.addListener(
          new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
              AutoApplication ap = (AutoApplication) getApplication();
              InstanceDto dto = (InstanceDto) ap.myCloud.myCloudTabs.serverTable.getValue();
              Long instanceNo = (Long) getPassword.getData();
              WinPassword winPassword = new WinPassword(dto, instanceNo);
              getWindow().addWindow(winPassword);
            }
          });
    }
Ejemplo n.º 3
0
  @AutoGenerated
  private GridLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new GridLayout();
    mainLayout.setStyleName("background");
    mainLayout.setImmediate(false);
    mainLayout.setWidth("480px");
    mainLayout.setHeight("450px");
    mainLayout.setMargin(false);

    // top-level component properties
    setWidth("480px");
    setHeight("450px");

    // logintab
    logintab = buildLogintab();
    mainLayout.addComponent(logintab, 0, 0);

    return mainLayout;
  }
 GridLayout getGridLayout() {
   GridLayout grid =
       new GridLayout(3, 1) {
         @Override
         public void addComponent(Component c) {
           super.addComponent(c);
           setComponentAlignment(c, Alignment.MIDDLE_CENTER);
           if (c.getStyleName() != "") {
             ((AbstractComponent) c)
                 .setDescription(
                     c.getClass().getSimpleName() + ".addStyleName(\"" + c.getStyleName() + "\")");
           } else {
             ((AbstractComponent) c).setDescription("new " + c.getClass().getSimpleName() + "()");
           }
         }
       };
   grid.setWidth("100%");
   grid.setSpacing(true);
   grid.setMargin(true);
   grid.setStyleName("preview-grid");
   return grid;
 }
  private VaadinCollapsiblePhysicalAttributeConfirmActualsFormSectionHeader addFormSection(
      PhysicalAttributeConfirmActualsFieldSetComponent fieldSet) {
    GridLayout gridLayout = new GridLayout(3, 1);
    gridLayout.setWidth("70%");
    gridLayout.setSpacing(true);
    gridLayout.setStyleName("conx-entity-editor-form");
    gridLayout.setMargin(true, true, false, true);

    Embedded placeholder = new Embedded();
    placeholder.setHeight("22px");
    placeholder.setWidth("1px");

    GridLayout captionLayout = new GridLayout(1, 1);
    captionLayout.setWidth("100%");
    captionLayout.setSpacing(true);
    captionLayout.addComponent(placeholder, 0, 0, 0, 0);
    GridLayout expectedLayout = new GridLayout(2, 1);
    expectedLayout.setWidth("100%");
    expectedLayout.setSpacing(true);
    expectedLayout.addComponent(new VaadinConfirmActualsFormSectionHeader("Expected"), 0, 0, 1, 0);
    GridLayout actualLayout = new GridLayout(2, 1);
    actualLayout.setWidth("100%");
    actualLayout.setSpacing(true);
    actualLayout.addComponent(new VaadinConfirmActualsFormSectionHeader("Actual"), 0, 0, 1, 0);

    gridLayout.addComponent(captionLayout, 0, 0, 0, 0);
    gridLayout.addComponent(expectedLayout, 1, 0, 1, 0);
    gridLayout.addComponent(actualLayout, 2, 0, 2, 0);
    gridLayout.setColumnExpandRatio(0, 0.166f);
    gridLayout.setColumnExpandRatio(1, 0.417f);
    gridLayout.setColumnExpandRatio(2, 0.417f);

    VaadinCollapsiblePhysicalAttributeConfirmActualsFormSectionHeader header =
        new VaadinCollapsiblePhysicalAttributeConfirmActualsFormSectionHeader(fieldSet, gridLayout);
    innerLayout.addComponent(header);
    innerLayout.addComponent(header.getLayout());
    headers.put(fieldSet, header);
    return header;
  }