Package org.zkoss.util.media

Examples of org.zkoss.util.media.Media


  private Component newRestoreButton() {
    return new Fileupload(I18N.get("Restore"), Images.MediaCdrom,
        new ActionListener() {
          public void actionPerformed(Event evt) {
            Media media = ((UploadEvent) evt).getMedia();
            if (media != null) {
              try {
                Backups.restore(Medias.asFile(media),
                    JeaseSession.getContainer(),
                    JeaseSession.get(User.class));
View Full Code Here


  private Component newUploadButton() {
    return new Fileupload(I18N.get("Upload"), Images.UserHome,
        new ActionListener() {
          public void actionPerformed(Event evt) {
            Media media = ((UploadEvent) evt).getMedia();
            if (media != null) {
              try {
                Imports.fromFile(Medias.asFile(media),
                    JeaseSession.getContainer(),
                    JeaseSession.get(User.class));
View Full Code Here

    final String dtid = pi.substring(j, k);
    final int l = pi.indexOf('/', ++k);
    final String uuid = l >= 0 ? pi.substring(k, l): pi.substring(k);

    Media media;
    boolean download = false;
    try {
      final WebApp wapp = sess.getWebApp();
      final WebAppCtrl wappc = (WebAppCtrl)wapp;
      final UiEngine uieng = wappc.getUiEngine();
View Full Code Here

 
  private static Media[] parseResult(List result) {
    if (result != null) {
      //we have to filter items that user doesn't specify any file
      for (Iterator it = result.iterator(); it.hasNext();) {
        final Media media = (Media)it.next();
        if (media != null && media.inMemory() && media.isBinary()) {
          final String nm = media.getName();
          if (nm == null || nm.length() == 0) {
            final byte[] bs = media.getByteData();
            if (bs == null || bs.length == 0)
              it.remove(); //Upload is pressed without specifying a file
          }
        }
      }
View Full Code Here

    if (!isSupportedSpreadSheetExtention(media.getName())) {
      throw new UnsupportedSpreadSheetFileException(
          "the file extension is incorrect. media name:"+media.getName());
    }
   
    Media spreadSheetSource = media;
   
    SpreadSheetMetaInfo info =
      SpreadSheetMetaInfo.newInstance(spreadSheetSource.getName());
   
    InputStream inputStream = spreadSheetSource.getStreamData();
    try {
      Files.copy(new File(getSpreadsheetStorageFolderPath() + info.getHashFileName()),
          inputStream);

      SpreadSheetMetaInfo.add(info);
View Full Code Here

   * Fires when the user selects file for upload big files to upload to
   * sendspace
   *
   */
  public void onUpload$DDUploader(UploadEvent event) {
    Media media = event.getMedia();
    String f1 = saveFile(media);
    StartUpload Su1 = new StartUpload();
    Su1.FileName(f1);
  }
View Full Code Here

    }
   
    Worksheet sheet = _spreadsheet.getSelectedSheet();
    if (sheet != null) {
      if (!sheet.getProtect()) {
        final Media media = evt.getMedia();
        if (media instanceof AImage) {
          AImage image = (AImage)media;
          Ranges
          .range(_spreadsheet.getSelectedSheet())
          .addPicture(getClientAnchor(_insertPictureSelection.getTop(), _insertPictureSelection.getLeft(),
View Full Code Here

TOP

Related Classes of org.zkoss.util.media.Media

Copyright © 2018 www.massapicom. 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.