Exemple #1
0
  public void refresh() {
    m_Container.doJSONRequest(
        G3Viewer.VIEW_ITEM_URL + getId(),
        new HttpSuccessHandler() {

          @Override
          public void success(JSONValue aValue) {
            updateValues(aValue);
          }
        },
        false,
        true);
  }
Exemple #2
0
  public void select() {
    Loading.getInstance().loading("Loading Contents..");
    m_Container.doJSONRequest(
        G3Viewer.VIEW_CHILDREN_URL + getId(),
        new HttpSuccessHandler() {

          @Override
          public void success(JSONValue aValue) {
            viewAlbum(aValue);
          }
        },
        false,
        true);
  }
Exemple #3
0
  /*
   * Fetch the requested URL.
   */
  public void expand() {

    m_Container.doJSONRequest(
        G3Viewer.VIEW_ALBUM_URL + getId(),
        new HttpSuccessHandler() {

          @Override
          public void success(JSONValue aValue) {
            addAlbums(aValue);
          }
        },
        false,
        true);
  }
Exemple #4
0
  /** moves the given array of ids to this album */
  public void moveTo(JSONArray a_Ids) {
    Loading.getInstance().loading("Moving Items..");

    m_Container.doJSONRequest(
        G3Viewer.MOVE_TO_ALBUM_URL + getId() + "?sourceids=" + a_Ids.toString(),
        new HttpSuccessHandler() {

          @Override
          public void success(JSONValue aValue) {
            expand();
            m_View.getCurrentAlbum().expand();
            m_View.getCurrentAlbum().select();
          }
        },
        true,
        true);
  }
Exemple #5
0
  /** rearranges the albums */
  public void rearrangeTo(JSONArray a_Ids, Item m_CompareTo, boolean m_Before) {
    Loading.getInstance().loading("Re-arranging..");
    String bora = m_Before ? "before" : "after";

    m_Container.doJSONRequest(
        G3Viewer.REARRANGE_URL
            + m_CompareTo.getID()
            + "/"
            + bora
            + "?sourceids="
            + a_Ids.toString(),
        new HttpSuccessHandler() {

          @Override
          public void success(JSONValue aValue) {
            m_View.getCurrentAlbum().select();
          }
        },
        true,
        true);
  }
Exemple #6
0
  public void uploadFiles(final File[] files) {

    m_Container.doJSONRequest(
        G3Viewer.RESIZE_DETAILS_URL,
        new HttpSuccessHandler() {

          public void success(JSONValue a_Value) {
            JSONObject jso = a_Value.isObject();
            if (jso != null) {

              ResizeOptions ro = new ResizeOptions(jso);
              UploadFile uf;
              for (File file : files) {
                uf = m_UploadControl.createUploadFile(Album.this, file, ro);
                m_AllUploads.add(uf);
                m_View.addToView(uf);
              }
              m_Container.updateInformation();
            }
          }
        },
        false,
        true);
  }