Example #1
0
  /** Does the actual addition of {@link UserItem}s to the top of the list. */
  private void addHead() {
    List<UserItem> l = head;
    if (l.size() > 0) {
      head = new ArrayList<UserItem>();
      headKeys = new HashSet<Key>();

      int offsetHeight = flowPanel.getOffsetHeight();
      for (int i = l.size() - 1; i >= 0; i--) {
        UserItem e = l.get(i);
        RowWidget row = createRow(e);
        flowPanel.insert(row, 0);
        rows.put(row.getKey(), row);
      }

      int deltaHeight = flowPanel.getOffsetHeight() - offsetHeight;
      scrollPanel.setVerticalScrollPosition(scrollPanel.getVerticalScrollPosition() + deltaHeight);

      rowsAdded();
      NewDataEvent.fire(this, NewDataType.NEW_DATA_SHOWN);
    }
  }
  /** @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);
  }