use of org.jetbrains.jps.model.java.JavaResourceRootProperties in project intellij-community by JetBrains.
the class JavaProjectRootsUtil method isForGeneratedSources.
public static boolean isForGeneratedSources(SourceFolder sourceFolder) {
JavaSourceRootProperties properties = sourceFolder.getJpsElement().getProperties(JavaModuleSourceRootTypes.SOURCES);
JavaResourceRootProperties resourceProperties = sourceFolder.getJpsElement().getProperties(JavaModuleSourceRootTypes.RESOURCES);
return properties != null && properties.isForGeneratedSources() || resourceProperties != null && resourceProperties.isForGeneratedSources();
}
use of org.jetbrains.jps.model.java.JavaResourceRootProperties in project intellij-community by JetBrains.
the class JavaResourceRootEditHandlerBase method createPropertiesEditor.
@Nullable
@Override
public JComponent createPropertiesEditor(@NotNull final SourceFolder folder, @NotNull final JComponent parentComponent, @NotNull final ContentRootPanel.ActionCallback callback) {
final IconActionComponent iconComponent = new IconActionComponent(AllIcons.Modules.SetPackagePrefix, AllIcons.Modules.SetPackagePrefixRollover, ProjectBundle.message("module.paths.edit.properties.tooltip"), () -> {
JavaResourceRootProperties properties = folder.getJpsElement().getProperties(JavaModuleSourceRootTypes.RESOURCES);
assert properties != null;
ResourceRootPropertiesDialog dialog = new ResourceRootPropertiesDialog(parentComponent, properties);
if (dialog.showAndGet()) {
callback.onSourceRootPropertiesChanged(folder);
}
});
final JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(false);
panel.add(iconComponent, BorderLayout.CENTER);
panel.add(Box.createHorizontalStrut(3), BorderLayout.EAST);
return panel;
}
use of org.jetbrains.jps.model.java.JavaResourceRootProperties in project intellij-community by JetBrains.
the class ContentEntryTreeCellRenderer method getPresentablePrefix.
private static String getPresentablePrefix(final ContentEntry entry, final VirtualFile file) {
for (final SourceFolder sourceFolder : entry.getSourceFolders()) {
if (file.equals(sourceFolder.getFile())) {
JpsModuleSourceRoot element = sourceFolder.getJpsElement();
JavaSourceRootProperties properties = element.getProperties(JavaModuleSourceRootTypes.SOURCES);
if (properties != null)
return properties.getPackagePrefix();
JavaResourceRootProperties resourceRootProperties = element.getProperties(JavaModuleSourceRootTypes.RESOURCES);
if (resourceRootProperties != null)
return resourceRootProperties.getRelativeOutputPath();
}
}
return "";
}
Aggregations