The Object Browser contains a "detailed" overview of certain objects. The representation of the Object Browser differs from object type to object type.
For example, the detailed overview of documents typically looks like this:
It is possible to implement own tabs for specific object types using the OSGi extension service "clear stated service" of ECTR 184.108.40.206.
The Object Browser Tab extension service definition tries to mask this complexity a little.
PluginObjectBrowserTab has two methods with clearly defined purposes for main work:
- fetchData - enables the custom implementation to access the SAP backend using RfcExecutor or to do other long running tasks to get data. This method cannot be called from the AWT Event Dispatcher Thread.
- updateUI - enables the custom implementation to use data gathered in fetchData and to update the UI using this data. This method is guaranteed to be called from the AWT Event Dispatcher Thread. This method must be finished in short time. No backend calls or other long running tasks are allowed here, otherwise the whole ECTR UI stops to respond.
If the implementation uses these methods for what they were intended, the implementation already follows the "golden" rules mentioned above.
Access the database, read the files, calculate the data in fetchData, and then use this prepared data in the UpdateUI to update the Swing data model.
The context window's implementation offers several possibilities to interact with ECTR beside of just being displayed in ECTR. The implementation is able to handle DnD events, so it is possible to e.g. transfer the DnD of a document from the desktop window to this context (method dataReceived).
It is also possible to send an event to the ObjectBrowser in order to let it display a specific SAP object - so every context is able to implement the feature "ObjectBrowser follows active selection" like other ECTR contexts. This is done by using method fireEvent.
The context window implementation also has the possibility to perform calls to the backend SAP system using the RfcExecutor Service (remember the "golden" rules!)
- Implement the tab itself by implementing the methods of the interface PluginObjectBrowserTab
- Implement the "tab dispatcher" by implementing OSGi Service PluginObjectBrowserTabService
PluginObjectBrowserTabService must return the custom implementation of the PluginObjectBrowserTab which handles the object type passed to its method getTabsFor.
See the sequence diagram below for a more detailed overview of the interaction between ECTR and customer tab implementations.
List of object types:
- DRAW - Document
- MARA - Material
- EQUI - Equipment
- IFLOT - Functional location
- AENR - Change Number
As of now (220.127.116.11), it is not possible to enhance the Object Browser display for folders. The folder display uses no tabs, so custom tabs can not be used for the folder display.
The ECTR UI uses Java Swing as UI framework. Therefore, the third party implementations of the context window have to use Java Swing also. The mixing of UI Frameworks has been known to cause problems or to not work at all.
Using JavaFX with ECTR is not going to work. ECTR is shipped with SAP JRE which - at least as of now (15.11.2017) - lacks support of JavaFX.
Please be aware of how Java Swing should interact with threads.
For this interaction, please heed the following two "golden" rules:
- Never do SAP calls or other potentially long running tasks inside an AWT Event Dispatcher Thread .
- Never access UI components outside an AWT Event Dispatcher Thread.
Otherwise the whole ECTR UI may be rendered unusable, not just the own custom context window.
See the Swing documentation for background information: https://docs.oracle.com/javase/tutorial/uiswing/concurrency/index.html