亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? fsattachmentsadder.java

?? 手機(jī)郵箱撒的方式方式方式的
?? JAVA
字號:
//#condition MUJMAIL_FSpackage mujmail;/*MujMail - Simple mail client for J2MECopyright (C) 2008 David Hauzar <david.hauzar.mujmail@gmail.com>This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */import mujmail.util.Callback;import mujmail.util.StartupModes;import mujmail.ui.FileSystemBrowser;import java.util.Vector;import javax.microedition.lcdui.Command;/** * Handles adding attachments to the email.  * Adds user interface controls for attaching attachments while writing new  * mail to the form SendMail. *  * Usage: Method importAttachementsFromHeader imports all body parts representing  * attachments from given (edited) message. It is created only shallow * copy of such body parts. Than, user interface enables to add and remove * body parts. Method exportAttachementsToHeader creates deep copies of such * body parts and adds it to the message. *  *  * @see SendMail * @author David Hauzar <david.hauzar@seznam.cz>,  *  based on file attachment patch by John Dorfman */public class FSAttachmentsAdder {        private Vector attachments = new Vector();    private SendMail sendMail;        /** The message header used for creating body parts representing attachments. */    private MessageHeader tempHeader;        /** The command used when dialog for attaching files should be started */    public Command attach;    /** The command used when dialog for removing attachments should be started */    public Command remove;        /**     * Creates new instance of file system attachments adder.     * @param sendMail the form to which the user interface for attaching files     *  will be added     */    public FSAttachmentsAdder(SendMail sendMail) {        this.sendMail = sendMail;                tempHeader = new MessageHeader(sendMail.mujMail.outBox);                // TODO: if there is not JSR75, commands should be not active        attach = new Command(Lang.get(Lang.BTN_SM_ADD_ATTACHMENT), Command.ITEM, 8);        sendMail.addCommand(attach);        remove = new Command(Lang.get(Lang.BTN_SM_REMOVE_ALL_ATTACHMENTS), Command.ITEM, 9);        sendMail.addCommand(remove);            }        /**     * Adds attachments to given message header.     * Makes deep copies of attachments.     * @param header the header to which add the attachments     */    public void exportAttachmentsToHeader(MessageHeader header) {        System.out.println("Exporting attachments");        for (int i = 0; i < getAttachments().size(); i++) {            System.out.println(i);            header.addBodyPart(                     new BodyPart( header, (BodyPart)getAttachments().elementAt(i), ContentStorage.CopyingModes.DEEP_COPY  ));        }        System.out.println("Attachments exported");    }           /**     * Adds new attachment to the attachment adder and displays it in connected     * SendMail form.     *      * @param attachment     */    public void addAttachment(BodyPart attachment) {                        getAttachments().addElement(attachment);        attachment.getSendMailDisplayer().addAttachmentToForm(getSendMail());                MujMail.mujmail.getDisplay().setCurrent(getSendMail());    }        /**     * Removes all attachments from connected SendMail form and from this     * attachment adder.     * It assumes that attachments are the last items in SendMail form!!!     */    public void removeAllAttachments() {        System.out.println("Attachments to remove: " + getAttachments().size());        removeAllAttachmentsFromForm();                getAttachments().removeAllElements();                MujMail.mujmail.getDisplay().setCurrent(getSendMail());    }        /**     * It assumes that attachments are the last items in SendMail form!!!     */    private void removeAllAttachmentsFromForm() {        int itemsToRemove = getAttachments().size()*BodyPart.SendMailDisplayer.numberOfItemsInForm;        for (int i = 0; i < itemsToRemove; i++) {            getSendMail().delete(getSendMail().size()-1);        }    }        private void addAllAttachmentsToForm() {        for (int i = 0; i < getAttachments().size(); i++) {            ((BodyPart)getAttachments().elementAt(i)).getSendMailDisplayer().                    addAttachmentToForm(getSendMail());        }    }        /**     * Removes the attachment with given index from attachment adder and also     * from connected SendMail form.     * @param i 	index of attachment to remove from attachment adder     */    public void removeAttachment(int i) {        getAttachments().removeElementAt(i);                removeAllAttachmentsFromForm();        addAllAttachmentsToForm();                MujMail.mujmail.getDisplay().setCurrent(getSendMail());    }        /**     * Gets temporary header - the header used when creating new body parts.     * @return temporary header     */    MessageHeader getTempHeader() {        return tempHeader;    }        /**     * Adds attachments from given header to this attachments adder and displays     * it in connected SendMail form.     * Makes only shallow copy. Deep copies of body parts representing attachments     * is done while exporting attachments to header.     * @param header the header to which add attachments     */    public void importAttachmentsFromHeader(MessageHeader header) {        for (int i = 0; i < header.getAttachementCount(); i++) {            BodyPart bp = header.getAttachement(i);                        addAttachment(new BodyPart(header, bp, ContentStorage.CopyingModes.SHALLOW_COPY));        }                System.out.println("Imported: " + getAttachments().size());    }        /**     * Gets the number of attachments in this attachment adder     * @return the number of attachments in this attachment adder     */    public int getAttachmentsCount() {        return getAttachments().size();    }    public Vector getAttachments() {        return attachments;    }    public void setAttachments(Vector attachments) {        this.attachments = attachments;    }    private SendMail getSendMail() {        return sendMail;    }        /**     * Used to add attached file. Instance of this class is passed to instance of     * class FileSystemBrowser and called by it when some file is chosen.     */    private class FSBrowserOKAction implements Callback {        public void callback(Object called, Object message) {            // Add file as attachment                        // if user did not choose any file, no action is needed            if (((String) message).equals("canceled"))  return;            FileSystemBrowser fsBrowser = (FileSystemBrowser) called;                        BodyPart bp = new BodyPart(getTempHeader(), fsBrowser.getSelectedURL(),                     fsBrowser.getSelectedFileOrDirName(), fsBrowser.getSelectedFileOrDirName(), 0);            addAttachment(bp);            // find file size            ((FSStorage) bp.getStorage()).updateSizeInNewThread(new UpdateAttachmentSizeCallback(sendMail, bp));        }            }        /**     * Instance of this class is called after ContentStorage.updateSizeInNewThread     * is performed.     * Updates the StringItem with the size of attachment in send mail form     * and sets the display to send mail.     */    private static class UpdateAttachmentSizeCallback implements Callback {        private final SendMail sendMail;        private final BodyPart bodyPart;        public UpdateAttachmentSizeCallback(SendMail sendMail, BodyPart bodyPart) {            this.sendMail = sendMail;            this.bodyPart = bodyPart;        }        public void callback(Object called, Object message) {                 bodyPart.getSendMailDisplayer().updateSize();            MujMail.mujmail.getDisplay().setCurrent(sendMail);        }            }        /**     * Used to choose file to attach by browsing file system.     */    public void attachFileSelection() {        System.out.println("Starting FileSystemBrowser");        Callback action = new FSBrowserOKAction();         FileSystemBrowser FSBrowser = new FileSystemBrowser(getSendMail().mujMail,getSendMail(), action,         		FileSystemBrowser.ChoosingModes.FILES, Lang.get(Lang.FS_BROWSER_SELECT_FILE));        FSBrowser.startBrowser(StartupModes.IN_NEW_THREAD);    }            /**     * Holds information about one attached file.     *///    public static class AttachmentInfo {//        /** The number of items of attachment info in sendmail form.//         Used when removing attachments from the form. *///        private static int numberOfItemsInForm = 2;//        private final String attachmentURL;//        private final String attachmentName;//        private long attachmentSize = 0;//        //        /** The string item in which is displayed the size of the file in Sendmail form *///        private StringItem siSize = new StringItem(Lang.get(Lang.SM_FILE_SIZE), "");//        //        AttachmentInfo(BodyPart.FSStorage fsStorage) {//            this.attachmentName = fsStorage.getFileName();//            this.attachmentURL = fsStorage.getFileURL();//            this.attachmentSize = fsStorage.getSize();//            setAttachmentSize(attachmentSize);//        }//        //        AttachmentInfo(String attachmentURL, String attachmentName) {//            this.attachmentName = attachmentName;//            this.attachmentURL = attachmentURL;//        }//        AttachmentInfo(String attachmentURL, String attachmentName, long attachmentSize) {//            this.attachmentName = attachmentName;//            this.attachmentURL = attachmentURL;//            this.attachmentSize = attachmentSize;//            setAttachmentSize(attachmentSize);//        }//        //        public String getAttachmentURL() {//            return attachmentURL;//        }//        public String getAttachmentName() {//            return attachmentName;//        }//        public long getAttachmentSize() {//            return attachmentSize;//        }//        public void setAttachmentSize(long size) {//            this.attachmentSize = size;//            siSize.setText(Functions.formatNumberByteorKByte(size) + "\n");//        }//        //        /** Creates body part which stores information about the i-th attachment.//         * @param header the header of the message to which created body part will belong//         * @param name the name of created body part//         * @return the information about given attachment//         *///        public BodyPart createBodyPart(MessageHeader header, String name) {//            return new BodyPart(header, getAttachmentURL(), getAttachmentName(), //                    name, getAttachmentSize());//        }//        //        /**//         * Displays this attachment in the sendmail form.//         * @param sendmail the form to which add information about this attachment//         *///        public void addAttachmentToForm(SendMail sendmail) {//            // the name of the attachment//            StringItem siFileNameAttached = new //                    StringItem(Lang.get(Lang.SM_ATTACHMENT), getAttachmentName() + "\n");//            sendmail.append(siFileNameAttached);//            //            // the size of the attachment//            sendmail.append(siSize);//        }//    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
26uuu欧美| 一区二区三区四区亚洲| ●精品国产综合乱码久久久久| 国产a区久久久| 国产精品国产三级国产aⅴ中文| 成人午夜免费av| 亚洲专区一二三| 欧美视频三区在线播放| 亚洲精品国产一区二区精华液 | 成人午夜看片网址| 国产片一区二区三区| 国产一区二区免费看| 一区二区三区四区不卡在线 | 国产高清在线观看免费不卡| 久久久久9999亚洲精品| 99热国产精品| 日本伊人午夜精品| 国产精品网曝门| 3d成人动漫网站| 97精品电影院| 奇米色一区二区三区四区| 欧美电影免费提供在线观看| 国产乱理伦片在线观看夜一区| 亚洲素人一区二区| 久久久午夜精品| 91激情五月电影| 国产乱人伦精品一区二区在线观看| 国产精品天美传媒沈樵| 精品久久久久久久久久久久久久久久久 | 极品少妇xxxx偷拍精品少妇| 亚洲视频免费在线观看| 欧美精品一区二区三区四区| 欧美喷水一区二区| 91精品免费在线观看| 精品视频在线免费| 成人av免费在线观看| 国产一区二区在线观看视频| 麻豆传媒一区二区三区| 日本sm残虐另类| 日韩高清在线电影| 一区av在线播放| 亚洲卡通动漫在线| 亚洲免费观看高清完整版在线观看 | 国产精品国产自产拍高清av| 久久婷婷国产综合国色天香| 欧美一激情一区二区三区| 欧美亚洲国产bt| 欧美自拍丝袜亚洲| 色就色 综合激情| 欧美视频三区在线播放| 欧美日韩国产一级| 91精品国产综合久久久久久久 | 国产精品福利一区| 中文字幕av不卡| 亚洲女人****多毛耸耸8| 午夜av一区二区三区| 国内精品久久久久影院色| 久久国产精品99久久久久久老狼| 不卡区在线中文字幕| 91免费在线看| 久久精品久久久精品美女| 青青草97国产精品免费观看| 亚洲一区二区免费视频| 樱桃视频在线观看一区| 99视频在线观看一区三区| 日韩免费成人网| 亚洲精品成人在线| 国产福利一区二区| 欧美精品123区| 国产精品久久久久久户外露出| 午夜激情综合网| 一本大道av一区二区在线播放| 精品国产sm最大网站| 中文字幕免费一区| 久久99国内精品| 欧美一级片在线看| 亚洲小说春色综合另类电影| 国产剧情在线观看一区二区| 日韩亚洲欧美综合| 亚洲欧美日韩久久| 国产精品18久久久久久vr| 欧美高清视频不卡网| 亚洲精品国产精华液| av中文字幕一区| 国产精品免费视频网站| 成人综合在线视频| 亚洲日本在线a| 色老汉av一区二区三区| 久久久久国色av免费看影院| 精品在线免费观看| 91精品婷婷国产综合久久性色| 一区二区三区久久久| 91福利在线导航| 亚洲成av人片在线| 欧美精品在线观看播放| 日韩电影在线一区二区| 精品久久免费看| www.日韩大片| 国产激情精品久久久第一区二区| 精品少妇一区二区三区在线视频 | 久久蜜桃香蕉精品一区二区三区| 麻豆国产精品777777在线| 久久精品夜色噜噜亚洲aⅴ| 成人精品免费网站| 亚洲一区中文日韩| 欧美系列日韩一区| 久久疯狂做爰流白浆xx| 欧美激情综合在线| 在线视频你懂得一区二区三区| 亚洲国产一区二区a毛片| 欧美一区二区三区思思人| 国产一区二区三区不卡在线观看| 国产欧美一区二区三区在线看蜜臀| 成人丝袜视频网| 日韩在线一区二区| 国产亚洲综合av| 在线中文字幕一区| 国产原创一区二区| 亚洲综合色区另类av| 久久这里只有精品首页| 91久久免费观看| 国内精品伊人久久久久av一坑| 国产精品毛片高清在线完整版| 在线国产电影不卡| 成人教育av在线| 免费成人美女在线观看.| 一区二区免费视频| 国产精品日韩成人| 精品久久久久久综合日本欧美| 欧美一区二区三区的| 成人午夜av在线| 国产91对白在线观看九色| 蜜臀久久久99精品久久久久久| 中文字幕在线一区免费| 精品美女被调教视频大全网站| 欧美色国产精品| 欧美日韩国产免费| 欧美性xxxxx极品少妇| 日本丰满少妇一区二区三区| 成人av网站在线观看| 国产成人久久精品77777最新版本| 久久99精品久久久久久| 免费人成在线不卡| 毛片一区二区三区| 欧美a级理论片| 狠狠色狠狠色综合| 国产成人免费xxxxxxxx| 国产a级毛片一区| av网站一区二区三区| 成人午夜av在线| 91九色最新地址| 欧美三级韩国三级日本三斤| 在线视频你懂得一区| 欧美精品乱人伦久久久久久| 欧美一区二区久久| 国产欧美日韩久久| 亚洲三级免费电影| 五月综合激情网| 精品亚洲成a人在线观看| 成人动漫中文字幕| 欧美调教femdomvk| 91精品国产综合久久久久| 久久人人97超碰com| 亚洲人成小说网站色在线| 香蕉久久一区二区不卡无毒影院| 免费成人av在线| 色就色 综合激情| 久久精品这里都是精品| 亚洲国产你懂的| 风流少妇一区二区| 日韩一级片网站| 一区二区三区不卡在线观看| 国产麻豆午夜三级精品| 欧美日韩精品一区二区三区蜜桃| 中文字幕乱码日本亚洲一区二区| 岛国精品在线播放| 日韩欧美亚洲一区二区| 亚洲一级二级三级在线免费观看| 国产91在线看| 久久精品男人天堂av| 男女视频一区二区| 欧美日韩一区二区在线观看| 国产精品久久久久久户外露出| 国产真实乱对白精彩久久| 69久久99精品久久久久婷婷 | 美腿丝袜亚洲三区| 91精品福利在线一区二区三区 | 国产精品一级在线| wwwwxxxxx欧美| 国产精品自产自拍| 国产精品午夜电影| 国产美女视频一区| 欧美国产亚洲另类动漫| 成人激情av网| 亚洲欧美福利一区二区| 91麻豆免费观看| 午夜精品久久久久久久久久久| 欧美日韩一区小说| 蜜桃视频在线观看一区| 久久中文娱乐网|