Exemplo n.º 1
0
  private void countCharacters(int input, TextBox tb) {

    int ilen = tb.getText().length();
    String len = Integer.toString(ilen);

    switch (input) {
      case 3: // secret 1
        pSecretCount1.clear();
        pSecretCount1.add(new HTML(len));
        if (ilen > consumerSecret_Len) {
          pSecretCount1.removeStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount1.setStyleName("core-CreateUserAccount-CharCountPass");
        } else {
          pSecretCount1.setStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount1.removeStyleName("core-CreateUserAccount-CharCountPass");
        }
        break;
      case 4: // secret 2
        pSecretCount2.clear();
        pSecretCount2.add(new HTML(len));
        if (ilen > consumerSecret_Len) {
          pSecretCount2.removeStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount2.setStyleName("core-CreateUserAccount-CharCountPass");
        } else {
          pSecretCount2.setStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount2.removeStyleName("core-CreateUserAccount-CharCountPass");
        }
        break;
    }
  }
  /** @see org.opencms.ade.galleries.client.preview.I_CmsResourcePreview#openPreview(String) */
  public void openPreview(String resourcePath) {

    if (m_previewDialog != null) {
      m_previewDialog.removeFromParent();
    }
    FlowPanel parentPanel = getGalleryDialog().getParentPanel();
    m_previewDialog =
        new CmsImagePreviewDialog(
            getGalleryDialog().getController().getDialogMode(),
            parentPanel.getOffsetHeight(),
            parentPanel.getOffsetWidth());
    // initialize the controller and controller handler
    m_handler = new CmsImagePreviewHandler(this);
    m_previewDialog.init(m_handler);
    CmsPreviewUtil.exportFunctions(getPreviewName(), this);
    parentPanel.add(m_previewDialog);
    parentPanel.removeStyleName(I_CmsLayoutBundle.INSTANCE.previewDialogCss().hidePreview());
    // load preview data
    loadResourceInfo(resourcePath);
  }