1 11 package org.eclipse.ui.internal; 12 13 import org.eclipse.jface.action.ContributionItem; 14 import org.eclipse.swt.SWT; 15 import org.eclipse.swt.widgets.Menu; 16 import org.eclipse.swt.widgets.MenuItem; 17 import org.eclipse.swt.widgets.ToolBar; 18 import org.eclipse.swt.widgets.ToolItem; 19 20 25 public class ActionSetSeparator extends ContributionItem implements 26 IActionSetContributionItem { 27 private String actionSetId; 28 29 32 public ActionSetSeparator(String groupName, String newActionSetId) { 33 super(groupName); 34 actionSetId = newActionSetId; 35 } 36 37 41 public void fill(Menu menu, int index) { 42 if (index >= 0) { 43 new MenuItem(menu, SWT.SEPARATOR, index); 44 } else { 45 new MenuItem(menu, SWT.SEPARATOR); 46 } 47 } 48 49 53 public void fill(ToolBar toolbar, int index) { 54 if (index >= 0) { 55 new ToolItem(toolbar, SWT.SEPARATOR, index); 56 } else { 57 new ToolItem(toolbar, SWT.SEPARATOR); 58 } 59 } 60 61 64 public String getActionSetId() { 65 return actionSetId; 66 } 67 68 72 public boolean isSeparator() { 73 return true; 74 } 75 76 79 public void setActionSetId(String newActionSetId) { 80 actionSetId = newActionSetId; 81 } 82 } 83 | Popular Tags |