Integrating external products into eclipse


Published on

One of the nice things about an IDE is that you can do the majority of your development tasks in one application — hence, integrated. It takes time away from
your work to have to switch from your IDE to another program. This presentation talks about how external applications can be made a part of an Eclipse IDE by hosting them within Eclipse and integrating them to leverage Eclipse offered usability.

Published in: Education, Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Need to provide a WSDL/WADL URLCreates a .mrp file for storing state/data of testingWizards to create a Web Service TestINPUT – WSDL/WADL URLOUTPUT – .mrp fileEditor support to open .mrp fileShow the stored tests state (.mrp file)Show the web-application as part of Editor
  • File System Sender writes to a file Receiver reads from it But when does the receiver do the read? Often synchronized with file locking or lock files Special types of files can make file-based IPC easierMessage-Based IPC Sender formats data into a formal message With some form of address for receiver OS delivers message to receiver’s message input queue (might signal too) Receiver (when ready) reads a message from the queue Sender might or might not blockProcedure Call IPCInterprocess communication uses same procedure call interface as intraprocess Data passed as parameters Information returned via return values Complicated since destination procedure is in a different address space Generally, calling procedure blocks till call returnsShared Memory IPC Different processes share a common piece of memory Either physically or virtually Communications via normal reads/writes May need semaphores or locks In or associated with the shared memory
  • AppBuilder: show, hide, delete : proxies for IDE viewgetViewHwnd: get window handlesetEmbeddedWindow: Sets the given view as the parent for the given windowHandleaddWindow: With this API multiple windows can be attached to a view. (add palette and )
  • Description:1. A .w file can be opened from the IDE by double-clicking the file in the Project Explorer view, or by dragging the file from the the Project Explorer view onto the AppBuilder window. Alternatively, a .w file can be opened from theAppBuilder. In either case, the openLinkedEditor method is called in the IDE to link an OEIDE Editor instance to the AppBuilder. The actual file is opened in the editor and a copy via a temporary file, is opened in the AppBuilder. The editor and the AppBuilder have the same content.2. Using the Edit Code option (Section Editor) in the AppBuilder causes the AppBuilder to synchronize the changes to the temporary file (syncFromAB), and then it invokes the selectSection method to reposition the code to the trigger section for the selected widget. If there are no triggers defined for the selected widget, a default trigger is created when synchronizing. The editor gets updated from the AppBuilder.3. Any of the AppBuilder dialogs and windows can be used to modify the instance of the .w file in the AppBuilder.4. When the OEIDE Editor gets focus, the syncFromAB method is called in the AppBuilder to synchronize the file. The editor gets updated from the AppBuilder.5. Any of the OEIDE functionality, in particular templates, can be used to modify the instance of the .w file in the OEIDE Editor.6. When the editor loses focus, the syncFromIDE method is called in the AppBuilder to synchronize the file. The AppBuilder gets updated from the OEIDE Editor.7. When the file is saved in the IDE, the syncFromAB method is called in the AppBuilder to synchronize the file. The editor gets updated from the AppBuilder.8. When the file is saved in the AppBuilder, the file is synchronized (syncFromAB), and then the saveLinkedEditor method is used to save the file on the IDE side. The editor and the AppBuilder have the same content.9. When the file is closed in the AppBuilder, the unlinkEditor method is called in the IDE so the editor does not try to synchronize with the AppBuilder.10. When the file is closed in the IDE, the instance of the .w file in the AppBuilder is closed.
  • .NET presentation container is used for users looking for a modern UI with very rich functionality that can be used to present their Progress applications. These customers want to be able to make use of the .NET presentation container with little or no knowledge of any of the .NET languages. SerializationDeserializationCodeDOMASTABL language
  • Integrating external products into eclipse

    1. 1. Integrating external products into Eclipse<br />Eclipse Day India 2011<br />Presenters: <br />Aditya Madduri<br />Girish Kumar Balre<br />
    2. 2. Agenda<br />Need for Integration<br />Challenges in Integration<br />Eclipse Integration Points<br />Discussing different scenarios:<br />Web Services Testing Tool <br />Win32 Applications<br />Swing Applications<br />
    3. 3. Leverage Eclipse’s predefined facilities and usability<br />Enforce company standards<br />Multiple tools under ONE application (e.g., IDE)<br />Improved usage of the screen real estate<br />Increased functionality thereby increased productivity<br />Retaining Legacy Applications<br />Huge customer base<br />Huge effort for full migration<br />Need for Integration<br />
    4. 4. Challenges in Integration<br />Communication <br />Between different technologies<br />Between different languages<br />Attaching to Eclipse UI<br />Hosting foreign technology inside Eclipse UI<br />Event Handling, and <br />Wiring between views, menus etc<br />
    5. 5. Eclipse Integration Points<br />Editor/View integration<br />Outline/Properties View integration<br />Problems View Integration<br />Toolbar/menu actions<br />Perspective<br />Preferences<br />
    6. 6. Agenda…<br />Need for Integration<br />Challenges in Integration<br />Discussing different scenarios<br />Web apps <br />Win32 apps<br />Swing apps<br />
    7. 7. Integrating Web Applications<br />Need a web server<br />Eclipse ships Jetty Server<br />Configure any server using WTP<br />Launching application<br />Toolbar/Menu actions<br />Needs Artifacts – Use Wizards<br />Links to different pages<br />Views<br />SWT Trees<br />Communicate between Web app & Eclipse controls<br />Eclipse  Web App (change URLs)<br />Web App  Eclipse (???)<br />
    8. 8. Example: Progress Actional Diagnostics<br />Progress Actional Diagnostics<br />Progress Web Application with comprehensive Web Services testing capabilities having using browser front end <br />Rich functionality<br />Extensive support for various bindings<br />Pseudo code™ view, no XML required<br />Raw view<br />Pseudo code view<br />
    9. 9. Example: Progress Actional Diagnostics (contd.)<br />Integration with Eclipse IDE<br />General<br />Wizards to create a Web Service Test<br />Allow user to begin testing immediately sans wizards using Untitled WS Test File(a la Untitled Text File) <br />Editor<br />Persist/load changes from custom file on Left pane<br />Left pane and right pane need to be kept in synch<br />Maintain state- mark as dirty when messages sent/received<br />
    10. 10. Example: Progress Actional Diagnostics (contd.)<br />Web Application<br />Root Contract<br />Binding<br />Operation<br />Messages<br />Right Pane: Browser Component<br />Left Pane: Tree for intuitive navigation<br />
    11. 11. Example: Progress Actional Diagnostics (contd.)<br />Changes to the tree should reflect in the browser and vice-versa<br />SWT Tree<br />Browser Component<br />
    12. 12. Example: Progress Actional Diagnostics (contd.)<br />Synching between the Tree and the Browser<br />Tree  Browser<br />Straightforward - Just need to change the URL set on the browser component<br />Browser  Tree<br />Complicated - ???<br />
    13. 13. Example: Progress Actional Diagnostics (contd.)<br />Producer Consumer Communication Model<br />The design pattern for sending messages between two or more clients.<br />Consumer/subscriber<br /> Producer/publisher <br />Eclipse Editor<br />WS Web Application<br />Send Messages<br />Listens Messages<br />
    14. 14. Example: Progress Actional Diagnostics (contd.)<br />Consumer/subscriber<br />On receiving Message<br />Eclipse Editor<br />Parses the message<br />Listens to Messages<br />Updates the artifact file <br />with test’s current state<br />Updates and refreshes the tree<br />
    15. 15. Agenda…<br />Need for Integration<br />Challenges in Integration<br />Discussing different scenarios<br />Web apps<br />Win32 apps<br />Swing apps<br />
    16. 16. Integrating Win32 Applications<br />Use case: Hosting and Integrating a win32 application inside a Eclipse IDE.<br />Hosting:Bringing a win32 app to open inside an Eclipse UI<br />Integrating: The win32 app needs to<br />Respond to Eclipse’s menu actions (Open, Save, Exit)<br />Respond to resizing, minimizing, closing<br />Fire events to other Eclipse views<br />
    17. 17. Desktop<br />Integrating Win32 Applications (contd.)<br />Hosting:Opening a win32 app to open inside an Eclipse<br />Solution:<br />Each window has a handle (hWnd)<br />property i.e., a UID<br />Win32 API offers a SetParent<br />function. An application can use <br /> the SetParent function to set the <br />parent window of a pop-up, <br />overlapped, or child window.<br />org.eclipse.swt.widgets.Controlhas a handle property which is the hWnd i.e., this control’s unique identification ID<br />Window1<br />Window 2<br />Child Window 1<br />Window 3<br />
    18. 18. Interprocess communication<br /><ul><li>File system IPC
    19. 19. Message-based IPC
    20. 20. Procedure call IPC
    21. 21. Shared memory IPC</li></ul>Integrating Win32 Applications (contd.)<br />Integrating: This involves the win32 app to<br />Responds to Eclipse’s menu actions<br />Responds to resizing, minimizing, closing<br />Is capable to firing events to other Eclipse views<br />Process2<br />Process1<br />
    22. 22. Example: Progress OpenEdgeAppBuilder<br />IDE API<br /><ul><li>showView
    23. 23. hideView
    24. 24. deleteView
    25. 25. getViewHwnd
    26. 26. setChildWindow
    27. 27. addWindow
    28. 28. setViewTitle</li></ul>Inter process communication<br />Socket Communication<br />Eclipse<br />IDE <br />Win32<br />Application<br />AppicationAPI<br /><ul><li>showView
    29. 29. hideView
    30. 30. deleteView
    31. 31. getViewHwnd
    32. 32. setChildWindow
    33. 33. addWindow
    34. 34. setViewTitle</li></ul>Eclipse Framework (org.eclipse.swt.internal.win32)<br /><ul><li>setParent, getParent
    35. 35. setWindowPosition
    36. 36. showWindow
    37. 37. getWindow
    38. 38. bringWindowToTop</li></ul>…<br />
    39. 39. Example: Progress OpenEdgeAppBuilder (contd.)<br />
    40. 40. Example: Progress OpenEdgeAppBuilder (contd.)<br />AppBuilder<br />showView<br />hideView<br />deleteView<br />getViewHwnd<br />setEmbeddedWindow<br />addWindow<br />setViewTitle<br />isIDERunning<br />IDE_Command<br />IDE<br />showView<br />hideView<br />deleteView<br />getViewHwnd<br />setEmbeddedWindow<br />addWindow<br />setViewTitle<br />AppBuilder<br />IDE<br />PVM<br />Eclipse Framework<br />TCP/IP<br />Eclipse Framework<br />showView<br />hideView<br />setPartName<br />PVM<br />SESSION:IDE-DEFAULT-PARENT-HWND<br />hWindow:IDE-PARENT-HWND<br />hWindow:IDE-WINDOW-TYPE<br />
    41. 41. Example: Progress OpenEdgeAppBuilder (contd.)<br />AppBuilder<br />IDE<br />Open File<br />Open File<br />openLinkedEditor<br />openABFile<br />File Changes<br />syncFromAB<br />Editor gets Focus<br />File Changes<br />Editor loses Focus<br />syncFromIDE<br />Save File<br />syncFromAB<br />Save File<br />saveLinkedEditor<br />syncFromAB<br />Close File<br />unlinkEditor<br />Close Editor<br />closeABFile<br />
    42. 42. Example: DOTNET Designer & controls<br />Inter process communication<br />Socket Communication<br />Eclipse IDE<br />IPC<br />Editor<br />CLR<br />Common Language Runtime<br />Java runtime<br />Prowin32 <br />runtime<br />Designer<br />
    43. 43. Example: DOTNET Designer & controls (contd.)<br />
    44. 44. Agenda…<br />Need for Integration<br />Challenges in Integration<br />Discussing different scenarios<br />Web apps<br />Win32 apps<br />Swing apps<br />
    45. 45. Swing – Need for integration<br />Technology convergence - Eclipse platform as IDE<br />Eclipse is SWT based (Editors, Views etc)<br />Swing and SWT are parallel technologies<br />2 Options<br />Convert Swing code to SWT <br />Tedious and Costly migration<br />Increases development and testing effort<br />Integrate Swing with SWT – “Swing-SWT Bridge”<br />Swing component dwells in SWT containers<br />Write only bridge code<br />Most preferred option<br />
    46. 46. Swing - Eclipse Integration points<br />Editor/View integration<br />Embed the main panel of Swing inside a composite.<br />Trap and delegate Key binding actions<br />Outline/Properties View integration<br />Listen for selection - Update Swing/SWT<br />Problems View Integration<br />Validation markers<br />Double click on problem - select Swing control<br />
    47. 47. Swing - Eclipse Integration points (contd.)<br />Toolbar/menu actions<br />Placeholder for Swing Editor specific actions.<br />Preferences<br />Migrate the app preferences to eclipse preferences<br />Project level preferences as relevant<br />Reverse integration – Swing to Eclipse <br />Drive eclipse code from swing actions (For ex: new File wizard)<br />Modal Swing dialogs<br />
    48. 48. Swing - Eclipse Integration points (contd.)<br />Use effective code-bridge mechanisms <br />Wrap and Delegate to Swing code/actions.<br />Clean separation between SWT and Swing code.<br />Interface dependencies<br />
    49. 49. SWT/AWT Bridge<br />SWT/AWT bridge (Eclipse plugin) – part of SWT<br />Embedding Swing application made easy.<br />has API for creation of Swing Frame from SWT composite.<br />Embeds the Swing frame in to the Bridge<br />
    50. 50. Swing App<br />
    51. 51. Example - Integrated Swing App in Eclipse Editor<br />Existing Swing based graphical editors have been integrated tightly into Eclipse views. <br />
    52. 52. UI Threads – <br />SWT & Swing have there own UI threads. <br />Prevent/Pre-empt Deadlocks.<br />Look and Feel – <br />SWT has native look and feel. <br />Swing look and feel has to be configured.<br />Modal dialogs of SWT & Swing are independent<br />Tab traversal, popup menus etc., have to be handled<br />Clubbing various Swing entities in to one eclipse<br />Issues<br />
    53. 53. Solutions<br />Issues can be addressed as per their merit. <br />For instance when Swing opens a model dialog it can block SWT<br />SWT code should be written in such a way to delegate the events to the frame composite too<br />
    54. 54. Summary<br />Integrated environment – Good for the user<br />Its possible to integrate External products built on foreign technologies inside Eclipse<br />Things to take care<br />Optimal technique to communicate between different environments<br />Try to make full use of Eclipse offered usability<br />
    55. 55. References<br /><br /><br /><br />