Java Code Examples for org.eclipse.emf.edit.domain.EditingDomain#getNewChildDescriptors()

The following examples show how to use org.eclipse.emf.edit.domain.EditingDomain#getNewChildDescriptors() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExtensionsActionBarContributor.java    From ifml-editor with MIT License 5 votes vote down vote up
/**
 * 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);
	}
}
 
Example 2
Source File: CoreActionBarContributor.java    From ifml-editor with MIT License 5 votes vote down vote up
/**
 * 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);
	}
}
 
Example 3
Source File: EipActionBarContributor.java    From eip-designer with Apache License 2.0 5 votes vote down vote up
/**
   * 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);
     }
  }
 
Example 4
Source File: MemoryActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 5
Source File: ConfigurationActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 6
Source File: ItemActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 7
Source File: ComponentActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 8
Source File: GlobalizeActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 9
Source File: SecurityActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 10
Source File: InfrastructureActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 11
Source File: RecipeActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 12
Source File: ProtocolActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 13
Source File: WorldActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 14
Source File: OsgiActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 15
Source File: SetupActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 16
Source File: DeploymentActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 17
Source File: VisualInterfaceActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 18
Source File: DetailViewActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 19
Source File: ChartActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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 );
    }
}
 
Example 20
Source File: ChartActionBarContributor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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);
	}
}