本文整理汇总了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;
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
};
}
示例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 );
}
}
示例9: getEditingDomain
import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
@Override
public EditingDomain getEditingDomain ()
{
return this.editingDomain;
}
示例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);
}
}
示例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 );
}
}
示例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 );
}
}
示例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);
}
}
示例14: DropAdapterExtension
import org.eclipse.emf.edit.domain.EditingDomain; //导入依赖的package包/类
public DropAdapterExtension ( final EditingDomain domain, final Viewer viewer )
{
super ( domain, viewer );
}
示例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 );
}