1 6 7 package org.netbeans.modules.logger.listeners; 8 9 13 14 import org.openide.windows.Mode; 15 import org.openide.windows.WindowManager; 16 import java.beans.*; 17 import java.io.*; 18 19 public class WMPropertyListener extends ListenerTools implements PropertyChangeListener{ 20 21 22 public WMPropertyListener() throws IOException{ 23 super("WM"); 24 } 25 26 public void propertyChange(PropertyChangeEvent evt) { 27 newBuffer(); 28 String evtPpty=evt.getPropertyName(); 29 append(System.currentTimeMillis()+"\t"+evtPpty); 30 if(evtPpty.equalsIgnoreCase("activeMode")){ 31 41 42 erase(); 44 } else if(evtPpty.equalsIgnoreCase("maximizedMode")){ 45 Mode m = (Mode)evt.getNewValue(); 46 if(m!=null) append(m.getName()); 47 else { 48 m = (Mode)evt.getOldValue(); 49 if(m!=null){ 50 append(m.getName()); 51 } else return; 52 } 53 } else if(evtPpty.equalsIgnoreCase("modes")){ 54 64 65 erase(); 67 } else { 68 append("unknown mode"); 69 } 70 flush(); 71 } 72 73 } 74 | Popular Tags |