use of org.eclipse.sapphire.modeling.annotations.FileExtensions in project liferay-ide by liferay.
the class LiferayScriptPossibleValuesService method compute.
@Override
protected void compute(Set<String> values) {
Element modeElement = context(Element.class);
List<FileExtensions> exts = modeElement.parent().definition().getAnnotations(FileExtensions.class);
if ((exts != null) && (exts.size() > 0)) {
this.type = exts.get(0).expr();
IProject project = modeElement.adapt(IProject.class);
if (project != null) {
IFolder webappRoot = CoreUtil.getDefaultDocrootFolder(project);
if (webappRoot != null) {
IPath location = webappRoot.getLocation();
if (location != null) {
if (location.toFile().exists()) {
values.addAll(new PropertiesVisitor().visitScriptFiles(webappRoot, type, values));
}
}
}
}
}
}
Aggregations