This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 195820 - Ability to reload window system configuration
Summary: Ability to reload window system configuration
Status: RESOLVED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 7.0
Hardware: Other Linux
: P3 normal (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2011-02-22 18:07 UTC by Jaroslav Tulach
Modified: 2016-05-25 06:10 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
The new action registration (2.43 KB, patch)
2011-02-22 18:10 UTC, Jaroslav Tulach
Details | Diff
Sample application to reproduce the problem (18.95 KB, application/zip)
2014-12-03 17:18 UTC, AngeloD
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2011-02-22 18:07:56 UTC
This is not really useful for end user (although it might be for power user), but applications written on top of NetBeans Platform might find the ability to ask the window system to reload its configuration useful.

I am attaching patch, how such API (e.g. an action in this case) might look like.
Comment 1 Jaroslav Tulach 2011-02-22 18:10:59 UTC
Created attachment 106311 [details]
The new action registration
Comment 2 Jaroslav Tulach 2011-02-25 19:25:24 UTC
http://hg.netbeans.org/ergonomics/rev/fa3cbf208c5d
Comment 3 Quality Engineering 2011-02-27 05:09:45 UTC
Integrated into 'main-golden', will be available in build *201102270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/fa3cbf208c5d
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #195820: Reload and save window setup
Comment 4 AngeloD 2014-12-03 17:14:04 UTC
The proposed solution does not trigger the loading of the TopComponents settings.

The unit tests provided check only  if the action is there but not that indeed work.
A test like the following should be added:

    @Test

    public void testSomeMethod() {

        TestTopComponent tc = new TestTopComponent();
        -- change TopComponent to state 1--

       FileObject fo = FileUtil.getConfigFile("Actions/Window/org-netbeans-core-windows-actions-   SaveWindowsAction.instance");

        assertNotNull("Action is found", fo);

        Action action = (Action) fo.getAttribute("instanceCreate");

        action.actionPerformed(null);

        -- change TopComponent to state 2--

        fo = FileUtil.getConfigFile("Actions/Window/org-netbeans-core-windows-actions-ReloadWindowsAction.instance");

        assertNotNull("Action is found", fo);

        action = (Action) fo.getAttribute("instanceCreate");

        action.actionPerformed(null);

        assertTrue (--- TopComponent has state 1--);

    }
Comment 5 AngeloD 2014-12-03 17:18:32 UTC
Created attachment 150865 [details]
Sample application to reproduce the problem

Start the application

Press the red button to change the background of the panel to red

Press the save button to save the settings

Press the black button to change the background of the panel to black

Press the reload button, the background of the panel should go back to red, but it stays black.

The save/reload functionality works as expected for the windows positions.