1 11 package org.eclipse.ui.internal.texteditor; 12 13 import org.eclipse.swt.graphics.Region; 14 import org.eclipse.swt.layout.GridData; 15 import org.eclipse.swt.layout.GridLayout; 16 import org.eclipse.swt.widgets.Layout; 17 18 23 public class LinearLayouter { 24 25 private static final int ANNOTATION_SIZE= 14; 26 private static final int BORDER_WIDTH= 2; 27 28 public Layout getLayout(int itemCount) { 29 GridLayout layout= new GridLayout(itemCount, true); 31 layout.horizontalSpacing= 1; 32 layout.verticalSpacing= 0; 33 layout.marginHeight= 1; 34 layout.marginWidth= 1; 35 return layout; 36 } 37 38 public Object getLayoutData() { 39 GridData gridData= new GridData(ANNOTATION_SIZE + 2 * BORDER_WIDTH, ANNOTATION_SIZE + 2 * BORDER_WIDTH); 40 gridData.horizontalAlignment= GridData.CENTER; 41 gridData.verticalAlignment= GridData.CENTER; 42 return gridData; 43 } 44 45 public int getAnnotationSize() { 46 return ANNOTATION_SIZE; 47 } 48 49 public int getBorderWidth() { 50 return BORDER_WIDTH; 51 } 52 53 public Region getShellRegion(int itemCount) { 54 return null; 56 } 57 58 } 59 | Popular Tags |