Search in sources :

Example 1 with AuditItemProviderAdapterFactory

use of org.eclipse.sirius.viewpoint.description.audit.provider.AuditItemProviderAdapterFactory in project InformationSystem by ObeoNetwork.

the class ClassDiagramConfigurationEditor method initializeEditingDomain.

/**
 * 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 ClassDiagramConfigurationItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ViewpointItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new DescriptionItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new StyleItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ToolItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ValidationItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new AuditItemProviderAdapterFactory());
    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>());
}
Also used : AdapterFactoryEditingDomain(org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain) BasicCommandStack(org.eclipse.emf.common.command.BasicCommandStack) CommandStack(org.eclipse.emf.common.command.CommandStack) ToolItemProviderAdapterFactory(org.eclipse.sirius.viewpoint.description.tool.provider.ToolItemProviderAdapterFactory) ValidationItemProviderAdapterFactory(org.eclipse.sirius.viewpoint.description.validation.provider.ValidationItemProviderAdapterFactory) PropertySheetPage(org.eclipse.ui.views.properties.PropertySheetPage) IPropertySheetPage(org.eclipse.ui.views.properties.IPropertySheetPage) ExtendedPropertySheetPage(org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage) CommandStackListener(org.eclipse.emf.common.command.CommandStackListener) ResourceItemProviderAdapterFactory(org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory) LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) StyleItemProviderAdapterFactory(org.eclipse.sirius.viewpoint.description.style.provider.StyleItemProviderAdapterFactory) ComposedAdapterFactory(org.eclipse.emf.edit.provider.ComposedAdapterFactory) BasicCommandStack(org.eclipse.emf.common.command.BasicCommandStack) EventObject(java.util.EventObject) EcoreItemProviderAdapterFactory(org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory) ReflectiveItemProviderAdapterFactory(org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory) Command(org.eclipse.emf.common.command.Command) DescriptionItemProviderAdapterFactory(org.eclipse.sirius.viewpoint.description.provider.DescriptionItemProviderAdapterFactory) ViewpointItemProviderAdapterFactory(org.eclipse.sirius.viewpoint.provider.ViewpointItemProviderAdapterFactory) ClassDiagramConfigurationItemProviderAdapterFactory(org.obeonetwork.tools.classdiagramconfiguration.provider.ClassDiagramConfigurationItemProviderAdapterFactory) AuditItemProviderAdapterFactory(org.eclipse.sirius.viewpoint.description.audit.provider.AuditItemProviderAdapterFactory)

Aggregations

EventObject (java.util.EventObject)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 BasicCommandStack (org.eclipse.emf.common.command.BasicCommandStack)1 Command (org.eclipse.emf.common.command.Command)1 CommandStack (org.eclipse.emf.common.command.CommandStack)1 CommandStackListener (org.eclipse.emf.common.command.CommandStackListener)1 EcoreItemProviderAdapterFactory (org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory)1 AdapterFactoryEditingDomain (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain)1 ComposedAdapterFactory (org.eclipse.emf.edit.provider.ComposedAdapterFactory)1 ReflectiveItemProviderAdapterFactory (org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory)1 ResourceItemProviderAdapterFactory (org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory)1 ExtendedPropertySheetPage (org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage)1 AuditItemProviderAdapterFactory (org.eclipse.sirius.viewpoint.description.audit.provider.AuditItemProviderAdapterFactory)1 DescriptionItemProviderAdapterFactory (org.eclipse.sirius.viewpoint.description.provider.DescriptionItemProviderAdapterFactory)1 StyleItemProviderAdapterFactory (org.eclipse.sirius.viewpoint.description.style.provider.StyleItemProviderAdapterFactory)1 ToolItemProviderAdapterFactory (org.eclipse.sirius.viewpoint.description.tool.provider.ToolItemProviderAdapterFactory)1 ValidationItemProviderAdapterFactory (org.eclipse.sirius.viewpoint.description.validation.provider.ValidationItemProviderAdapterFactory)1 ViewpointItemProviderAdapterFactory (org.eclipse.sirius.viewpoint.provider.ViewpointItemProviderAdapterFactory)1 IPropertySheetPage (org.eclipse.ui.views.properties.IPropertySheetPage)1