1 19 20 28 29 package org.netbeans.modules.web.monitor.client; 30 31 import java.awt.event.ActionEvent ; 32 import java.awt.event.ActionListener ; 33 34 import org.openide.util.HelpCtx; 35 import org.openide.util.NbBundle; 36 import org.openide.util.actions.BooleanStateAction; 37 38 39 public class ShowTimestampAction extends BooleanStateAction { 40 41 public HelpCtx getHelpCtx() { 42 return HelpCtx.DEFAULT_HELP; 43 } 44 45 protected void initialize() { 46 super.initialize(); 47 TransactionView transView = TransactionView.getInstance(); 48 setBooleanState(transView.isTimestampButtonSelected()); 49 transView.addTimestampButtonActionListener(new ActionListener () { 51 public void actionPerformed(ActionEvent ev) { 52 setBooleanState(!getBooleanState()); 53 } 54 }); 55 setIcon(null); 56 } 57 58 public String getName() { 59 return NbBundle.getBundle(ReloadAction.class).getString("MON_Show_timestamp"); 60 } 61 62 public void actionPerformed(ActionEvent ev) { 63 super.actionPerformed(ev); 64 TransactionNode.toggleTimeStamp(); 65 TransactionView.getInstance().setTimestampButtonSelected(getBooleanState()); 66 MonitorAction.getController().updateNodeNames(); 67 } 68 } 69 | Popular Tags |