private Sources initSources() { SourcesHelper sourcesHelper = new SourcesHelper(project, helper, evaluator); sourcesHelper.sourceRoot("${" + ClientSideProjectConstants.PROJECT_SITE_ROOT_FOLDER + "}") //NOI18N .displayName(org.openide.util.NbBundle.getMessage(ClientSideProjectSources.class, "SITE_ROOT")) .add() // adding as principal root, continuing configuration .type(WebClientProjectConstants.SOURCES_TYPE_HTML5).add(); // adding as typed root sourcesHelper.sourceRoot("${" + ClientSideProjectConstants.PROJECT_TEST_FOLDER + "}") //NOI18N .displayName(org.openide.util.NbBundle.getMessage(ClientSideProjectSources.class, "UNIT_TESTS")) .add() // adding as principal root, continuing configuration .type(WebClientProjectConstants.SOURCES_TYPE_HTML5_TEST).add(); // adding as typed root sourcesHelper.registerExternalRoots(FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT); return sourcesHelper.createSources(); }
private void register(SourcesHelper sourcesHelper, SourceRoots roots) { String[] propNames = roots.getRootProperties(); String[] rootNames = roots.getRootNames(); for (int i = 0; i < propNames.length; i++) { String prop = propNames[i]; String displayName = roots.getRootDisplayName(rootNames[i], prop); String loc = "${" + prop + "}"; // NOI18N sourcesHelper.sourceRoot(loc).displayName(displayName) .add() // adding as principal root, continuing configuration .type(SOURCES_TYPE_PHP).add(); // adding as typed root } }