本文整理匯總了Java中org.eclipse.jface.action.IContributionManager.getItems方法的典型用法代碼示例。如果您正苦於以下問題:Java IContributionManager.getItems方法的具體用法?Java IContributionManager.getItems怎麽用?Java IContributionManager.getItems使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.action.IContributionManager
的用法示例。
在下文中一共展示了IContributionManager.getItems方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: depopulateManager
import org.eclipse.jface.action.IContributionManager; //導入方法依賴的package包/類
/**
* This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
if (actions != null) {
IContributionItem[] items = manager.getItems();
for (int i = 0; i < items.length; i++) {
// Look into SubContributionItems
//
IContributionItem contributionItem = items[i];
while (contributionItem instanceof SubContributionItem) {
contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
}
// Delete the ActionContributionItems with matching action.
//
if (contributionItem instanceof ActionContributionItem) {
IAction action = ((ActionContributionItem)contributionItem).getAction();
if (actions.contains(action)) {
manager.remove(contributionItem);
}
}
}
}
}
示例2: depopulateManager
import org.eclipse.jface.action.IContributionManager; //導入方法依賴的package包/類
/**
* This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
if (actions != null) {
IContributionItem[] items = manager.getItems();
for (int i = 0; i < items.length; i++) {
// Look into SubContributionItems
//
IContributionItem contributionItem = items[i];
while (contributionItem instanceof SubContributionItem) {
contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
}
// Delete the ActionContributionItems with matching action.
//
if (contributionItem instanceof ActionContributionItem) {
IAction action = ((ActionContributionItem)contributionItem).getAction();
if (actions.contains(action)) {
manager.remove(contributionItem);
}
}
}
}
}
示例3: depopulateManager
import org.eclipse.jface.action.IContributionManager; //導入方法依賴的package包/類
/**
* This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void depopulateManager(IContributionManager manager,
Collection<? extends IAction> actions) {
if (actions != null) {
IContributionItem[] items = manager.getItems();
for (int i = 0; i < items.length; i++) {
// Look into SubContributionItems
//
IContributionItem contributionItem = items[i];
while (contributionItem instanceof SubContributionItem) {
contributionItem = ((SubContributionItem) contributionItem)
.getInnerItem();
}
// Delete the ActionContributionItems with matching action.
//
if (contributionItem instanceof ActionContributionItem) {
IAction action = ((ActionContributionItem) contributionItem)
.getAction();
if (actions.contains(action)) {
manager.remove(contributionItem);
}
}
}
}
}
示例4: depopulateManager
import org.eclipse.jface.action.IContributionManager; //導入方法依賴的package包/類
/**
* This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.MenuManager}s and their
* {@link org.eclipse.jface.action.ActionContributionItem}s based on the {@link org.eclipse.jface.action.IAction}s
* contained in the <code>submenuActions</code> map.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void depopulateManager ( IContributionManager manager, Map<String, Collection<IAction>> submenuActions )
{
if ( submenuActions != null )
{
IContributionItem[] items = manager.getItems ();
for ( int i = 0; i < items.length; i++ )
{
IContributionItem contributionItem = items[i];
if ( contributionItem instanceof MenuManager )
{
MenuManager submenuManager = (MenuManager)contributionItem;
if ( submenuActions.containsKey ( submenuManager.getMenuText () ) )
{
depopulateManager ( submenuManager, submenuActions.get ( contributionItem ) );
manager.remove ( contributionItem );
}
}
}
}
}
示例5: depopulateManager
import org.eclipse.jface.action.IContributionManager; //導入方法依賴的package包/類
/**
* This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
* based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void depopulateManager ( IContributionManager manager, Collection<? extends IAction> actions )
{
if ( actions != null )
{
IContributionItem[] items = manager.getItems ();
for ( int i = 0; i < items.length; i++ )
{
// Look into SubContributionItems
//
IContributionItem contributionItem = items[i];
while ( contributionItem instanceof SubContributionItem )
{
contributionItem = ( (SubContributionItem)contributionItem ).getInnerItem ();
}
// Delete the ActionContributionItems with matching action.
//
if ( contributionItem instanceof ActionContributionItem )
{
IAction action = ( (ActionContributionItem)contributionItem ).getAction ();
if ( actions.contains ( action ) )
{
manager.remove ( contributionItem );
}
}
}
}
}
示例6: setActionsVisible
import org.eclipse.jface.action.IContributionManager; //導入方法依賴的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);
}
}