1 19 20 package org.netbeans.modules.apisupport.project.ui.customizer; 21 22 import java.io.IOException ; 23 import org.netbeans.api.project.Project; 24 import org.netbeans.modules.apisupport.project.NbModuleProject; 25 import org.netbeans.modules.apisupport.project.spi.NbModuleProvider; 26 import org.netbeans.modules.apisupport.project.SuiteProvider; 27 import org.netbeans.modules.apisupport.project.Util; 28 import org.netbeans.modules.apisupport.project.universe.LocalizedBundleInfo; 29 import org.netbeans.spi.project.support.ant.AntProjectHelper; 30 import org.netbeans.spi.project.support.ant.PropertyEvaluator; 31 import org.openide.util.Lookup; 32 import org.openide.util.lookup.Lookups; 33 34 39 public final class CustomizerProviderImpl extends BasicCustomizer { 40 41 static final String CATEGORY_SOURCES = "Sources"; static final String CATEGORY_DISPLAY = "Display"; static final String CATEGORY_LIBRARIES = "Libraries"; public static final String CATEGORY_VERSIONING = "Versioning"; public static final String SUBCATEGORY_VERSIONING_PUBLIC_PACKAGES = "publicPackages"; static final String CATEGORY_BUILD = "Build"; static final String CATEGORY_COMPILING = "Compiling"; static final String CATEGORY_PACKAGING = "Packaging"; 51 private final AntProjectHelper helper; 52 private final PropertyEvaluator evaluator; 53 54 private SingleModuleProperties moduleProps; 55 56 public CustomizerProviderImpl(final Project project, final AntProjectHelper helper, 57 final PropertyEvaluator evaluator) { 58 super(project, "Projects/org-netbeans-modules-apisupport-project/Customizer"); 59 this.helper = helper; 60 this.evaluator = evaluator; 61 } 62 63 void storeProperties() throws IOException { 64 moduleProps.triggerLazyStorages(); 65 moduleProps.storeProperties(); 66 } 67 68 void postSave() throws IOException { 69 if (moduleProps.isModuleListRefreshNeeded()) { 70 moduleProps.getModuleList().refresh(); 71 moduleProps.setModuleListRefreshNeeded(false); 72 } 73 } 74 75 void dialogCleanup() { 76 moduleProps = null; 77 } 78 79 protected Lookup prepareData() { 80 Lookup lookup = getProject().getLookup(); 81 SuiteProvider sp = (SuiteProvider) lookup.lookup(SuiteProvider.class); 82 NbModuleProvider.NbModuleType type = Util.getModuleType((NbModuleProject) getProject()); 83 moduleProps = new SingleModuleProperties(helper, evaluator, sp, type, 84 (LocalizedBundleInfo.Provider) lookup.lookup(LocalizedBundleInfo.Provider.class)); 85 return Lookups.fixed(moduleProps, getProject()); 86 } 87 } 88 | Popular Tags |