本文整理匯總了Java中org.eclipse.jface.action.IContributionItem.setVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java IContributionItem.setVisible方法的具體用法?Java IContributionItem.setVisible怎麽用?Java IContributionItem.setVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.action.IContributionItem
的用法示例。
在下文中一共展示了IContributionItem.setVisible方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processItems
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
private static void processItems(final IMenuManager menu) {
// final StringBuilder sb = new StringBuilder();
// sb.append("Menu ").append(menu.getId()).append(" :: ");
for (final IContributionItem item : menu.getItems()) {
final String name = item.getId();
if (MENU_ITEMS_TO_REMOVE.contains(name)) {
item.setVisible(false);
continue;
}
if (item.isGroupMarker() || item.isSeparator() || !item.isVisible())
continue;
if (MENU_IMAGES.containsKey(name)) {
changeIcon(menu, item, GamaIcons.create(MENU_IMAGES.get(name)).descriptor());
}
// sb.append(Strings.LN).append(Strings.TAB);
// sb.append(name).append('[').append(item.getClass().getSimpleName()).append("]:: ");
}
// System.out.println(sb.toString());
}
示例2: setActionsVisible
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
private void setActionsVisible(IContributionManager man, boolean vis, String... ignoredIds) {
List<String> ignore = Arrays.asList(Optional.of(ignoredIds).orElse(new String[]{""}));
for (IContributionItem item : man.getItems()) {
if (ignore.contains(item.getId())) {
item.setVisible(true);
continue;
}
item.setVisible(vis);
}
}
示例3: setVisiable
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
static public void setVisiable(ViewPart viewPart, String ID, boolean enable){
IToolBarManager manager = viewPart.getViewSite().getActionBars().getToolBarManager();
final IContributionItem[] items = manager.getItems();
for (IContributionItem item : items) {
if (item.getId() != null && item.getId().equals(ID)){
item.setVisible(enable);
}
}
manager.update(true);
}
示例4: hideSearchMenu
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
private void hideSearchMenu() {
IMenuManager menuManager = this.actionBarConfigurer.getMenuManager();
IContributionItem[] menuItems = menuManager.getItems();
for (IContributionItem item : menuItems) {
if(item.getId().equalsIgnoreCase("org.eclipse.search.menu")) {
item.setVisible(false);
}
}
}
示例5: enableSaveAs
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
/**
* @param enable Edit option for tracking sub job is removed.
*/
@SuppressWarnings("restriction")
public void enableSaveAs(boolean enable) {
IContributionItem contributionItem = (IContributionItem) ((WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow()).getMenuBarManager().getItems()[2];
contributionItem.setVisible(enable);
}
示例6: allowItem
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
protected boolean allowItem(IContributionItem itemToAdd) {
if (itemToAdd.getId() != null && Arrays.contains(exclusionSet, itemToAdd.getId()))
itemToAdd.setVisible(false);
return super.allowItem(itemToAdd);
}
示例7: allowItem
import org.eclipse.jface.action.IContributionItem; //導入方法依賴的package包/類
protected boolean allowItem(IContributionItem itemToAdd) {
if (Arrays.contains(exclude, itemToAdd.getId())) {
itemToAdd.setVisible(false);
}
return true;
}