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


Java EditingDomain.getNewChildDescriptors方法代碼示例

本文整理匯總了Java中org.eclipse.emf.edit.domain.EditingDomain.getNewChildDescriptors方法的典型用法代碼示例。如果您正苦於以下問題:Java EditingDomain.getNewChildDescriptors方法的具體用法?Java EditingDomain.getNewChildDescriptors怎麽用?Java EditingDomain.getNewChildDescriptors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.emf.edit.domain.EditingDomain的用法示例。


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

示例1: selectionChanged

import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
 * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
 * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
 * that can be added to the selected object and updating the menus accordingly.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void selectionChanged(SelectionChangedEvent event) {
	// Remove any menu items for old selection.
	//
	if (createChildMenuManager != null) {
		depopulateManager(createChildMenuManager, createChildActions);
	}
	if (createSiblingMenuManager != null) {
		depopulateManager(createSiblingMenuManager, createSiblingActions);
	}

	// Query the new selection for appropriate new child/sibling descriptors
	//
	Collection<?> newChildDescriptors = null;
	Collection<?> newSiblingDescriptors = null;

	ISelection selection = event.getSelection();
	if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
		Object object = ((IStructuredSelection)selection).getFirstElement();

		EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();

		newChildDescriptors = domain.getNewChildDescriptors(object, null);
		newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
	}

	// Generate actions for selection; populate and redraw the menus.
	//
	createChildActions = generateCreateChildActions(newChildDescriptors, selection);
	createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);

	if (createChildMenuManager != null) {
		populateManager(createChildMenuManager, createChildActions, null);
		createChildMenuManager.update(true);
	}
	if (createSiblingMenuManager != null) {
		populateManager(createSiblingMenuManager, createSiblingActions, null);
		createSiblingMenuManager.update(true);
	}
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:48,代碼來源:LibraryActionBarContributor.java

示例2: selectionChanged

import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
 * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
 * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
 * that can be added to the selected object and updating the menus accordingly.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void selectionChanged ( SelectionChangedEvent event )
{
    // Remove any menu items for old selection.
    //
    if ( createChildMenuManager != null )
    {
        depopulateManager ( createChildMenuManager, createChildActions );
    }
    if ( createSiblingMenuManager != null )
    {
        depopulateManager ( createSiblingMenuManager, createSiblingActions );
    }

    // Query the new selection for appropriate new child/sibling descriptors
    //
    Collection<?> newChildDescriptors = null;
    Collection<?> newSiblingDescriptors = null;

    ISelection selection = event.getSelection ();
    if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
    {
        Object object = ( (IStructuredSelection)selection ).getFirstElement ();

        EditingDomain domain = ( (IEditingDomainProvider)activeEditorPart ).getEditingDomain ();

        newChildDescriptors = domain.getNewChildDescriptors ( object, null );
        newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
    }

    // Generate actions for selection; populate and redraw the menus.
    //
    createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
    createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );

    if ( createChildMenuManager != null )
    {
        populateManager ( createChildMenuManager, createChildActions, null );
        createChildMenuManager.update ( true );
    }
    if ( createSiblingMenuManager != null )
    {
        populateManager ( createSiblingMenuManager, createSiblingActions, null );
        createSiblingMenuManager.update ( true );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:55,代碼來源:ProtocolActionBarContributor.java

示例3: selectionChanged

import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
 * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings that can
 * be added to the selected object and updating the menus accordingly. <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
@Override
public void selectionChanged ( final SelectionChangedEvent event )
{
    // Remove any menu items for old selection.
    //
    if ( this.createChildMenuManager != null )
    {
        depopulateManager ( this.createChildMenuManager, this.createChildActions );
    }
    if ( this.createSiblingMenuManager != null )
    {
        depopulateManager ( this.createSiblingMenuManager, this.createSiblingActions );
    }

    // Query the new selection for appropriate new child/sibling descriptors
    //
    Collection<?> newChildDescriptors = null;
    Collection<?> newSiblingDescriptors = null;

    final ISelection selection = event.getSelection ();
    if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
    {
        final Object object = ( (IStructuredSelection)selection ).getFirstElement ();

        final EditingDomain domain = ( (IEditingDomainProvider)this.activeEditorPart ).getEditingDomain ();

        newChildDescriptors = domain.getNewChildDescriptors ( object, null );
        newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
    }

    // Generate actions for selection; populate and redraw the menus.
    //
    this.createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
    this.createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );

    if ( this.createChildMenuManager != null )
    {
        populateManager ( this.createChildMenuManager, this.createChildActions, null );
        this.createChildMenuManager.update ( true );
    }
    if ( this.createSiblingMenuManager != null )
    {
        populateManager ( this.createSiblingMenuManager, this.createSiblingActions, null );
        this.createSiblingMenuManager.update ( true );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:53,代碼來源:ChartActionBarContributor.java

示例4: selectionChanged

import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
 * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
 * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
 * that can be added to the selected object and updating the menus accordingly.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void selectionChanged ( SelectionChangedEvent event )
{
    // Remove any menu items for old selection.
    //
    if ( createChildMenuManager != null )
    {
        depopulateManager ( createChildMenuManager, createChildSubmenuActions );
        depopulateManager ( createChildMenuManager, createChildActions );
    }
    if ( createSiblingMenuManager != null )
    {
        depopulateManager ( createSiblingMenuManager, createSiblingSubmenuActions );
        depopulateManager ( createSiblingMenuManager, createSiblingActions );
    }

    // Query the new selection for appropriate new child/sibling descriptors
    //
    Collection<?> newChildDescriptors = null;
    Collection<?> newSiblingDescriptors = null;

    ISelection selection = event.getSelection ();
    if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
    {
        Object object = ( (IStructuredSelection)selection ).getFirstElement ();

        EditingDomain domain = ( (IEditingDomainProvider)activeEditorPart ).getEditingDomain ();

        newChildDescriptors = domain.getNewChildDescriptors ( object, null );
        newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
    }

    // Generate actions for selection; populate and redraw the menus.
    //
    createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
    createChildSubmenuActions = extractSubmenuActions ( createChildActions );
    createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );
    createSiblingSubmenuActions = extractSubmenuActions ( createSiblingActions );

    if ( createChildMenuManager != null )
    {
        populateManager ( createChildMenuManager, createChildSubmenuActions, null );
        populateManager ( createChildMenuManager, createChildActions, null );
        createChildMenuManager.update ( true );
    }
    if ( createSiblingMenuManager != null )
    {
        populateManager ( createSiblingMenuManager, createSiblingSubmenuActions, null );
        populateManager ( createSiblingMenuManager, createSiblingActions, null );
        createSiblingMenuManager.update ( true );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:60,代碼來源:DetailViewActionBarContributor.java

示例5: selectionChanged

import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
 * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
 * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
 * that can be added to the selected object and updating the menus accordingly.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void selectionChanged ( SelectionChangedEvent event )
{
    // Remove any menu items for old selection.
    //
    if ( createChildMenuManager != null )
    {
        depopulateManager ( createChildMenuManager, createChildSubmenuActions );
        depopulateManager ( createChildMenuManager, createChildActions );
    }
    if ( createSiblingMenuManager != null )
    {
        depopulateManager ( createSiblingMenuManager, createSiblingSubmenuActions );
        depopulateManager ( createSiblingMenuManager, createSiblingActions );
    }

    // Query the new selection for appropriate new child/sibling descriptors
    //
    Collection<?> newChildDescriptors = null;
    Collection<?> newSiblingDescriptors = null;

    ISelection selection = event.getSelection ();
    if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
    {
        Object object = ( (IStructuredSelection)selection ).getFirstElement ();

        EditingDomain domain = ( (IEditingDomainProvider)activeEditorPart ).getEditingDomain ();

        newChildDescriptors = domain.getNewChildDescriptors ( object, null );
        newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
    }

    // Generate actions for selection; populate and redraw the menus.
    //
    createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
    createChildSubmenuActions = extractSubmenuActions ( createChildActions );
    createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );
    createSiblingSubmenuActions = extractSubmenuActions ( createSiblingActions );

    if ( createChildMenuManager != null )
    {
        populateManager ( createChildMenuManager, createChildSubmenuActions, null );
        populateManager ( createChildMenuManager, createChildActions, null );
        createChildMenuManager.update ( true );
    }
    if ( createSiblingMenuManager != null )
    {
        populateManager ( createSiblingMenuManager, createSiblingSubmenuActions, null );
        populateManager ( createSiblingMenuManager, createSiblingActions, null );
        createSiblingMenuManager.update ( true );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:61,代碼來源:DeploymentActionBarContributor.java

示例6: selectionChanged

import org.eclipse.emf.edit.domain.EditingDomain; //導入方法依賴的package包/類
/**
 * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
 * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
 * that can be added to the selected object and updating the menus accordingly.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void selectionChanged ( SelectionChangedEvent event )
{
    // Remove any menu items for old selection.
    //
    if ( createChildMenuManager != null )
    {
        depopulateManager ( createChildMenuManager, createChildActions );
    }
    if ( createSiblingMenuManager != null )
    {
        depopulateManager ( createSiblingMenuManager, createSiblingActions );
    }

    // Query the new selection for appropriate new child/sibling descriptors
    //
    Collection<?> newChildDescriptors = null;
    Collection<?> newSiblingDescriptors = null;

    ISelection selection = event.getSelection ();
    if ( selection instanceof IStructuredSelection && ( (IStructuredSelection)selection ).size () == 1 )
    {
        Object object = ( (IStructuredSelection)selection ).getFirstElement ();

        EditingDomain domain = ( (IEditingDomainProvider)activeEditorPart ).getEditingDomain ();

        newChildDescriptors = domain.getNewChildDescriptors ( object, null );
        newSiblingDescriptors = domain.getNewChildDescriptors ( null, object );
    }

    // Generate actions for selection; populate and redraw the menus.
    //
    createChildActions = generateCreateChildActions ( newChildDescriptors, selection );
    createSiblingActions = generateCreateSiblingActions ( newSiblingDescriptors, selection );

    if ( createChildMenuManager != null )
    {
        populateManager ( createChildMenuManager, createChildActions, null );
        createChildMenuManager.update ( true );
    }
    if ( createSiblingMenuManager != null )
    {
        populateManager ( createSiblingMenuManager, createSiblingActions, null );
        createSiblingMenuManager.update ( true );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:54,代碼來源:ConfigurationActionBarContributor.java


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