當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。