package kz.cafe.admin.panels;

import kz.cafe.constants.*;
import com.vaadin.ui.*;

public class AbstractPanel extends Panel implements java.io.Serializable{
   private static final long serialVersionUID = 8694959109084291035L;



   public static Label sizeY(int iSize){
      return sizeY(iSize, null);
   }


   public static Label sizeY(int iSize, String sStyleName){
      Label szY = new Label("&nbsp;", Label.CONTENT_XHTML);
      szY.setHeight(iSize + "px");

      if(sStyleName == null){
      }
      else{
         szY.setStyleName(sStyleName);
      }

      return szY;
   }





   public Label sizeX(int iSize){
      Label szX = new Label("&nbsp;", Label.CONTENT_XHTML);
      szX.setWidth(iSize + "px");
      return szX;
   }


   protected Label image2ClickableLabel(String sFileName, int iHeight){
      return new Label(image2ClickableText(sFileName, iHeight), Label.CONTENT_XHTML);
   }
   protected String image2ClickableText(String sFileName, int iHeight){
      return "<a href=\"javascript:__drawImage('" + ServerConstants.getImageURL() + sFileName + "')\"><img height=\"" + iHeight + "\" src=\"" + ServerConstants.getImageURL() + sFileName + "\"/></a>";
   }

}
