Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Every script file directly in the project directory is listed.

  • Loading branch information...
commit 89566f8a61a0eb87fbfe2d960b53a8b7e52127d3 1 parent 073d82f
Attila Kelemen authored
29 src/org/netbeans/gradle/project/view/GradleProjectChildFactory.java
View
@@ -2,9 +2,12 @@
import java.awt.Image;
import java.io.File;
+import java.text.Collator;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
-import java.util.logging.Logger;
import javax.swing.Action;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@@ -33,7 +36,7 @@
public final class GradleProjectChildFactory
extends
ChildFactory.Detachable<SingleNodeFactory> {
- private static final Logger LOGGER = Logger.getLogger(GradleProjectChildFactory.class.getName());
+ private static final Collator STR_CMP = Collator.getInstance();
private final NbGradleProject project;
private final AtomicReference<Runnable> cleanupTaskRef;
@@ -146,6 +149,28 @@ private void addProjectFiles(List<SingleNodeFactory> toPopulate) throws DataObje
if (settingsGradle != null) {
addGradleFile(settingsGradle, toPopulate);
}
+
+ List<FileObject> gradleFiles = new LinkedList<FileObject>();
+ for (FileObject file: project.getProjectDirectory().getChildren()) {
+ if (file.equals(buildGradle) || file.equals(settingsGradle)) {
+ continue;
+ }
+
+ if ("gradle".equalsIgnoreCase(file.getExt())) {
+ gradleFiles.add(file);
+ }
+ }
+
+ Collections.sort(gradleFiles, new Comparator<FileObject>() {
+ @Override
+ public int compare(FileObject o1, FileObject o2) {
+ return STR_CMP.compare(o1.getNameExt(), o2.getNameExt());
+ }
+ });
+
+ for (FileObject file: gradleFiles) {
+ addGradleFile(file, toPopulate);
+ }
}
private Node createSimpleNode() {
Please sign in to comment.
Something went wrong with that request. Please try again.