org.eclipse.emf.common.command.CommandStackListener Java Examples
The following examples show how to use
org.eclipse.emf.common.command.CommandStackListener.
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: BibtexEntryView.java From slr-toolkit with Eclipse Public License 1.0 | 6 votes |
/** * This sets up the editing domain for the model editor. <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ protected void initializeEditingDomain() { ModelRegistryPlugin.getModelRegistry().getEditingDomain().ifPresent((domain) -> editingDomain = domain); // Add a listener to set the most recent command's affected objects // to be the selection of the viewer with focus. if (editingDomain == null) { System.err.println("[BibtexEntryView#initializeEditingDomain] uninitailised editing domain"); return; } adapterFactory = editingDomain.getAdapterFactory(); editingDomain.getCommandStack().addCommandStackListener(new CommandStackListener() { @Override public void commandStackChanged(final EventObject event) { getSite().getShell().getDisplay().asyncExec(() -> { firePropertyChange(IEditorPart.PROP_DIRTY); }); } }); closeEditors(); }
Example #2
Source File: ChartEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // this.adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); this.adapterFactory .addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); this.adapterFactory.addAdapterFactory ( new ChartItemProviderAdapterFactory () ); this.adapterFactory .addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // final BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { @Override public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { @Override public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // final Command mostRecentCommand = ( (CommandStack)event .getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand .getAffectedObjects () ); } for ( final Iterator<PropertySheetPage> i = ChartEditor.this.propertySheetPages .iterator (); i.hasNext (); ) { final PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // this.editingDomain = new AdapterFactoryEditingDomain ( this.adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #3
Source File: ExtensionsEditor.java From ifml-editor with MIT License | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain() { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new CoreItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ExtensionsItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack(); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener (new CommandStackListener() { public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec (new Runnable() { public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); // Try to select the affected objects. // Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand(); if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { PropertySheetPage propertySheetPage = i.next(); if (propertySheetPage.getControl().isDisposed()) { i.remove(); } else { propertySheetPage.refresh(); } } } }); } }); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>()); }
Example #4
Source File: CoreEditor.java From ifml-editor with MIT License | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain() { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new CoreItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ExtensionsItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack(); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener (new CommandStackListener() { public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec (new Runnable() { public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); // Try to select the affected objects. // Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand(); if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { PropertySheetPage propertySheetPage = i.next(); if (propertySheetPage.getControl().isDisposed()) { i.remove(); } else { propertySheetPage.refresh(); } } } }); } }); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>()); }
Example #5
Source File: EipEditor.java From eip-designer with Apache License 2.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain() { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new EipItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack(); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener (new CommandStackListener() { public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec (new Runnable() { public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); // Try to select the affected objects. // Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand(); if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { PropertySheetPage propertySheetPage = i.next(); if (propertySheetPage.getControl().isDisposed()) { i.remove(); } else { propertySheetPage.refresh(); } } } }); } }); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>()); }
Example #6
Source File: BeansEditor.java From hybris-commerce-eclipse-plugin with Apache License 2.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain() { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new BeansItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack(); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener (new CommandStackListener() { public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec (new Runnable() { public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); // Try to select the affected objects. // Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand(); if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { PropertySheetPage propertySheetPage = i.next(); if (propertySheetPage.getControl().isDisposed()) { i.remove(); } else { propertySheetPage.refresh(); } } } }); } }); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>()); }
Example #7
Source File: GenconfEditor.java From M2Doc with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT * @deprecated */ protected void initializeEditingDomain() { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new GenconfItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are executed. // TransactionalCommandStack commandStack = new TransactionalCommandStackImpl(); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener(new CommandStackListener() { public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec(new Runnable() { public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); // Try to select the affected objects. // Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext();) { PropertySheetPage propertySheetPage = i.next(); if (propertySheetPage.getControl().isDisposed()) { i.remove(); } else { propertySheetPage.refresh(); } } } }); } }); // Create the editing domain with a special command stack. // editingDomain = new TransactionalEditingDomainImpl(adapterFactory, commandStack); }
Example #8
Source File: CrossflowEditor.java From scava with Eclipse Public License 2.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain() { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new CrossflowItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack(); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener (new CommandStackListener() { public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec (new Runnable() { public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); // Try to select the affected objects. // Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand(); if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { PropertySheetPage propertySheetPage = i.next(); if (propertySheetPage.getControl().isDisposed()) { i.remove(); } else { propertySheetPage.refresh(); } } } }); } }); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>()); }
Example #9
Source File: ConfigurationEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ConfigurationItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #10
Source File: ItemEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ItemItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #11
Source File: ComponentEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ComponentItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new EcoreItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ConfigurationItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new GlobalizeItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new InfrastructureItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ItemItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ScriptItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SecurityItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new WorldItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new OsgiItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ProfileItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new DeploymentItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SetupItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #12
Source File: GlobalizeEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new GlobalizeItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ConfigurationItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SecurityItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new WorldItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new OsgiItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ProfileItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new DeploymentItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SetupItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new EcoreItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ScriptItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #13
Source File: SecurityEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SecurityItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #14
Source File: InfrastructureEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new InfrastructureItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ConfigurationItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new GlobalizeItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SecurityItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new WorldItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new OsgiItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ProfileItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new DeploymentItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SetupItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new EcoreItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ScriptItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #15
Source File: RecipeEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new RecipeItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #16
Source File: MemoryEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new MemoryItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #17
Source File: WorldEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new WorldItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new OsgiItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ProfileItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new DeploymentItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SetupItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new EcoreItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ConfigurationItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ScriptItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SecurityItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #18
Source File: OsgiEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new WorldItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new OsgiItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ProfileItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new DeploymentItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SetupItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new EcoreItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ConfigurationItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ScriptItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SecurityItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #19
Source File: ProfileEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new WorldItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new OsgiItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ProfileItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new DeploymentItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SetupItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new EcoreItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ConfigurationItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ScriptItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SecurityItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #20
Source File: SetupEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new WorldItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new OsgiItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ProfileItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new DeploymentItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SetupItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new EcoreItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ConfigurationItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ScriptItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SecurityItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #21
Source File: DeploymentEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new WorldItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new OsgiItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ProfileItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new DeploymentItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SetupItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new EcoreItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ConfigurationItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ScriptItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new SecurityItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #22
Source File: VisualInterfaceEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new VisualInterfaceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #23
Source File: DetailViewEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new DetailViewItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #24
Source File: ChartConfiguratorView.java From neoscada with Eclipse Public License 1.0 | 4 votes |
private void createEditingDomain () { final BasicCommandStack commandStack = new BasicCommandStack (); this.factory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); this.factory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); this.factory.addAdapterFactory ( new ChartItemProviderAdapterFactory () ); this.factory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { @Override public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { @Override public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // final Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } if ( ChartConfiguratorView.this.propertySheetPage != null && !ChartConfiguratorView.this.propertySheetPage.getControl ().isDisposed () ) { ChartConfiguratorView.this.propertySheetPage.refresh (); } } } ); } } ); this.editingDomain = new AdapterFactoryEditingDomain ( this.factory, commandStack, new HashMap<Resource, Boolean> () ); this.actionBarContributor = new ChartActionBarContributor (); }
Example #25
Source File: ProtocolEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected void initializeEditingDomain () { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ProtocolItemProviderAdapterFactory () ); adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () ); // Create the command stack that will notify this editor as commands are executed. // BasicCommandStack commandStack = new BasicCommandStack (); // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. // commandStack.addCommandStackListener ( new CommandStackListener () { public void commandStackChanged ( final EventObject event ) { getContainer ().getDisplay ().asyncExec ( new Runnable () { public void run () { firePropertyChange ( IEditorPart.PROP_DIRTY ); // Try to select the affected objects. // Command mostRecentCommand = ( (CommandStack)event.getSource () ).getMostRecentCommand (); if ( mostRecentCommand != null ) { setSelectionToViewer ( mostRecentCommand.getAffectedObjects () ); } for ( Iterator<PropertySheetPage> i = propertySheetPages.iterator (); i.hasNext (); ) { PropertySheetPage propertySheetPage = i.next (); if ( propertySheetPage.getControl ().isDisposed () ) { i.remove (); } else { propertySheetPage.refresh (); } } } } ); } } ); // Create the editing domain with a special command stack. // editingDomain = new AdapterFactoryEditingDomain ( adapterFactory, commandStack, new HashMap<Resource, Boolean> () ); }
Example #26
Source File: ModelEditingManager.java From graph-editor with Eclipse Public License 1.0 | 2 votes |
/** * Creates a new model editing manager. Only one instance should exist per {@link DefaultGraphEditor} instance. * * @param commandStackListener the {@link CommandStackListener} that listens for changes in the model */ public ModelEditingManager(final CommandStackListener commandStackListener) { this.commandStackListener = commandStackListener; }
Example #27
Source File: GraphEditorController.java From graph-editor with Eclipse Public License 1.0 | 2 votes |
/** * Creates the listener implementation for when a command is executed on the command stack. * * <p> * The current approach is brute force - the entire view and all secondary managers are reinitialized. * </p> * * @return the created command stack listener */ private CommandStackListener createCommandStackListener() { return event -> initializeAll(); }