×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Gian James
Added: Sep 21, 2015 6:42 PM
Views: 13
Tags: no tags
NB Platform IDE Project Factory skeleton
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package org.convoluted.project.droid;
  7. import java.io.IOException;
  8. import org.netbeans.api.project.Project;
  9. import org.netbeans.spi.project.ProjectFactory;
  10. import org.netbeans.spi.project.ProjectState;
  11. import org.openide.filesystems.FileObject;
  12. import org.openide.util.lookup.ServiceProvider;
  13.  
  14. @ServiceProvider(service=ProjectFactory.class)
  15.  
  16. /**
  17.  *
  18.  * @author bjames
  19.  */
  20. public class DroidProjectFactory implements ProjectFactory {
  21.    
  22.     public static final String PROJECT_FILE = "droid.bcsproj";
  23.    
  24.     @Override
  25.     public boolean isProject(FileObject projectDirectory) {
  26.         return projectDirectory.getFileObject(PROJECT_FILE) != null;
  27.     }
  28.    
  29.     @Override
  30.     public Project loadProject(FileObject dir, ProjectState state) throws IOException {
  31.         return isProject(dir) ? new DroidProject(dir,state) : null;
  32.     }
  33.    
  34.     @Override
  35.     public void saveProject(final Project project) throws IOException, ClassCastException {
  36.         //
  37.     }
  38.    
  39. }
  40.