1 19 20 package org.netbeans.modules.apisupport.project; 21 22 import java.io.File ; 23 import java.io.IOException ; 24 import org.netbeans.api.project.ProjectManager; 25 import org.netbeans.modules.apisupport.project.universe.NbPlatform; 26 import org.netbeans.spi.project.support.ant.EditableProperties; 27 import org.netbeans.spi.project.support.ant.PropertyUtils; 28 import org.openide.ErrorManager; 29 import org.openide.modules.ModuleInstall; 30 import org.openide.util.Mutex; 31 32 36 public final class Install extends ModuleInstall { 37 38 public void restored() { 39 final File install = NbPlatform.defaultPlatformLocation(); 40 if (install != null) { 41 ProjectManager.mutex().writeAccess(new Mutex.Action() { 42 public Object run() { 43 EditableProperties p = PropertyUtils.getGlobalProperties(); 44 String installS = install.getAbsolutePath(); 45 p.setProperty("nbplatform.default.netbeans.dest.dir", installS); if (!p.containsKey("nbplatform.default.harness.dir")) { p.setProperty("nbplatform.default.harness.dir", "${nbplatform.default.netbeans.dest.dir}/harness"); } 49 try { 50 PropertyUtils.putGlobalProperties(p); 51 } catch (IOException e) { 52 Util.err.notify(ErrorManager.INFORMATIONAL, e); 53 } 54 return null; 55 } 56 }); 57 } 58 } 59 60 } 61 | Popular Tags |