From 6223888391be11b735878be0e2450b46f1170ff6 Mon Sep 17 00:00:00 2001 From: Yserz Date: Mon, 23 Mar 2015 23:49:24 +0100 Subject: [PATCH 1/2] Fixed issue #43 & cleanup --- .../nbeditorconfig/config/Settings.java | 1 + .../hook/EditorConfigProjectOpenedHook.java | 75 ------------------- .../listener/EditorConfigChangeListener.java | 45 +++++++---- .../listener/FileChangeListener.java | 46 ++++++------ .../listener/ListenerAttacher.java | 50 +++++++++++++ .../listener/ProjectChangeListener.java | 48 ++++++------ .../ProjectHookLookup.java} | 12 ++- .../listener/ProjectOpenCloseListener.java | 39 ++++++++++ 8 files changed, 177 insertions(+), 139 deletions(-) delete mode 100644 src/main/java/com/welovecoding/nbeditorconfig/hook/EditorConfigProjectOpenedHook.java create mode 100644 src/main/java/com/welovecoding/nbeditorconfig/listener/ListenerAttacher.java rename src/main/java/com/welovecoding/nbeditorconfig/{hook/EditorConfigHookLookup.java => listener/ProjectHookLookup.java} (79%) create mode 100644 src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectOpenCloseListener.java diff --git a/src/main/java/com/welovecoding/nbeditorconfig/config/Settings.java b/src/main/java/com/welovecoding/nbeditorconfig/config/Settings.java index 77ddcb5..bf62cec 100644 --- a/src/main/java/com/welovecoding/nbeditorconfig/config/Settings.java +++ b/src/main/java/com/welovecoding/nbeditorconfig/config/Settings.java @@ -5,6 +5,7 @@ public final class Settings { public static final String MIME_TYPE = "text/x-editorconfig"; // NOI18N + public static final String EXTENSION = "editorconfig"; // NOI18N public static final String RESOURCE_PATH = "com/welovecoding/nbeditorconfig"; // NOI18N @StaticResource diff --git a/src/main/java/com/welovecoding/nbeditorconfig/hook/EditorConfigProjectOpenedHook.java b/src/main/java/com/welovecoding/nbeditorconfig/hook/EditorConfigProjectOpenedHook.java deleted file mode 100644 index 6fe3cc8..0000000 --- a/src/main/java/com/welovecoding/nbeditorconfig/hook/EditorConfigProjectOpenedHook.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.welovecoding.nbeditorconfig.hook; - -import com.welovecoding.nbeditorconfig.listener.EditorConfigChangeListener; -import com.welovecoding.nbeditorconfig.listener.ProjectChangeListener; -import com.welovecoding.nbeditorconfig.processor.SmartSkip; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.netbeans.api.project.Project; -import org.netbeans.spi.project.ui.ProjectOpenedHook; -import org.openide.filesystems.FileObject; - -public class EditorConfigProjectOpenedHook extends ProjectOpenedHook { - - private static final Logger LOG = Logger.getLogger(EditorConfigProjectOpenedHook.class.getSimpleName()); - private final Map editorConfigListeners = new HashMap<>(); - private Project project; - private ProjectChangeListener rootListener; - - public EditorConfigProjectOpenedHook() { - super(); - } - - public EditorConfigProjectOpenedHook(Project project) { - this(); - this.project = project; - } - - @Override - protected void projectOpened() { - FileObject projectFileObject = project.getProjectDirectory(); - LOG.log(Level.INFO, "Opened project: {0}", projectFileObject.getName()); - attachListeners(projectFileObject, project); - } - - @Override - protected void projectClosed() { - LOG.log(Level.INFO, "Closed project: {0}", project.getProjectDirectory().getName()); - } - - /** - * Recursively attach listeners to folders containing a .editorconfig file. - * - * @param root - * @param project - */ - private void attachListeners(FileObject root, Project project) { - if (project.getProjectDirectory().equals(root)) { - rootListener = new ProjectChangeListener(project); - root.addRecursiveListener(rootListener); - } - - for (FileObject file : root.getChildren()) { - if (file.getName().equals(".editorconfig")) { - attachEditorConfigChangeListener(project, file); - LOG.log(Level.INFO, "\u00ac Found EditorConfig: {0}", file.getPath()); - } else if (file.isFolder()) { - if (SmartSkip.skipDirectory(file)) { - LOG.log(Level.INFO, "\u00ac Skipped directory: {0}", file.getPath()); - } else { - attachListeners(file, project); - LOG.log(Level.INFO, "\u00ac Attached ProjectChangeListener: {0}", file.getPath()); - } - } - } - } - - private void attachEditorConfigChangeListener(Project project, FileObject editorConfigFileObject) { - EditorConfigChangeListener listener = new EditorConfigChangeListener(project, editorConfigFileObject); - editorConfigFileObject.addFileChangeListener(listener); - editorConfigListeners.put(editorConfigFileObject, listener); - } - -} diff --git a/src/main/java/com/welovecoding/nbeditorconfig/listener/EditorConfigChangeListener.java b/src/main/java/com/welovecoding/nbeditorconfig/listener/EditorConfigChangeListener.java index 4e5243d..bec3956 100644 --- a/src/main/java/com/welovecoding/nbeditorconfig/listener/EditorConfigChangeListener.java +++ b/src/main/java/com/welovecoding/nbeditorconfig/listener/EditorConfigChangeListener.java @@ -11,7 +11,10 @@ import org.openide.filesystems.FileRenameEvent; /** - * http://bits.netbeans.org/dev/javadoc/ + * This kind of listener is attached to editorconfig files within a project. + * When this listener is attached to an editorconfig a FileChangeListener will + * be attached to all files in the folder with the editorconfig and subsequent + * ones. http://bits.netbeans.org/dev/javadoc/ */ public class EditorConfigChangeListener extends FileChangeAdapter { @@ -20,6 +23,10 @@ public class EditorConfigChangeListener extends FileChangeAdapter { private final FileObject editorConfigFileObject; private final FileChangeListener subsequentFilesListener; + static { + LOG.setLevel(Level.INFO); + } + public EditorConfigChangeListener(Project project, FileObject editorConfigFileObject) { this.project = project; this.editorConfigFileObject = editorConfigFileObject; @@ -27,26 +34,17 @@ public EditorConfigChangeListener(Project project, FileObject editorConfigFileOb LOG.log(Level.INFO, "Attached EditorConfigChangeListener to: {0}", editorConfigFileObject.getPath()); this.subsequentFilesListener = new FileChangeListener(project, editorConfigFileObject); editorConfigFileObject.getParent().addRecursiveListener(subsequentFilesListener); - } - @Override - public void fileAttributeChanged(FileAttributeEvent event) { - super.fileAttributeChanged(event); - LOG.log(Level.INFO, "Attribute changed: {0}", event.getFile().getPath()); - } - - @Override - public void fileRenamed(FileRenameEvent event) { - super.fileRenamed(event); - LOG.log(Level.INFO, "Renamed file: {0}", event.getFile().getPath()); + // immediately apply editorconfig + propagateChanges(); } @Override public void fileDeleted(FileEvent event) { super.fileDeleted(event); LOG.log(Level.INFO, "Deleted file: {0}", event.getFile().getPath()); - //TODO processDeletedEditorConfig - //TODO processDeletedFolderWhichMayContainsFoldersWithListeners -> remove them + event.getFile().getParent().removeRecursiveListener(subsequentFilesListener); + event.getFile().removeFileChangeListener(this); } @Override @@ -54,6 +52,10 @@ public void fileChanged(FileEvent event) { super.fileChanged(event); LOG.log(Level.INFO, "EditorConfigs content changed: {0}", event.getFile().getPath()); + propagateChanges(); + } + + private void propagateChanges() { for (FileObject fo : Collections.list(editorConfigFileObject.getParent().getChildren(true))) { LOG.log(Level.INFO, "Updating subsequent file: {0}", fo.getPath()); subsequentFilesListener.fileChanged(new FileEvent(fo)); @@ -63,7 +65,7 @@ public void fileChanged(FileEvent event) { @Override public void fileFolderCreated(FileEvent event) { super.fileFolderCreated(event); - LOG.log(Level.INFO, "Created folder: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "Created folder: {0}", event.getFile().getPath()); //TODO search for editor-configs and attach listeners } @@ -76,7 +78,18 @@ public void fileFolderCreated(FileEvent event) { @Override public void fileDataCreated(FileEvent event) { super.fileDataCreated(event); - LOG.log(Level.INFO, "fileDataCreated: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "fileDataCreated: {0}", event.getFile().getPath()); } + @Override + public void fileAttributeChanged(FileAttributeEvent event) { + super.fileAttributeChanged(event); + LOG.log(Level.FINE, "Attribute changed: {0}", event.getFile().getPath()); + } + + @Override + public void fileRenamed(FileRenameEvent event) { + super.fileRenamed(event); + LOG.log(Level.FINE, "Renamed file: {0}", event.getFile().getPath()); + } } diff --git a/src/main/java/com/welovecoding/nbeditorconfig/listener/FileChangeListener.java b/src/main/java/com/welovecoding/nbeditorconfig/listener/FileChangeListener.java index dc0cd66..dd38698 100644 --- a/src/main/java/com/welovecoding/nbeditorconfig/listener/FileChangeListener.java +++ b/src/main/java/com/welovecoding/nbeditorconfig/listener/FileChangeListener.java @@ -21,30 +21,23 @@ public class FileChangeListener extends FileChangeAdapter { private static final Logger LOG = Logger.getLogger(FileChangeListener.class.getSimpleName()); private final Project project; + private final FileObject editorConfigFileObject; - public FileChangeListener(Project project, FileObject editorConfigFileObject) { - this.project = project; - LOG.log(Level.INFO, "Attached FileChangeListener to: {0}", editorConfigFileObject.getParent().getPath()); + static { + LOG.setLevel(Level.INFO); } - @Override - public void fileAttributeChanged(FileAttributeEvent event) { - super.fileAttributeChanged(event); - LOG.log(Level.INFO, "Attribute changed: {0}", event.getFile().getPath()); - } - - @Override - public void fileRenamed(FileRenameEvent event) { - super.fileRenamed(event); - LOG.log(Level.INFO, "Renamed file: {0}", event.getFile().getPath()); + public FileChangeListener(Project project, FileObject editorConfigFileObject) { + this.project = project; + this.editorConfigFileObject = editorConfigFileObject; + LOG.log(Level.INFO, "[EC for {0}] Attached FileChangeListener to: {1}", new Object[]{editorConfigFileObject.getPath(), editorConfigFileObject.getParent().getPath()}); } @Override public void fileDeleted(FileEvent event) { super.fileDeleted(event); - LOG.log(Level.INFO, "Deleted file: {0}", event.getFile().getPath()); - //TODO processDeletedEditorConfig - //TODO processDeletedFolderWhichMayContainsFoldersWithListeners -> remove them + LOG.log(Level.INFO, "[EC for {0}] Deleted file: {1}", new Object[]{editorConfigFileObject.getPath(), event.getFile().getPath()}); + event.getFile().removeRecursiveListener(this); } @Override @@ -52,7 +45,7 @@ public void fileChanged(FileEvent event) { super.fileChanged(event); String path = event.getFile().getPath(); - LOG.log(Level.INFO, "File content changed: {0}", path); + LOG.log(Level.INFO, "[EC for {0}] File content changed: {1}", new Object[]{editorConfigFileObject.getPath(), path}); if (applyRulesToFile(event)) { try { @@ -63,7 +56,7 @@ public void fileChanged(FileEvent event) { Exceptions.printStackTrace(ex); } } else { - LOG.log(Level.INFO, "Rules will not be applied to: {0}", path); + LOG.log(Level.INFO, "[EC for {0}] Rules will not be applied to: {1}", new Object[]{editorConfigFileObject.getPath(), path}); } } @@ -85,7 +78,7 @@ private boolean applyRulesToFile(FileEvent event) { @Override public void fileFolderCreated(FileEvent event) { super.fileFolderCreated(event); - LOG.log(Level.INFO, "Created folder: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "[EC for {0}] Created folder: {1}", new Object[]{editorConfigFileObject.getPath(), event.getFile().getPath()}); //TODO search for editor-configs and attach listeners } @@ -99,8 +92,19 @@ public void fileFolderCreated(FileEvent event) { public void fileDataCreated(FileEvent event) { super.fileDataCreated(event); FileObject primaryFile = event.getFile(); - LOG.log(Level.INFO, "Added new file to project: {0} (MIME type: {1})", - new Object[]{primaryFile.getPath(), primaryFile.getMIMEType()}); + LOG.log(Level.FINE, "[EC for {0}] Added new file to project: {1} (MIME type: {2})", + new Object[]{editorConfigFileObject.getPath(), primaryFile.getPath(), primaryFile.getMIMEType()}); + } + + @Override + public void fileAttributeChanged(FileAttributeEvent event) { + super.fileAttributeChanged(event); + LOG.log(Level.FINE, "[EC for {0}] Attribute changed: {1}", new Object[]{editorConfigFileObject.getPath(), event.getFile().getPath()}); } + @Override + public void fileRenamed(FileRenameEvent event) { + super.fileRenamed(event); + LOG.log(Level.FINE, "[EC for {0}] Renamed file: {1}", new Object[]{editorConfigFileObject.getPath(), event.getFile().getPath()}); + } } diff --git a/src/main/java/com/welovecoding/nbeditorconfig/listener/ListenerAttacher.java b/src/main/java/com/welovecoding/nbeditorconfig/listener/ListenerAttacher.java new file mode 100644 index 0000000..f1ac248 --- /dev/null +++ b/src/main/java/com/welovecoding/nbeditorconfig/listener/ListenerAttacher.java @@ -0,0 +1,50 @@ +package com.welovecoding.nbeditorconfig.listener; + +import com.welovecoding.nbeditorconfig.config.Settings; +import com.welovecoding.nbeditorconfig.processor.SmartSkip; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.netbeans.api.project.Project; +import org.openide.filesystems.FileObject; + +/** + * + * @author Michael Koppen + */ +public class ListenerAttacher { + + private static final Logger LOG = Logger.getLogger(ListenerAttacher.class.getSimpleName()); + + static { + LOG.setLevel(Level.INFO); + } + + /** + * Recursively attach listeners to folders containing a .editorconfig file. + * + * @param root + * @param project + */ + public static void attachListeners(FileObject file, Project project) { + if (project.getProjectDirectory().equals(file)) { + file.addRecursiveListener(new ProjectChangeListener(project)); + } + + if (file.isFolder()) { + if (SmartSkip.skipDirectory(file)) { + LOG.log(Level.INFO, "\u00ac Skipped directory: {0}", file.getPath()); + } else { + for (FileObject subFile : file.getChildren()) { + attachListeners(subFile, project); + } + } + } else { + if (file.getExt().equals(Settings.EXTENSION)) { + file.addFileChangeListener(new EditorConfigChangeListener(project, file)); + LOG.log(Level.INFO, "\u00ac Found EditorConfig: {0}", file.getPath()); + } else { + LOG.log(Level.FINE, "\u00ac No EditorConfig Found: {0}", file.getPath()); + } + } + } +} diff --git a/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectChangeListener.java b/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectChangeListener.java index 12fc774..e11e484 100644 --- a/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectChangeListener.java +++ b/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectChangeListener.java @@ -17,53 +17,55 @@ public class ProjectChangeListener extends FileChangeAdapter { private final Project project; static { - LOG.setLevel(Level.OFF); + LOG.setLevel(Level.INFO); } public ProjectChangeListener(Project project) { this.project = project; } + @Override + public void fileFolderCreated(FileEvent event) { + super.fileFolderCreated(event); + LOG.log(Level.INFO, "PROJECTLISTENER: Created folder: {0}", event.getFile().getPath()); + ListenerAttacher.attachListeners(event.getFile(), project); + } + + /** + * Method is triggered when content has changed and it's possible to display + * content in NetBeans. Method is also triggered when project will be opened. + * + * @param event Event for listening on filesystem changes + */ + @Override + public void fileDataCreated(FileEvent event) { + super.fileDataCreated(event); + LOG.log(Level.INFO, "PROJECTLISTENER: fileDataCreated: {0}", event.getFile().getPath()); + ListenerAttacher.attachListeners(event.getFile(), project); + } + @Override public void fileAttributeChanged(FileAttributeEvent event) { super.fileAttributeChanged(event); - LOG.log(Level.INFO, "PROJECTLISTENER: Attribute changed: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "PROJECTLISTENER: Attribute changed: {0}", event.getFile().getPath()); } @Override public void fileRenamed(FileRenameEvent event) { super.fileRenamed(event); - LOG.log(Level.INFO, "PROJECTLISTENER: Renamed file: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "PROJECTLISTENER: Renamed file: {0}", event.getFile().getPath()); } @Override public void fileDeleted(FileEvent event) { super.fileDeleted(event); - LOG.log(Level.INFO, "PROJECTLISTENER: Deleted file: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "PROJECTLISTENER: Deleted file: {0}", event.getFile().getPath()); } @Override public void fileChanged(FileEvent event) { super.fileChanged(event); - LOG.log(Level.INFO, "PROJECTLISTENER: File content changed: {0}", event.getFile().getPath()); - } - - @Override - public void fileFolderCreated(FileEvent event) { - super.fileFolderCreated(event); - LOG.log(Level.INFO, "PROJECTLISTENER: Created folder: {0}", event.getFile().getPath()); - } - - /** - * Method is triggered when content has changed and it's possible to display - * content in NetBeans. Method is also triggered when project will be opened. - * - * @param event Event for listening on filesystem changes - */ - @Override - public void fileDataCreated(FileEvent event) { - super.fileDataCreated(event); - LOG.log(Level.INFO, "PROJECTLISTENER: fileDataCreated: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "PROJECTLISTENER: File content changed: {0}", event.getFile().getPath()); } } diff --git a/src/main/java/com/welovecoding/nbeditorconfig/hook/EditorConfigHookLookup.java b/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectHookLookup.java similarity index 79% rename from src/main/java/com/welovecoding/nbeditorconfig/hook/EditorConfigHookLookup.java rename to src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectHookLookup.java index c0ae5e7..f82edeb 100644 --- a/src/main/java/com/welovecoding/nbeditorconfig/hook/EditorConfigHookLookup.java +++ b/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectHookLookup.java @@ -1,4 +1,4 @@ -package com.welovecoding.nbeditorconfig.hook; +package com.welovecoding.nbeditorconfig.listener; import java.util.logging.Level; import java.util.logging.Logger; @@ -27,9 +27,13 @@ /** * Listener for newly opened Projects. */ -public class EditorConfigHookLookup implements LookupProvider { +public class ProjectHookLookup implements LookupProvider { - private static final Logger LOG = Logger.getLogger(EditorConfigHookLookup.class.getSimpleName()); + private static final Logger LOG = Logger.getLogger(ProjectHookLookup.class.getSimpleName()); + + static { + LOG.setLevel(Level.INFO); + } @Override public Lookup createAdditionalLookup(Lookup lookup) { @@ -38,7 +42,7 @@ public Lookup createAdditionalLookup(Lookup lookup) { LOG.log(Level.INFO, "Setup hooks for: {0}", projectName); - return Lookups.fixed(new EditorConfigProjectOpenedHook(project)); + return Lookups.fixed(new ProjectOpenCloseListener(project)); } } diff --git a/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectOpenCloseListener.java b/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectOpenCloseListener.java new file mode 100644 index 0000000..ab943a4 --- /dev/null +++ b/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectOpenCloseListener.java @@ -0,0 +1,39 @@ +package com.welovecoding.nbeditorconfig.listener; + +import java.util.logging.Level; +import java.util.logging.Logger; +import org.netbeans.api.project.Project; +import org.netbeans.spi.project.ui.ProjectOpenedHook; +import org.openide.filesystems.FileObject; + +public class ProjectOpenCloseListener extends ProjectOpenedHook { + + private static final Logger LOG = Logger.getLogger(ProjectOpenCloseListener.class.getSimpleName()); + private Project project; + + static { + LOG.setLevel(Level.INFO); + } + + public ProjectOpenCloseListener() { + super(); + } + + public ProjectOpenCloseListener(Project project) { + this(); + this.project = project; + } + + @Override + protected void projectOpened() { + FileObject projectFileObject = project.getProjectDirectory(); + LOG.log(Level.INFO, "Opened project: {0}", projectFileObject.getName()); + ListenerAttacher.attachListeners(projectFileObject, project); + } + + @Override + protected void projectClosed() { + LOG.log(Level.FINE, "Closed project: {0}", project.getProjectDirectory().getName()); + } + +} From 3311cf29fee9ba1a3f20f02200d701c756341239 Mon Sep 17 00:00:00 2001 From: Yserz Date: Tue, 24 Mar 2015 15:52:00 +0100 Subject: [PATCH 2/2] improved javadoc aligned logger statements --- .../nbeditorconfig/listener/ListenerAttacher.java | 12 ++++-------- .../listener/ProjectChangeListener.java | 12 ++++++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/welovecoding/nbeditorconfig/listener/ListenerAttacher.java b/src/main/java/com/welovecoding/nbeditorconfig/listener/ListenerAttacher.java index f1ac248..e4548ad 100644 --- a/src/main/java/com/welovecoding/nbeditorconfig/listener/ListenerAttacher.java +++ b/src/main/java/com/welovecoding/nbeditorconfig/listener/ListenerAttacher.java @@ -7,10 +7,6 @@ import org.netbeans.api.project.Project; import org.openide.filesystems.FileObject; -/** - * - * @author Michael Koppen - */ public class ListenerAttacher { private static final Logger LOG = Logger.getLogger(ListenerAttacher.class.getSimpleName()); @@ -22,8 +18,8 @@ public class ListenerAttacher { /** * Recursively attach listeners to folders containing a .editorconfig file. * - * @param root - * @param project + * @param file file or folder to attach listener + * @param project the project the file is related to */ public static void attachListeners(FileObject file, Project project) { if (project.getProjectDirectory().equals(file)) { @@ -34,8 +30,8 @@ public static void attachListeners(FileObject file, Project project) { if (SmartSkip.skipDirectory(file)) { LOG.log(Level.INFO, "\u00ac Skipped directory: {0}", file.getPath()); } else { - for (FileObject subFile : file.getChildren()) { - attachListeners(subFile, project); + for (FileObject child : file.getChildren()) { + attachListeners(child, project); } } } else { diff --git a/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectChangeListener.java b/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectChangeListener.java index e11e484..8a9666b 100644 --- a/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectChangeListener.java +++ b/src/main/java/com/welovecoding/nbeditorconfig/listener/ProjectChangeListener.java @@ -27,7 +27,7 @@ public ProjectChangeListener(Project project) { @Override public void fileFolderCreated(FileEvent event) { super.fileFolderCreated(event); - LOG.log(Level.INFO, "PROJECTLISTENER: Created folder: {0}", event.getFile().getPath()); + LOG.log(Level.INFO, "Created folder: {0}", event.getFile().getPath()); ListenerAttacher.attachListeners(event.getFile(), project); } @@ -40,32 +40,32 @@ public void fileFolderCreated(FileEvent event) { @Override public void fileDataCreated(FileEvent event) { super.fileDataCreated(event); - LOG.log(Level.INFO, "PROJECTLISTENER: fileDataCreated: {0}", event.getFile().getPath()); + LOG.log(Level.INFO, "fileDataCreated: {0}", event.getFile().getPath()); ListenerAttacher.attachListeners(event.getFile(), project); } @Override public void fileAttributeChanged(FileAttributeEvent event) { super.fileAttributeChanged(event); - LOG.log(Level.FINE, "PROJECTLISTENER: Attribute changed: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "Attribute changed: {0}", event.getFile().getPath()); } @Override public void fileRenamed(FileRenameEvent event) { super.fileRenamed(event); - LOG.log(Level.FINE, "PROJECTLISTENER: Renamed file: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "Renamed file: {0}", event.getFile().getPath()); } @Override public void fileDeleted(FileEvent event) { super.fileDeleted(event); - LOG.log(Level.FINE, "PROJECTLISTENER: Deleted file: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "Deleted file: {0}", event.getFile().getPath()); } @Override public void fileChanged(FileEvent event) { super.fileChanged(event); - LOG.log(Level.FINE, "PROJECTLISTENER: File content changed: {0}", event.getFile().getPath()); + LOG.log(Level.FINE, "File content changed: {0}", event.getFile().getPath()); } }