1 11 package org.eclipse.ui.internal.presentations.util; 12 13 import org.eclipse.swt.graphics.Point; 14 import org.eclipse.ui.presentations.IStackPresentationSite; 15 16 19 public class TabFolderEvent { 20 public static final int EVENT_PANE_MENU = 1; 21 public static final int EVENT_HIDE_TOOLBAR = 2; 22 public static final int EVENT_SHOW_TOOLBAR = 3; 23 public static final int EVENT_RESTORE = 4; 24 public static final int EVENT_MINIMIZE = 5; 25 public static final int EVENT_CLOSE = 6; 26 public static final int EVENT_MAXIMIZE = 7; 27 public static final int EVENT_TAB_SELECTED = 8; 28 public static final int EVENT_GIVE_FOCUS_TO_PART = 9; 29 public static final int EVENT_DRAG_START = 10; 30 public static final int EVENT_SHOW_LIST = 11; 31 public static final int EVENT_SYSTEM_MENU = 12; 32 33 public static int eventIdToStackState(int eventId) { 34 switch(eventId) { 35 case EVENT_RESTORE: return IStackPresentationSite.STATE_RESTORED; 36 case EVENT_MINIMIZE: return IStackPresentationSite.STATE_MINIMIZED; 37 case EVENT_MAXIMIZE: return IStackPresentationSite.STATE_MAXIMIZED; 38 } 39 40 return 0; 41 } 42 43 public static int stackStateToEventId(int stackState) { 44 switch(stackState) { 45 case IStackPresentationSite.STATE_RESTORED: return EVENT_RESTORE; 46 case IStackPresentationSite.STATE_MINIMIZED: return EVENT_MINIMIZE; 47 case IStackPresentationSite.STATE_MAXIMIZED: return EVENT_MAXIMIZE; 48 } 49 50 return 0; 51 } 52 53 public AbstractTabItem tab; 54 public int type; 55 public int x; 56 public int y; 57 58 public TabFolderEvent(int type) { 59 this.type = type; 60 } 61 62 public TabFolderEvent(int type, AbstractTabItem w, int x, int y) { 63 this.type = type; 64 this.tab = w; 65 this.x = x; 66 this.y = y; 67 } 68 69 public TabFolderEvent(int type, AbstractTabItem w, Point pos) { 70 this.type = type; 71 this.tab = w; 72 this.x = pos.x; 73 this.y = pos.y; 74 } 75 } 76 | Popular Tags |