001    package jmaster.jumploader.app;
002    
003    import jmaster.jumploader.jsface.api.IJSUploader;
004    import jmaster.jumploader.model.api.config.AppletConfig;
005    import jmaster.jumploader.model.api.config.UploaderConfig;
006    import jmaster.jumploader.model.api.config.ViewConfig;
007    import jmaster.jumploader.view.api.main.IMainView;
008    
009    /**
010     * IJumpLoaderApplet
011     * 
012     * @author timur
013     */
014    
015    public interface IJumpLoaderApplet {
016            //---------------------------------------------------------------
017            //      constants
018            //---------------------------------------------------------------
019            //
020            //      JavaScript callbacks
021            public static final String JS_CALLBACK_APPLET_INITIALIZED = "appletInitialized";
022            public static final String JS_CALLBACK_UPLOADER_FILE_ADDED = "uploaderFileAdded";
023            public static final String JS_CALLBACK_UPLOADER_FILE_REMOVED = "uploaderFileRemoved";
024            public static final String JS_CALLBACK_UPLOADER_FILE_MOVED = "uploaderFileMoved";
025            public static final String JS_CALLBACK_UPLOADER_FILE_STATUS_CHANGED = "uploaderFileStatusChanged";
026            public static final String JS_CALLBACK_UPLOADER_FILES_RESET = "uploaderFilesReset";
027            public static final String JS_CALLBACK_UPLOADER_STATUS_CHANGED = "uploaderStatusChanged";
028            public static final String JS_CALLBACK_UPLOADER_SELECTION_CHANGED = "uploaderSelectionChanged";
029            public static final String JS_CALLBACK_UPLOAD_VIEW_FILE_OPEN_DIALOG_FILES_SELECTED = "uploadViewOpenDialogFilesSelected";
030            public static final String JS_CALLBACK_MAIN_VIEW_MESSAGE_SHOWN = "mainViewMessageShown";
031            //---------------------------------------------------------------
032            //      business methods
033            //---------------------------------------------------------------
034            /**
035             * applet info retrieval (name, version) 
036             */
037            public String getAppletInfo();
038            /**
039             * uploader interface retrieval
040             */
041            public IJSUploader getUploader();
042            /**
043             * main view retrieval
044             */
045            public IMainView getMainView();
046            /**
047             * view config retrieval
048             */
049            public ViewConfig getViewConfig();
050            /**
051             * uploader config retrieval
052             */
053            public UploaderConfig getUploaderConfig();
054            /**
055             * applet config retrieval
056             */
057            public AppletConfig getAppletConfig();
058            /**
059             * show/hide frame
060             */
061            public void showFrame( boolean show );
062            /**
063             * set ui default
064             */
065            public void setUiDefault( String key, String value );
066            /**
067             * ui default retrieval
068             */
069            public Object getUiDefault( String key );
070            /**
071             * inject property
072             * @param target a target bean to inject property to, if target is null then target is this applet
073             * @param property a proeprty name, may be dot separated path
074             * @param value a text representation of property
075             * @return error message or null, if ok
076             */
077            public String injectProperty( Object target, String property, String value );
078            public String injectProperty( String property, String value );
079            /**
080             * retrieve property
081             */
082            public Object getProperty( String property );
083            /**
084             * shows whether applet is being destroyed
085             */
086            public boolean isDestroying();
087            /**
088             * shows whether applet is being stopped
089             */
090            public boolean isStopping();
091    }