Lines 42-48
Link Here
|
42 |
|
42 |
|
43 |
package org.netbeans.modules.openide.windows; |
43 |
package org.netbeans.modules.openide.windows; |
44 |
|
44 |
|
|
|
45 |
import java.util.ArrayList; |
45 |
import java.util.HashSet; |
46 |
import java.util.HashSet; |
|
|
47 |
import java.util.List; |
46 |
import java.util.Set; |
48 |
import java.util.Set; |
47 |
import javax.annotation.processing.Processor; |
49 |
import javax.annotation.processing.Processor; |
48 |
import javax.annotation.processing.RoundEnvironment; |
50 |
import javax.annotation.processing.RoundEnvironment; |
Lines 86-95
Link Here
|
86 |
throw new LayerGenerationException("Cannot find TopComponent.Description for this element", e, processingEnv, reg); |
88 |
throw new LayerGenerationException("Cannot find TopComponent.Description for this element", e, processingEnv, reg); |
87 |
} |
89 |
} |
88 |
String id = info.preferredID().replace('.', '-'); |
90 |
String id = info.preferredID().replace('.', '-'); |
89 |
|
91 |
List<String> uniqueRolesList = new ArrayList<String>(); |
90 |
String role = reg.role(); |
92 |
String[] roles = reg.roles(); |
|
|
93 |
for (String role : roles){ |
91 |
String rootFolder = role.isEmpty() ? "Windows2" : "Windows2/Roles/" + role; |
94 |
String rootFolder = role.isEmpty() ? "Windows2" : "Windows2/Roles/" + role; |
92 |
|
95 |
if(!uniqueRolesList.contains(role)){ |
|
|
96 |
uniqueRolesList.add(role); |
97 |
} else { |
98 |
throw new LayerGenerationException("Duplicate role name found", e, processingEnv, reg); |
99 |
} |
100 |
|
93 |
File settingsFile = layer(e). |
101 |
File settingsFile = layer(e). |
94 |
file(rootFolder+"/Components/" + id + ".settings"). |
102 |
file(rootFolder+"/Components/" + id + ".settings"). |
95 |
contents(settingsFile(e)); |
103 |
contents(settingsFile(e)); |
Lines 101-106
Link Here
|
101 |
contents(modeFile(info.preferredID(), reg.openAtStartup())); |
109 |
contents(modeFile(info.preferredID(), reg.openAtStartup())); |
102 |
modeFile.write(); |
110 |
modeFile.write(); |
103 |
} |
111 |
} |
|
|
112 |
} |
104 |
|
113 |
|
105 |
for (Element e : roundEnv.getElementsAnnotatedWith(TopComponent.OpenActionRegistration.class)) { |
114 |
for (Element e : roundEnv.getElementsAnnotatedWith(TopComponent.OpenActionRegistration.class)) { |
106 |
TopComponent.OpenActionRegistration reg = e.getAnnotation(TopComponent.OpenActionRegistration.class); |
115 |
TopComponent.OpenActionRegistration reg = e.getAnnotation(TopComponent.OpenActionRegistration.class); |