1 19 20 package org.openide; 21 22 import org.openide.util.Lookup; 23 24 28 public abstract class LifecycleManager { 29 30 protected LifecycleManager() { 31 } 32 33 44 public static LifecycleManager getDefault() { 45 LifecycleManager lm = Lookup.getDefault().lookup(LifecycleManager.class); 46 47 if (lm == null) { 48 lm = new Trivial(); 49 } 50 51 return lm; 52 } 53 54 56 public abstract void saveAll(); 57 58 62 public abstract void exit(); 63 64 65 private static final class Trivial extends LifecycleManager { 66 public Trivial() { 67 } 68 69 public void exit() { 70 System.exit(0); 71 } 72 73 public void saveAll() { 74 } 75 } 76 } 77 | Popular Tags |