1 11 12 package org.eclipse.ui.internal.menus; 13 14 import org.eclipse.jface.action.ControlContribution; 15 import org.eclipse.swt.SWT; 16 import org.eclipse.ui.IWorkbenchWindow; 17 18 27 public abstract class InternalControlContribution extends ControlContribution { 28 private String id; 29 private IWorkbenchWindow wbw; 30 private int curSide; 31 32 35 protected InternalControlContribution(String id) { 36 super(id); 37 this.id = id; 38 } 39 40 public InternalControlContribution() { 41 this("unknown ID"); } 43 44 47 public String getId() { 48 return id; 49 } 50 51 54 void setId(String id) { 55 this.id = id; 56 } 57 58 61 public IWorkbenchWindow getWorkbenchWindow() { 62 return wbw; 63 } 64 65 68 void setWorkbenchWindow(IWorkbenchWindow wbw) { 69 this.wbw = wbw; 70 } 71 72 75 public int getCurSide() { 76 return curSide; 77 } 78 79 82 void setCurSide(int curSide) { 83 this.curSide = curSide; 84 } 85 86 public int getOrientation() { 87 if (getCurSide() == SWT.LEFT || getCurSide() == SWT.RIGHT) 88 return SWT.VERTICAL; 89 90 return SWT.HORIZONTAL; 91 } 92 } 93 | Popular Tags |