Package org.yaac.client.ui

Source Code of org.yaac.client.ui.EditorPropertyManager$PropertyEditCallback

package org.yaac.client.ui;

import javax.inject.Inject;

import org.yaac.client.ui.EditorPropertyPanel.CloseBtnHandler;
import org.yaac.shared.property.PropertyInfo;

import com.google.gwt.user.client.ui.PopupPanel;

/**
* @author Max Zhu (thebbsky@gmail.com)
*
*  dialog manager
*/
public class EditorPropertyManager {
 
  /**
   * @author Max Zhu (thebbsky@gmail.com)
   *
   */
  public static interface PropertyEditCallback {
    void onEditSuccess(PropertyInfo newInfo);
  }
 
  private PopupPanel popup;
 
  private final EditorPropertyPanel popupPanel;
 
  @Inject
  EditorPropertyManager(EditorPropertyPanel popupPanel) {
    this.popupPanel = popupPanel;
   
    popup = new PopupPanel();
    popup.setAnimationEnabled(true);
    popup.setGlassEnabled(true);
    popup.setAutoHideEnabled(false);
    popup.setSize("640px", "480px");
   
    popup.add(this.popupPanel);
   
    popupPanel.setCloseHandler(new CloseBtnHandler() {
      @Override
      public void onCloseBtnClick() {
        popup.hide();
      }
    });
  }
 
  public void edit(String keyString, PropertyInfo info, PropertyEditCallback callback) {   
    popupPanel.edit(keyString, info, callback);
   
    popup.center();
  }
}
TOP

Related Classes of org.yaac.client.ui.EditorPropertyManager$PropertyEditCallback

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.