filehandler ================= .. js:class:: FileHandler() The file handler for vispa. One can add :js:class:`MenuItem` like objects, which can be used within a menu (like headless) or directly. :js:func:`getFileHandlers` then returns all registered file handlers with the property *value* set to the filename, which is given to the function as parameter. The handlers themself should update themself via the filename. Classes deriving from :js:class:`BaseView` can set the member property *fileHandlers*, which must be a list of :js:class:`MenuItem` like objects. These are automatically added to the file handler. Additionally. :js:class:`BaseView` adds :js:func:`spawn` to the handler so that inside :js:func:`callback` *this.spawn* can be used to easily spawn an instance. .. js:function:: addFileHandler(key, handler) Add a single file handler with key. .. js:function:: addFileHandlers(handlers) Add a dict of file handlers. .. js:function:: getFileHandlers(file) Get all file handlers. Each is updated previously with *handler.value = file*. .. js:function:: getDefaultFileHandler(file) Get the file handler with the highest position or *null* if it has no callback, e.g. for a divider or a header. .. js:function:: runDefaultHandler(file, view) Runs the default file handler if available for the given view. :param String file: The file to run the handler for. :param BaseView view: The view that intends to open the file.