当前位置: 首页>>代码示例>>Java>>正文


Java EditingDomain类代码示例

本文整理汇总了Java中org.eclipse.emf.edit.domain.EditingDomain的典型用法代码示例。如果您正苦于以下问题:Java EditingDomain类的具体用法?Java EditingDomain怎么用?Java EditingDomain使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EditingDomain类属于org.eclipse.emf.edit.domain包,在下文中一共展示了EditingDomain类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
@Override
public Object execute ( final ExecutionEvent event ) throws ExecutionException
{

    final IEditorPart editor = getActivePage ().getActiveEditor ();

    byte b = (byte)1;
    for ( final Attribute attribute : SelectionHelper.iterable ( getSelection (), Attribute.class ) )
    {
        EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor ( attribute );

        if ( domain == null && editor instanceof IEditingDomainProvider )
        {
            domain = ( (IEditingDomainProvider)editor ).getEditingDomain ();
        }

        SetCommand.create ( domain, attribute, ProtocolPackage.Literals.ATTRIBUTE__FIELD_NUMBER, b ).execute ();

        b++;
    }

    return null;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:24,代码来源:FillFieldNumbersHandler.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
 */
   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:IncQueryLabs,项目名称:smarthome-cep-demonstrator,代码行数:48,代码来源:SmarthomeActionBarContributor.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
 */
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,代码来源:AnalysisActionBarContributor.java

示例4: getGroup

import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
private Group getGroup() {
	final Group res;
	final IEditorPart editor = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage()
			.getActiveEditor();

	if (editor instanceof IEditingDomainProvider) {
		final EditingDomain editingDomain = ((IEditingDomainProvider) editor)
				.getEditingDomain();
		final ResourceSet resourceSet = editingDomain.getResourceSet();
		Group group = null;

		for (Resource resource : resourceSet.getResources()) {
			for (EObject eObj : resource.getContents()) {
				if (eObj instanceof Group) {
					group = (Group) eObj;
					break;
				}
			}
		}
		res = group;
	} else {
		res = null;
	}

	return res;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:28,代码来源:NewGemocDebugRepresentationWizard.java

示例5: getNewChildDescriptors

import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public Collection<Object> getNewChildDescriptors ( Object object, EditingDomain editingDomain )
{
    ArrayList<Object> result = new ArrayList<Object> ();
    new CreationSwitch ( result, editingDomain ).doSwitch ( (EObject)object );
    return result;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:12,代码来源:ChartItemProviderAdapterFactory.java

示例6: getNewChildDescriptors

import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public Collection<Object> getNewChildDescriptors ( Object object, EditingDomain editingDomain )
{
    ArrayList<Object> result = new ArrayList<Object> ();
    new CreationSwitch ( result, editingDomain ).doSwitch ( (EObject)object );
    return result;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:CommonItemProviderAdapterFactory.java

示例7: CompoundHandler

import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
public CompoundHandler ( final EditingDomain domain )
{
    this.domain = domain;
    this.command = new CompoundCommand () {
        @Override
        public Collection<?> getAffectedObjects ()
        {
            // we do this in order to prevent the "Add" command to jump "somewhere"
            return Collections.EMPTY_LIST;
        }
    };
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:CompoundHandler.java

示例8: 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,代码来源:ComponentActionBarContributor.java

示例9: getEditingDomain

import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
@Override
public EditingDomain getEditingDomain ()
{
    return this.editingDomain;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:6,代码来源:PreviewEditorImpl.java

示例10: 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 NOT
 */
public void selectionChanged(SelectionChangedEvent event) {
	// Remove any menu items for old selection.
	//
	if (createChildMenuManager != null) {
		depopulateManager(createChildMenuManager, createChildActions);
	}
	if (createSiblingMenuManager != null) {
		depopulateManager(createSiblingMenuManager, createSiblingActions);
	}
	if (createPolicyMenuManager != null) {
		depopulateManager(createPolicyMenuManager, 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);
	}
	Collection<Object> newPolicyDescriptors = new LinkedList<Object>();
	if (newChildDescriptors != null) {
		for(Object p: newChildDescriptors) {
			if (p instanceof CommandParameter && ((CommandParameter)p).value instanceof SchedulingPolicy) {
				newPolicyDescriptors.add(p);
			}
		}
	}
	createPolicyActions =  generateCreateChildActions(newPolicyDescriptors, selection);

	// 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);
	}
	if (createPolicyMenuManager != null) {
		populateManager(createPolicyMenuManager, createPolicyActions, null);
		createPolicyMenuManager.update(true);
	}
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:64,代码来源:DesignActionBarContributor.java

示例11: 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

示例12: 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

示例13: 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,代码来源:ChartActionBarContributor.java

示例14: DropAdapterExtension

import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
public DropAdapterExtension ( final EditingDomain domain, final Viewer viewer )
{
    super ( domain, viewer );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:5,代码来源:DropAdapterExtension.java

示例15: getNewChildDescriptors

import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public Collection<?> getNewChildDescriptors ( Object object, EditingDomain editingDomain )
{
    return childCreationExtenderManager.getNewChildDescriptors ( object, editingDomain );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:11,代码来源:VisualInterfaceItemProviderAdapterFactory.java


注:本文中的org.eclipse.emf.edit.domain.EditingDomain类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。