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/src/org/netbeans/modules/openide/windows/TopComponentProcessor.java (-12 / +14 lines)
Lines 87-105 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
            String rootFolder = role.isEmpty() ? "Windows2" : "Windows2/Roles/" + role;
91
            for (String role : roles){
92
                String rootFolder = role.isEmpty() ? "Windows2" : "Windows2/Roles/" + role;
92
93
93
            File settingsFile = layer(e).
94
                File settingsFile = layer(e).
94
                file(rootFolder+"/Components/" + id + ".settings").
95
                    file(rootFolder+"/Components/" + id + ".settings").
95
                contents(settingsFile(e));
96
                    contents(settingsFile(e));
96
            settingsFile.write();
97
                settingsFile.write();
97
            
98
98
            File modeFile = layer(e).
99
                File modeFile = layer(e).
99
                file(rootFolder+"/Modes/" + reg.mode() + "/" + id + ".wstcref").
100
                    file(rootFolder+"/Modes/" + reg.mode() + "/" + id + ".wstcref").
100
                position(reg.position()).
101
                    position(reg.position()).
101
                contents(modeFile(info.preferredID(), reg.openAtStartup()));
102
                    contents(modeFile(info.preferredID(), reg.openAtStartup()));
102
            modeFile.write();
103
                modeFile.write();
104
            }
103
        }
105
        }
104
        
106
        
105
        for (Element e : roundEnv.getElementsAnnotatedWith(TopComponent.OpenActionRegistration.class)) {
107
        for (Element e : roundEnv.getElementsAnnotatedWith(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 (-2 / +2 lines)
Lines 72-78 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 set = FileUtil.getConfigFile("Windows2/Roles/UnitTestRole1/Components/my-tc2.settings");
76
        assertNotNull("Settings file found", set);
76
        assertNotNull("Settings file found", set);
77
        assertValidate(set.asText());
77
        assertValidate(set.asText());
78
    }
78
    }
Lines 169-175 Link Here
169
    @TopComponent.Registration(
169
    @TopComponent.Registration(
170
        mode="output",
170
        mode="output",
171
        openAtStartup=false,
171
        openAtStartup=false,
172
        role="UnitTestRole"
172
        roles={"UnitTestRole1", "UnitTestRole2"}
173
    )
173
    )
174
    @TopComponent.Description(
174
    @TopComponent.Description(
175
        preferredID="my-tc2", iconBase="org/openide/windows/Icon.png"
175
        preferredID="my-tc2", iconBase="org/openide/windows/Icon.png"

Return to bug 203553