| 92 | * For every importable resource there will be ResourceImportManager implementation and all the repeated logic in the modules for inserting and importing will be removed. There is one spesial SophieFormatImportManager that imports resources into Sophie 2.0 format... It is special because all the resources are able to be imported with it. For resources that have no special data like the Browser there is EmptyDataImportManager to be extended by them. |
| 93 | * ResourceImportUtil : The util provides methods that can insert frame and create resource, import resources, insert frames for existing resources and is able to handle dropped resources from the DND. These methods work with the appropriate provider and additional parameters like current book for example. |
| 94 | * ResourceImportLogic : This logic handles all the imports of resources in Sophie 2. It uses the ResourceImportUtil's methods. Handlers: |
| 95 | * ON_INSERT_FRAME : Handles inserting frames from the menu items. All the menu items that insert resources extend InsertResourceMenuItem which have abstract method getImportRole. That means that every insert item has such a role, and the right ResourceImportProvider for it can be found easily. The items have isLinked method too, So the logic works in the following way : Fetches the right provider by the import role of the InsertMenuItem, source of the event and if it doesn't insert linked frame creates the right resource. Inserts frame for the link or the resource. |
| 96 | * ON_IMPORT_RESOURCE : It's event's source is the ResourceDetailsPalette, the import button... It simply opens FileDialog with all files filter, for the not supported files it shows a message that they are not supported, for the supported -> imports them without inserting frames for them. |
| 97 | * ON_DROP_RESOURCE : It's event id is ImportEventIds.DND_IMPORT_RESOURCES, all the drag and drop logics fire such an event , the old logics will stay, because they are sorted in the right way, but they will only fire ecent for that handler... It uses the ResourceImportUtil to insert frames for resources. Drag and drop logic for resource from outside to Sophie is still not supported. |