Eclipse Catalog Templates

Is there a way in Eclipse to create a directory template so that every time someone creates a folder at a certain position in the file system, a subdirectory is automatically created under it?

For example, if I have a MyProject project:

MyProject

--src

--properties

     --plugins

Anytime someone creates a folder under "plugins", I want to generate a subdirectory "folderA, folderB, folderC", so all they need to do is create a folder under the plugins (i.e. myFolder), and this is generated:

MyProject

--src

--properties

     --plugins
        -- myFolder
           --folderA
           --folderB
           --folderC
+3
source share
2 answers

You can create a new Eclipse plugin that registers a listener for resource changes in the workspace. From these change notifications, you can find out if the user creates a specific folder.

eclipse.org :

IResourceChangeListener, , , , .

snipet,

   IWorkspace workspace = ResourcesPlugin.getWorkspace();
   IResourceChangeListener listener = new IResourceChangeListener() {
      public void resourceChanged(IResourceChangeEvent event) {
         System.out.println("Something changed!");
      }
   };
   workspace.addResourceChangeListener(listener);

eclipse, :

eclipse.org/articles/Article-Your%20First%20Plug-in/YourFirstPlugin.html

+1

, , :

(ant, program) ( ). , .

+1

Source: https://habr.com/ru/post/1785046/


All Articles