@Override
  public void attach() {
    setSizeFull();
    addStyleName(Reindeer.PANEL_LIGHT);

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setSizeFull();
    layout.addStyleName("server-tab");
    layout.setSpacing(false);
    layout.setMargin(false);

    // スプリットパネル
    SplitPanel splitPanel = new SplitPanel();
    splitPanel.setOrientation(SplitPanel.ORIENTATION_VERTICAL);
    splitPanel.setSplitPosition(40);
    splitPanel.setSizeFull();
    layout.addComponent(splitPanel);

    // スプリットパネル上段
    VerticalLayout upperLayout = new VerticalLayout();
    upperLayout.setSizeFull();
    upperLayout.setSpacing(false);
    upperLayout.setMargin(false);

    serverButtonsTop = new ServerButtonsTop(sender);
    upperLayout.addComponent(serverButtonsTop);

    serverTable = new ServerTable(sender);
    serverTable.setContainerDataSource(new InstanceDtoContainer());
    upperLayout.addComponent(serverTable);
    serverTable.addListener(
        new ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            tableRowSelected(event);
          }
        });

    serverButtonsBottom = new ServerButtonsBottom(sender);
    upperLayout.addComponent(serverButtonsBottom);
    upperLayout.setExpandRatio(serverTable, 10);
    splitPanel.addComponent(upperLayout);

    // スプリットパネル下段
    serverDesc = new ServerDesc(sender);
    splitPanel.addComponent(serverDesc);
  }
 public void tableRowSelected(ValueChangeEvent event) {
   InstanceDto instance = (InstanceDto) serverTable.getValue();
   if (instance != null) {
     serverButtonsBottom.refresh(instance);
     serverDesc.show(instance);
   } else {
     serverButtonsBottom.initialize();
     serverDesc.initialize();
   }
 }
 public void refreshDesc() {
   InstanceDto instance = (InstanceDto) serverTable.getValue();
   serverButtonsTop.initialize();
   if (instance != null) {
     serverButtonsBottom.refresh(instance);
     serverDesc.show(instance);
   } else {
     serverButtonsBottom.initialize();
     serverDesc.initialize();
   }
 }
  public boolean needsRefresh() {
    Collection<InstanceDto> instances = serverTable.getItemIds();
    for (InstanceDto instance : instances) {
      InstanceStatus status = InstanceStatus.fromStatus(instance.getInstance().getStatus());
      if (status == InstanceStatus.STARTING
          || status == InstanceStatus.STOPPING
          || status == InstanceStatus.CONFIGURING) {
        return true;
      }
    }

    return false;
  }
 public void refreshTable() {
   ((InstanceDtoContainer) serverTable.getContainerDataSource()).refresh();
   serverTable.setValue(null);
   serverDesc.initialize();
 }