Lines 113-127
Link Here
|
113 |
} |
113 |
} |
114 |
|
114 |
|
115 |
private void checkCodeNameBase() { |
115 |
private void checkCodeNameBase() { |
116 |
if (!Util.isValidJavaFQN(getCodeNameBaseValue())) { |
116 |
String dotName = getCodeNameBaseValue(); |
|
|
117 |
if (!Util.isValidJavaFQN(dotName)) { |
117 |
setError(getMessage("MSG_InvalidCNB")); |
118 |
setError(getMessage("MSG_InvalidCNB")); |
118 |
} else if (getData().isSuiteComponent() && cnbIsAlreadyInSuite(getData().getSuiteRoot(), getCodeNameBaseValue())) { |
119 |
} else if (getData().isSuiteComponent() && cnbIsAlreadyInSuite(getData().getSuiteRoot(), dotName)) { |
119 |
setError(NbBundle.getMessage(BasicConfVisualPanel.class, "MSG_ComponentWithSuchCNBAlreadyInSuite", |
120 |
setError(NbBundle.getMessage(BasicConfVisualPanel.class, "MSG_ComponentWithSuchCNBAlreadyInSuite", dotName)); |
120 |
getCodeNameBaseValue())); |
|
|
121 |
} else { |
121 |
} else { |
122 |
markValid(); |
122 |
markValid(); |
123 |
// update layer and bundle from the cnb |
123 |
// update layer and bundle from the cnb |
124 |
String dotName = getCodeNameBaseValue(); |
|
|
125 |
String slashName = dotName.replace('.', '/'); |
124 |
String slashName = dotName.replace('.', '/'); |
126 |
if (!wasBundleUpdated) { |
125 |
if (!wasBundleUpdated) { |
127 |
bundleValue.setText(slashName + "/Bundle.properties"); // NOI18N |
126 |
bundleValue.setText(slashName + "/Bundle.properties"); // NOI18N |
Lines 131-137
Link Here
|
131 |
layerValue.setText(slashName + "/layer.xml"); // NOI18N |
130 |
layerValue.setText(slashName + "/layer.xml"); // NOI18N |
132 |
wasLayerUpdated = false; |
131 |
wasLayerUpdated = false; |
133 |
} |
132 |
} |
|
|
133 |
if (getData().isNetBeansOrg()) { |
134 |
File repo = new File(getData().getProjectLocation()); |
135 |
// Check if this is in the post-Hg layout. |
136 |
if (new File(repo, "openide.util").isDirectory() || new File(repo, "core.registry").isDirectory()) { |
137 |
// Ensure that official naming conventions are respected. |
138 |
String cnbShort = abbreviate(dotName); |
139 |
String name = getData().getProjectName(); |
140 |
if (!name.equals(cnbShort)) { |
141 |
setError(NbBundle.getMessage(BasicConfVisualPanel.class, "BasicConfVisualPanel_err_wrong_nborg_name", cnbShort)); |
142 |
} |
143 |
} |
144 |
} |
134 |
} |
145 |
} |
|
|
146 |
} |
147 |
private static String abbreviate(String cnb) { |
148 |
return cnb.replaceFirst("^org\\.netbeans\\.modules\\.", ""). // NOI18N |
149 |
replaceFirst("^org\\.netbeans\\.(libs|lib|api|spi|core)\\.", "$1."). // NOI18N |
150 |
replaceFirst("^org\\.netbeans\\.", "o.n."). // NOI18N |
151 |
replaceFirst("^org\\.openide\\.", "openide."). // NOI18N |
152 |
replaceFirst("^org\\.", "o."). // NOI18N |
153 |
replaceFirst("^com\\.sun\\.", "c.s."). // NOI18N |
154 |
replaceFirst("^com\\.", "c."); // NOI18N |
135 |
} |
155 |
} |
136 |
|
156 |
|
137 |
private void checkBundle() { |
157 |
private void checkBundle() { |