1 11 package org.eclipse.jface.action; 12 13 import org.eclipse.swt.SWT; 14 import org.eclipse.swt.widgets.Menu; 15 import org.eclipse.swt.widgets.MenuItem; 16 import org.eclipse.swt.widgets.ToolBar; 17 import org.eclipse.swt.widgets.ToolItem; 18 19 29 public class Separator extends AbstractGroupMarker { 30 33 public Separator() { 34 super(); 35 } 36 37 44 public Separator(String groupName) { 45 super(groupName); 46 } 47 48 52 public void fill(Menu menu, int index) { 53 if (index >= 0) { 54 new MenuItem(menu, SWT.SEPARATOR, index); 55 } else { 56 new MenuItem(menu, SWT.SEPARATOR); 57 } 58 } 59 60 64 public void fill(ToolBar toolbar, int index) { 65 if (index >= 0) { 66 new ToolItem(toolbar, SWT.SEPARATOR, index); 67 } else { 68 new ToolItem(toolbar, SWT.SEPARATOR); 69 } 70 } 71 72 76 public boolean isSeparator() { 77 return true; 78 } 79 } 80 | Popular Tags |