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.

View | Details | Raw Unified | Return to bug 203553
Collapse All | Expand All

(-)a/openide.windows/apichanges.xml (-1 / +2 lines)
Lines 60-66 Link Here
60
    <description>
60
    <description>
61
        Since the window system now supports multiple window layouts - roles -
61
        Since the window system now supports multiple window layouts - roles -
62
        the annotation for TopComponent registration needs an optional parameter
62
        the annotation for TopComponent registration needs an optional parameter
63
        to specify the role the window should belong to.
63
        to specify one or more roles the window should belong to. If no roles
64
        are specified, the TopComponent is registered in the default layout.
64
    </description>
65
    </description>
65
    <class package="org.openide.windows" name="TopComponent"/>
66
    <class package="org.openide.windows" name="TopComponent"/>
66
    <issue number="199452"/>
67
    <issue number="199452"/>
(-)a/openide.windows/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.openide.windows
2
OpenIDE-Module: org.openide.windows
3
OpenIDE-Module-Specification-Version: 6.46
3
OpenIDE-Module-Specification-Version: 6.47
4
OpenIDE-Module-Localizing-Bundle: org/openide/windows/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/openide/windows/Bundle.properties
5
AutoUpdate-Essential-Module: true
5
AutoUpdate-Essential-Module: true
6
6
(-)a/openide.windows/src/org/netbeans/modules/openide/windows/TopComponentProcessor.java (-1 / +3 lines)
Lines 87-93 Link Here
87
            }
87
            }
88
            String id = info.preferredID().replace('.', '-');
88
            String id = info.preferredID().replace('.', '-');
89
            
89
            
90
            String role = reg.role();
90
            String[] roles = reg.roles();
91
            for (String role : roles){
91
            String rootFolder = role.isEmpty() ? "Windows2" : "Windows2/Roles/" + role;
92
            String rootFolder = role.isEmpty() ? "Windows2" : "Windows2/Roles/" + role;
92
93
93
            File settingsFile = layer(e).
94
            File settingsFile = layer(e).
Lines 101-106 Link Here
101
                contents(modeFile(info.preferredID(), reg.openAtStartup()));
102
                contents(modeFile(info.preferredID(), reg.openAtStartup()));
102
            modeFile.write();
103
            modeFile.write();
103
        }
104
        }
105
        }
104
        
106
        
105
        for (Element e : roundEnv.getElementsAnnotatedWith(TopComponent.OpenActionRegistration.class)) {
107
        for (Element e : roundEnv.getElementsAnnotatedWith(TopComponent.OpenActionRegistration.class)) {
106
            TopComponent.OpenActionRegistration reg = e.getAnnotation(TopComponent.OpenActionRegistration.class);
108
            TopComponent.OpenActionRegistration reg = e.getAnnotation(TopComponent.OpenActionRegistration.class);
(-)a/openide.windows/src/org/openide/windows/TopComponent.java (-2 / +2 lines)
Lines 1428-1438 Link Here
1428
        /** Shall the component be opened at start */
1428
        /** Shall the component be opened at start */
1429
        boolean openAtStartup();
1429
        boolean openAtStartup();
1430
        /** 
1430
        /** 
1431
         * Window layout role or an empty string for the default layout 
1431
         * Window layout roles or an empty string for the default layout 
1432
         * @see WindowManager#setRole(java.lang.String) 
1432
         * @see WindowManager#setRole(java.lang.String) 
1433
         * @since 6.45
1433
         * @since 6.45
1434
         */
1434
         */
1435
        String role() default "";
1435
        String[] roles() default "";
1436
    }
1436
    }
1437
    
1437
    
1438
    /** Creates an action that can open the component.
1438
    /** Creates an action that can open the component.
(-)a/openide.windows/test/unit/src/org/netbeans/modules/openide/windows/TopComponentProcessorTest.java (-4 / +6 lines)
Lines 72-80 Link Here
72
    }
72
    }
73
73
74
    public void testTCRegisteredInRoleFine() throws Exception {
74
    public void testTCRegisteredInRoleFine() throws Exception {
75
        FileObject set = FileUtil.getConfigFile("Windows2/Roles/UnitTestRole/Components/my-tc2.settings");
75
        FileObject set1 = FileUtil.getConfigFile("Windows2/Roles/UnitTestRole1/Components/my-tc2.settings");
76
        assertNotNull("Settings file found", set);
76
        assertNotNull("Settings file found", set1);
77
        assertValidate(set.asText());
77
        assertValidate(set1.asText());
78
        FileObject set2 = FileUtil.getConfigFile("Windows2/Roles/UnitTestRole2/Components/my-tc2.settings");
79
        assertNotNull("Settings file found", set2);
78
    }
80
    }
79
81
80
    public void testTCRegisteredFine() throws Exception {
82
    public void testTCRegisteredFine() throws Exception {
Lines 169-175 Link Here
169
    @TopComponent.Registration(
171
    @TopComponent.Registration(
170
        mode="output",
172
        mode="output",
171
        openAtStartup=false,
173
        openAtStartup=false,
172
        role="UnitTestRole"
174
        roles={"UnitTestRole1", "UnitTestRole2"}
173
    )
175
    )
174
    @TopComponent.Description(
176
    @TopComponent.Description(
175
        preferredID="my-tc2", iconBase="org/openide/windows/Icon.png"
177
        preferredID="my-tc2", iconBase="org/openide/windows/Icon.png"

Return to bug 203553