1 19 24 25 package org.netbeans.swing.tabcontrol.event; 26 27 import java.awt.event.ActionEvent ; 28 import java.awt.event.MouseEvent ; 29 30 38 public final class TabActionEvent extends ActionEvent { 39 private MouseEvent mouseEvent = null; 40 private int tabIndex; 41 42 45 public TabActionEvent(Object source, String command, int tabIndex) { 46 super(source, ActionEvent.ACTION_PERFORMED, command); 47 this.tabIndex = tabIndex; 48 consumed = false; 49 } 50 51 public TabActionEvent(Object source, String command, int tabIndex, 52 MouseEvent mouseEvent) { 53 this(source, command, tabIndex); 54 this.mouseEvent = mouseEvent; 55 consumed = false; 56 } 57 58 62 public void consume() { 63 consumed = true; 64 } 65 66 69 public boolean isConsumed() { 70 return super.isConsumed(); 71 } 72 73 79 public MouseEvent getMouseEvent() { 80 return mouseEvent; 81 } 82 83 public int getTabIndex() { 84 return tabIndex; 85 } 86 87 public void setSource(Object source) { 88 this.source = source; 90 } 91 92 public String toString() { 93 StringBuffer sb = new StringBuffer ("TabActionEvent:"); sb.append ("Tab " + tabIndex + " " + getActionCommand()); return sb.toString(); 96 } 97 98 } 99 | Popular Tags |