Search in sources :

Example 1 with IEditingDomainProvider

use of org.eclipse.emf.edit.domain.IEditingDomainProvider in project Malai by arnobl.

the class EventActionBarContributor method selectionChanged.

/**
 * 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) {
    // 
    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);
    }
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EditingDomain(org.eclipse.emf.edit.domain.EditingDomain) IEditingDomainProvider(org.eclipse.emf.edit.domain.IEditingDomainProvider)

Example 2 with IEditingDomainProvider

use of org.eclipse.emf.edit.domain.IEditingDomainProvider in project Malai by arnobl.

the class InstrumentActionBarContributor method selectionChanged.

/**
 * 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) {
    // 
    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);
    }
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EditingDomain(org.eclipse.emf.edit.domain.EditingDomain) IEditingDomainProvider(org.eclipse.emf.edit.domain.IEditingDomainProvider)

Example 3 with IEditingDomainProvider

use of org.eclipse.emf.edit.domain.IEditingDomainProvider in project Malai by arnobl.

the class WidgetActionBarContributor method selectionChanged.

/**
 * 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) {
    // 
    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);
    }
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EditingDomain(org.eclipse.emf.edit.domain.EditingDomain) IEditingDomainProvider(org.eclipse.emf.edit.domain.IEditingDomainProvider)

Example 4 with IEditingDomainProvider

use of org.eclipse.emf.edit.domain.IEditingDomainProvider in project iobserve-analysis by research-iobserve.

the class systemadaptationActionBarContributor method selectionChanged.

/**
 * 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) {
    // 
    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);
    }
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EditingDomain(org.eclipse.emf.edit.domain.EditingDomain) IEditingDomainProvider(org.eclipse.emf.edit.domain.IEditingDomainProvider)

Example 5 with IEditingDomainProvider

use of org.eclipse.emf.edit.domain.IEditingDomainProvider in project metalib by softlang.

the class FsmlActionBarContributor method selectionChanged.

/**
 * 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) {
    // 
    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);
    }
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EditingDomain(org.eclipse.emf.edit.domain.EditingDomain) IEditingDomainProvider(org.eclipse.emf.edit.domain.IEditingDomainProvider)

Aggregations

IEditingDomainProvider (org.eclipse.emf.edit.domain.IEditingDomainProvider)33 EditingDomain (org.eclipse.emf.edit.domain.EditingDomain)32 ISelection (org.eclipse.jface.viewers.ISelection)30 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)30 IEditorPart (org.eclipse.ui.IEditorPart)2 ArrayList (java.util.ArrayList)1 URIEditorInput (org.eclipse.emf.common.ui.URIEditorInput)1 EObject (org.eclipse.emf.ecore.EObject)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)1 TransactionalEditingDomain (org.eclipse.emf.transaction.TransactionalEditingDomain)1 IEditorInput (org.eclipse.ui.IEditorInput)1 IEditorReference (org.eclipse.ui.IEditorReference)1