Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-1979

Allow Modes to be created programmatically from XML

    XMLWordPrintableJSON

Details

    Description

      I work for Sucden Financial Limited and I run a team that develops a trading system called STAR which has a Java Swing front end desktop application which we have recently (it has taken a couple of years!) ported to the NetBeans Platform, all with Maven.

      A feature of the application is where the user is able to save the layouts of windows and panels in different combinations and load them up as required. We call this work-space management. The entire layout of all the windows and their components is saved in one XML file. (Note this is NOT the same as the term "work space" which I have seen is a deprecated mechanism inside the NetBeans window system and I am not suggesting that should be resurrected.)

      To enable that feature in the NetBeans Platform, I made some minor additions to the openide.windows module and small changes/refactoring to the core.windows module to be able to capture the XML representation of ModeConfig objects and subsequently reproduce Modes by passing XML into WindowManager/WindowManagerImpl.

      As I have ported our application to the Platform and investigated the window system api and internals, It seemed to me that the original intention of the window system and TopComponent relationship makes the assumption that some kind of file on disk would always be associated with a TopComponent, but that is definitely not our use case. Furthermore, only saving the layout of Modes at application shutdown, within a NetBeans userdir rooted location is also not suitable.

      With these modifications, an application can capture and reproduce the Modes required for TopComponents to be docked into, which is essential for us and I think would be a useful feature in the windows api for other developers to use.

      I have pushed these changes on my fork at https://github.com/phipma/incubator-netbeans/commit/cc170aa195c1f843edb3badff83776c2f794440c

      I am new at this and I have only done the minimum required to satisfy our needs, so apologies if anyone considers it amateurish!

       

       

      Attachments

        1. google-safer-email.zip
          475 kB
          bevcamp00

        Activity

          People

            Unassigned Unassigned
            phipma Mark Phipps
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10h 20m
                10h 20m