本文整理匯總了Java中org.eclipse.jface.action.IContributionItem.fill方法的典型用法代碼示例。如果您正苦於以下問題:Java IContributionItem.fill方法的具體用法?Java IContributionItem.fill怎麽用?Java IContributionItem.fill使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.action.IContributionItem
的用法示例。
在下文中一共展示了IContributionItem.fill方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getMenu
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
/**
* This method constructs a new Menu based on the child ActionTree nodes
* for a parent Control (e.g., a ToolItem).
*/
@Override
public Menu getMenu(Control parent) {
// Get the current ActionTree node.
VizActionTree tree = VizActionTree.this;
// Dispose of the old Menu and create a new one.
dispose();
menu = new Menu(parent);
// Add the IContributionItems from the child nodes.
for (VizActionTree child : tree.getChildren()) {
IContributionItem item = child.getContributionItem();
items.add(item);
// This adds the item to the Menu as a MenuItem.
item.fill(menu, -1);
}
return menu;
}
示例2: fill
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
@Override
public void fill(Menu menu, int index)
{
IThemeManager manager = ThemePlugin.getDefault().getThemeManager();
List<String> themeNames = new ArrayList<String>(manager.getThemeNames());
// sort ignoring case
Collections.sort(themeNames, new Comparator<String>()
{
public int compare(String o1, String o2)
{
return o1.compareToIgnoreCase(o2);
}
});
for (String name : themeNames)
{
IContributionItem item = new SwitchThemeContributionItem(manager, name);
item.fill(menu, menu.getItemCount());
}
}
示例3: showMenu
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
private void showMenu(Button button, IContributionItem menuContribution) {
Menu menu = new Menu(button);
Point p = button.getLocation();
p.y = p.y + button.getSize().y;
p = button.getParent().toDisplay(p);
menu.setLocation(p);
menuContribution.fill(menu, 0);
menu.setVisible(true);
}
示例4: fill
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
@Override
public void fill(Menu menu, int index) {
MenuItem item = new MenuItem(menu, SWT.CASCADE);
item.setText(userId);
item.setImage(GerritToolsPlugin.getDefault().getImageRegistry().get(GerritToolsPlugin.IMG_FEATURE_BRANCH_OWNER));
Menu subMenu = new Menu(menu);
item.setMenu(subMenu);
for (IContributionItem sub: createPerBranchContributionItems(repositories,
cmdId, MODE_FEATURE_USER, userId)) {
sub.fill(item.getMenu(), -1);
}
}
示例5: fill
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
@Override
public void fill(Menu menu, int index) {
MenuItem item = new MenuItem(menu, SWT.CASCADE);
item.setText(stable);
item.setImage(GerritToolsPlugin.getDefault().getImageRegistry().get(GerritToolsPlugin.IMG_BRANCH));
Menu subMenu = new Menu(menu);
item.setMenu(subMenu);
for (IContributionItem sub: createContributions()) {
sub.fill(item.getMenu(), -1);
}
}