1 19 20 package org.netbeans.core; 21 22 import java.io.IOException ; 23 import javax.swing.event.ChangeEvent ; 24 import javax.swing.event.ChangeListener ; 25 import org.netbeans.core.startup.ModuleSystem; 26 import org.openide.awt.StatusDisplayer; 27 import org.openide.filesystems.FileSystem; 28 import org.openide.filesystems.Repository; 29 30 35 public class Plain extends NbTopManager implements Runnable , ChangeListener { 36 37 private final StatusDisplayer status; 38 39 40 public Plain() { 41 if (Boolean.getBoolean("org.netbeans.core.Plain.CULPRIT")) Thread.dumpStack(); status = StatusDisplayer.getDefault(); 43 status.addChangeListener(this); 44 } 45 46 private ModuleSystem moduleSystem; 47 48 49 53 public boolean isInteractive (int il) { 54 return (IL_WINDOWS & il) == IL_WINDOWS; 55 } 56 57 59 public void notifyException (Throwable t) { 60 t.printStackTrace(); 61 } 62 63 64 public Object notify (org.openide.NotifyDescriptor nd) { 65 new Exception ("TopManager.notify()").printStackTrace(); System.out.println("MSG = " + nd.getMessage()); Object [] options = nd.getOptions(); 68 System.out.print("("); for(int i = 0; i < options.length; i++) { 70 if (i != 0) System.out.print(", "); System.out.print(options[i]); 72 } 73 System.out.println(")"); return new Object (); 75 } 76 77 78 protected ModuleSystem createModuleSystem() throws IOException { 79 FileSystem fs = Repository.getDefault().getDefaultFileSystem(); 80 return new ModuleSystem(fs); 81 } 82 83 85 public void run() { 86 try { 87 moduleSystem = createModuleSystem(); 88 } catch (IOException ioe) { 89 notifyException(ioe); 90 return; 91 } 92 moduleSystem.loadBootModules(); 93 if (!Repository.getDefault().getDefaultFileSystem().isReadOnly()) { 94 moduleSystem.readList(); 95 moduleSystem.restore(); 96 LoaderPoolNode.installationFinished(); 97 } else { 98 LoaderPoolNode.installationFinished(); 99 } 100 } 101 102 103 public ModuleSystem getModuleSystem() { 104 return moduleSystem; 105 } 106 107 public void stateChanged(ChangeEvent e) { 108 System.out.println(status.getStatusText()); 109 } 110 111 } 112 | Popular Tags |