Ejemplo n.º 1
0
 private void removeAllInputField() {
   inputLayout.removeComponent(btnLinkCc);
   inputLayout.removeComponent(ccField);
   inputLayout.removeComponent(subjectField);
   inputLayout.removeComponent(bccField);
   inputLayout.removeComponent(btnLinkBcc);
 }
Ejemplo n.º 2
0
 private void checkToReInitCcBcc() {
   if ((!isAddCc) && (!isAddBcc)) {
     inputLayout.removeComponent(btnLinkCc);
     inputLayout.removeComponent(btnLinkBcc);
     initButtonLinkCcBcc();
     inputLayout.removeComponent(subjectField);
     inputLayout.removeComponent(0, 1);
     inputLayout.addComponent(subjectField, 0, 1);
   }
 }
Ejemplo n.º 3
0
  /* (non-Javadoc)
   * @see com.mapping.configuration.ui.action.Action#exectuteAction()
   */
  @Override
  public void exectuteAction() {
    IkasanAuthentication ikasanAuthentication =
        (IkasanAuthentication)
            VaadinService.getCurrentRequest()
                .getWrappedSession()
                .getAttribute(DashboardSessionValueConstants.USER);

    VaadinService.getCurrentRequest()
        .getWrappedSession()
        .setAttribute(DashboardSessionValueConstants.USER, null);
    this.visibilityGroup.setVisible();
    this.editableGroup.setEditable(false);

    layout.removeComponent(this.logOutButton);
    layout.addComponent(this.loginButton, 2, 0);
    layout.addComponent(this.setupButton, 3, 0);
    layout.setComponentAlignment(this.setupButton, Alignment.MIDDLE_RIGHT);
    layout.setComponentAlignment(this.loginButton, Alignment.MIDDLE_RIGHT);
    this.layout.removeComponent(userLabel);

    VaadinSession vSession = VaadinSession.getCurrent();
    WrappedSession httpSession = vSession.getSession();

    this.navigationPanel.reset();

    // Invalidate HttpSession
    httpSession.invalidate();
    vSession.close();

    systemEventService.logSystemEvent(
        SystemEventConstants.DASHBOARD_LOGOUT_CONSTANTS,
        "User logging out: " + ikasanAuthentication.getName(),
        ikasanAuthentication.getName());

    // Redirect the user to the login/default Page
    Page.getCurrent().setLocation("/ikasan-dashboard");
  }
    public void setItem(InstanceDto instanceDto) {
      int line = 0;

      if (instanceDto != null) {
        Instance instance = instanceDto.getInstance();
        //                hostName = new Label(instance.getInstanceName(), Label.CONTENT_TEXT);
        //                layout.removeComponent( 1, line );
        //                layout.addComponent(hostName , 1, line++ );

        fqdn = new Label(instance.getFqdn(), Label.CONTENT_TEXT);
        layout.removeComponent(1, line);
        layout.addComponent(fqdn, 1, line++);

        ipAddress = new Label(instance.getPublicIp(), Label.CONTENT_TEXT);
        layout.removeComponent(1, line);
        layout.addComponent(ipAddress, 1, line++);

        // プラットフォームの表示
        PlatformDto platformDto = instanceDto.getPlatform();

        // TODO: アイコン名の取得ロジックのリファクタリング
        Icons icon = Icons.NONE;
        if ("aws".equals(platformDto.getPlatform().getPlatformType())) {
          if (platformDto.getPlatformAws().getEuca()) {
            icon = Icons.EUCALYPTUS;
          } else {
            icon = Icons.AWS;
          }
        } else if ("vmware".equals(platformDto.getPlatform().getPlatformType())) {
          icon = Icons.VMWARE;
        } else if ("nifty".equals(platformDto.getPlatform().getPlatformType())) {
          icon = Icons.NIFTY;
        } else if ("cloudstack".equals(platformDto.getPlatform().getPlatformType())) {
          icon = Icons.CLOUD_STACK;
        }

        String description = platformDto.getPlatform().getPlatformNameDisp();
        platform =
            new Label(
                "<img src=\""
                    + VaadinUtils.getIconPath(ServerDescBasic.this, icon)
                    + "\"><div>"
                    + description
                    + "</div>",
                Label.CONTENT_XHTML);
        layout.removeComponent(1, line);
        layout.addComponent(platform, 1, line++);

        // OS名の表示
        ImageDto imageDto = instanceDto.getImage();
        // TODO: アイコン名取得ロジックのリファクタリング
        String os = imageDto.getImage().getOsDisp();
        Icons osIcon = Icons.NONE;
        if (imageDto.getImage().getOs().startsWith("centos")) {
          osIcon = Icons.CENTOS;
        } else if (imageDto.getImage().getOs().startsWith("windows")) {
          osIcon = Icons.WINDOWS;
        }
        layoutOsType = new CssLayout();
        ostype =
            new Label(
                "<img src=\""
                    + VaadinUtils.getIconPath(ServerDescBasic.this, osIcon)
                    + "\"><div>"
                    + os
                    + "</div>",
                Label.CONTENT_XHTML);
        layoutOsType.setSizeFull();
        layoutOsType.setMargin(false);
        layoutOsType.addComponent(ostype);

        // OSがWindowsの場合パスワード取得ボタンを表示
        if (imageDto.getImage().getOs().startsWith("windows")) {
          // ただしEUCALYPTUSは除外
          if (platformDto.getPlatformAws() == null
              || platformDto.getPlatformAws().getEuca() == false) {
            InstanceStatus instanceStatus = InstanceStatus.fromStatus(instance.getStatus());
            if (instanceStatus == InstanceStatus.RUNNING) {
              getPassword.setEnabled(true);
              getPassword.setData(instance.getInstanceNo());
            } else {
              getPassword.setEnabled(false);
            }
            layoutOsType.addComponent(getPassword);
            layoutOsType.setHeight("60px");
          }
        }

        layout.removeComponent(1, line);
        layout.addComponent(layoutOsType, 1, line++);

        // ステータスの表示
        String stat =
            instance.getStatus().substring(0, 1).toUpperCase()
                + instance.getStatus().substring(1).toLowerCase();
        Icons icon2 = Icons.fromName(stat);

        status =
            new Label(
                "<img src=\""
                    + VaadinUtils.getIconPath(ServerDescBasic.this, icon2)
                    + "\"><div>"
                    + stat
                    + "</div>",
                Label.CONTENT_XHTML);
        layout.removeComponent(1, line);
        layout.addComponent(status, 1, line++);

        // コメント
        comment = new Label(instance.getComment(), Label.CONTENT_XHTML);
        layout.removeComponent(1, line);
        layout.addComponent(comment, 1, line++);

      } else {
        //                hostName = new Label("", Label.CONTENT_TEXT);
        //                layout.removeComponent( 1, line );
        //                layout.addComponent(hostName , 1, line++ );

        fqdn = new Label("", Label.CONTENT_TEXT);
        layout.removeComponent(1, line);
        layout.addComponent(fqdn, 1, line++);

        ipAddress = new Label("", Label.CONTENT_TEXT);
        layout.removeComponent(1, line);
        layout.addComponent(ipAddress, 1, line++);

        // プラットフォームの表示
        platform = new Label("", Label.CONTENT_XHTML);
        layout.removeComponent(1, line);
        layout.addComponent(platform, 1, line++);

        // OS名の表示
        layoutOsType = new CssLayout();
        ostype = new Label("", Label.CONTENT_XHTML);
        layoutOsType.setSizeFull();
        layoutOsType.setMargin(false);
        layoutOsType.addComponent(ostype);
        layout.removeComponent(1, line);
        layout.addComponent(layoutOsType, 1, line++);

        // ステータスの表示
        status = new Label("", Label.CONTENT_XHTML);
        layout.removeComponent(1, line);
        layout.addComponent(status, 1, line++);

        // コメント
        comment = new Label("", Label.CONTENT_XHTML);
        layout.removeComponent(1, line);
        layout.addComponent(comment, 1, line++);
      }
    }
 private void removeComponents() {
   layoutSearchPane.removeComponent(0, 0);
   textValueField = null;
   dateSearchField = null;
 }