當前位置: 首頁>>代碼示例>>Java>>正文


Java IAction類代碼示例

本文整理匯總了Java中org.eclipse.jface.action.IAction的典型用法代碼示例。如果您正苦於以下問題:Java IAction類的具體用法?Java IAction怎麽用?Java IAction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IAction類屬於org.eclipse.jface.action包,在下文中一共展示了IAction類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: depopulateManager

import org.eclipse.jface.action.IAction; //導入依賴的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);
				}
			}
		}
	}
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:30,代碼來源:MappingActionBarContributor.java

示例2: extractSubmenuActions

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
/**
 * This extracts those actions in the <code>submenuActions</code> collection whose text is qualified and returns
 * a map of these actions, keyed by submenu text.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Map<String, Collection<IAction>> extractSubmenuActions ( Collection<IAction> createActions )
{
    Map<String, Collection<IAction>> createSubmenuActions = new LinkedHashMap<String, Collection<IAction>> ();
    if ( createActions != null )
    {
        for ( Iterator<IAction> actions = createActions.iterator (); actions.hasNext (); )
        {
            IAction action = actions.next ();
            StringTokenizer st = new StringTokenizer ( action.getText (), "|" );
            if ( st.countTokens () == 2 )
            {
                String text = st.nextToken ().trim ();
                Collection<IAction> submenuActions = createSubmenuActions.get ( text );
                if ( submenuActions == null )
                {
                    createSubmenuActions.put ( text, submenuActions = new ArrayList<IAction> () );
                }
                action.setText ( st.nextToken ().trim () );
                submenuActions.add ( action );
                actions.remove ();
            }
        }
    }
    return createSubmenuActions;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:33,代碼來源:MemoryActionBarContributor.java

示例3: selectionChanged

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = true;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof ObjectsFolderTreeObject) {
			enable = ((ObjectsFolderTreeObject)treeObject).folderType == ObjectsFolderTreeObject.FOLDER_TYPE_TESTCASES;
		}
		else {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:19,代碼來源:CreateTestCaseAction.java

示例4: depopulateManager

import org.eclipse.jface.action.IAction; //導入依賴的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 );
                }
            }
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:29,代碼來源:RecipeActionBarContributor.java

示例5: extractSubmenuActions

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
/**
 * This extracts those actions in the <code>submenuActions</code> collection whose text is qualified and returns
 * a map of these actions, keyed by submenu text.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Map<String, Collection<IAction>> extractSubmenuActions ( Collection<IAction> createActions )
{
    Map<String, Collection<IAction>> createSubmenuActions = new LinkedHashMap<String, Collection<IAction>> ();
    if ( createActions != null )
    {
        for ( Iterator<IAction> actions = createActions.iterator (); actions.hasNext (); )
        {
            IAction action = actions.next ();
            StringTokenizer st = new StringTokenizer ( action.getText (), "|" ); //$NON-NLS-1$
            if ( st.countTokens () == 2 )
            {
                String text = st.nextToken ().trim ();
                Collection<IAction> submenuActions = createSubmenuActions.get ( text );
                if ( submenuActions == null )
                {
                    createSubmenuActions.put ( text, submenuActions = new ArrayList<IAction> () );
                }
                action.setText ( st.nextToken ().trim () );
                submenuActions.add ( action );
                actions.remove ();
            }
        }
    }
    return createSubmenuActions;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:33,代碼來源:WorldActionBarContributor.java

示例6: selectionChanged

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = true;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof ObjectsFolderTreeObject) {
			ObjectsFolderTreeObject ofto = (ObjectsFolderTreeObject)treeObject;
			enable = ofto.folderType == ObjectsFolderTreeObject.FOLDER_TYPE_ACTIONS;
			treeObject = ofto.getParent();
		}
		if (enable && treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:21,代碼來源:CreateMobileRouteActionComponentAction.java

示例7: init

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
@Override
public void init ( final ICommonActionExtensionSite aSite )
{
    super.init ( aSite );
    final ICommonViewerSite viewSite = aSite.getViewSite ();
    if ( viewSite instanceof ICommonViewerWorkbenchSite )
    {
        final ICommonViewerWorkbenchSite workbenchSite = (ICommonViewerWorkbenchSite)viewSite;
        this.openAction = new Action ( "Open", IAction.AS_PUSH_BUTTON ) {
            @Override
            public void run ()
            {
                handleOpen ( workbenchSite );
            }
        };
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:18,代碼來源:CommonActionProvider.java

示例8: populateManager

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager ( IContributionManager manager, Collection<? extends IAction> actions, String contributionID )
{
    if ( actions != null )
    {
        for ( IAction action : actions )
        {
            if ( contributionID != null )
            {
                manager.insertBefore ( contributionID, action );
            }
            else
            {
                manager.add ( action );
            }
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:27,代碼來源:DetailViewActionBarContributor.java

示例9: togglePausedConsumer

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
protected void togglePausedConsumer(IAction pauseConsumer) {

		// The button can get out of sync if two clients are used.
		final boolean currentState = queueConnection.isQueuePaused(getSubmissionQueueName());
		try {
			pauseConsumer.setChecked(!currentState); // We are toggling it.

			IPublisher<PauseBean> pauser = service.createPublisher(getUri(), IEventService.CMD_TOPIC);
			pauser.setStatusSetName(IEventService.CMD_SET); // The set that other clients may check
			pauser.setStatusSetAddRequired(true);

			PauseBean pbean = new PauseBean();
			pbean.setQueueName(getSubmissionQueueName()); // The queue we are pausing
			pbean.setPause(pauseConsumer.isChecked());
			pauser.broadcast(pbean);

		} catch (Exception e) {
			ErrorDialog.openError(getViewSite().getShell(), "Cannot pause queue "+getSubmissionQueueName(), "Cannot pause queue "+getSubmissionQueueName()+"\n\nPlease contact your support representative.",
					new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
		}
		pauseConsumer.setChecked(queueConnection.isQueuePaused(getSubmissionQueueName()));
	}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:23,代碼來源:StatusQueueView.java

示例10: generateCreateSiblingActions

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
/**
 * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
 * and returns the collection of these actions.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
	Collection<IAction> actions = new ArrayList<IAction>();
	if (descriptors != null) {
		for (Object descriptor : descriptors) {
			actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
		}
	}
	return actions;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:17,代碼來源:GexpressionsActionBarContributor.java

示例11: generateCreateChildActions

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
/**
 * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
 * and returns the collection of these actions.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected Collection<IAction> generateCreateChildActions ( Collection<?> descriptors, ISelection selection )
{
    Collection<IAction> actions = new ArrayList<IAction> ();
    if ( descriptors != null )
    {
        for ( Object descriptor : descriptors )
        {
            actions.add ( new CreateChildAction ( activeEditorPart, selection, descriptor ) );
        }
    }
    return actions;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:20,代碼來源:MemoryActionBarContributor.java

示例12: populateManager

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
    * <!-- end-user-doc -->
 * @generated
 */
   protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
	if (actions != null) {
		for (IAction action : actions) {
			if (contributionID != null) {
				manager.insertBefore(contributionID, action);
			}
			else {
				manager.add(action);
			}
		}
	}
}
 
開發者ID:IncQueryLabs,項目名稱:smarthome-cep-demonstrator,代碼行數:22,代碼來源:SmarthomeActionBarContributor.java

示例13: populateManager

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
	if (actions != null) {
		for (IAction action : actions) {
			if (contributionID != null) {
				manager.insertBefore(contributionID, action);
			}
			else {
				manager.add(action);
			}
		}
	}
}
 
開發者ID:cetic,項目名稱:SimQRI,代碼行數:22,代碼來源:MetamodelActionBarContributor.java

示例14: selectionChanged

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
public void selectionChanged(IAction action, ISelection selection) {
	super.selectionChanged(action, selection);
	IStructuredSelection structuredSelection = (IStructuredSelection) selection;
	TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
	if (treeObject instanceof DesignDocumentViewTreeObject) {
		action.setEnabled(((DesignDocumentViewTreeObject)treeObject).hasReduce());
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:9,代碼來源:ViewExecuteNoReduceAction.java

示例15: selectionChanged

import org.eclipse.jface.action.IAction; //導入依賴的package包/類
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = false;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:16,代碼來源:ChangeToElementStepAction.java


注:本文中的org.eclipse.jface.action.IAction類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。