Java 类org.eclipse.emf.edit.provider.ComposedAdapterFactory 实例源码

项目:neoscada    文件:ProjectBuilder.java   
protected void validateAll ( final IProject project, final ComposedAdapterFactory adapterFactory, final Set<String> extensions, final IProgressMonitor monitor )
{
    logger.debug ( "Validating all resources of {}", project );

    try
    {
        project.accept ( new IResourceVisitor () {

            @Override
            public boolean visit ( final IResource resource ) throws CoreException
            {
                return handleResource ( null, resource, adapterFactory, extensions, monitor );
            }
        } );
    }
    catch ( final CoreException e )
    {
        StatusManager.getManager ().handle ( e.getStatus () );
    }
}
项目:neoscada    文件:PreviewEditorImpl.java   
public PreviewEditorImpl ()
{
    this.adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE );
    this.adapterFactory.addAdapterFactory ( new ResourceItemProviderAdapterFactory () );
    this.adapterFactory.addAdapterFactory ( new ReflectiveItemProviderAdapterFactory () );

    final BasicCommandStack commandStack = new BasicCommandStack ();

    this.editingDomain = new AdapterFactoryEditingDomain ( this.adapterFactory, commandStack, new HashMap<Resource, Boolean> () );

    this.factoryContext = new FactoryContext () {

        @Override
        public void loadedResource ( final URI uri )
        {
            handleLoadedResource ( uri );
        }
    };

    ResourcesPlugin.getWorkspace ().addResourceChangeListener ( this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE );
}
项目:gemoc-studio-modeldebugging    文件:CustomThreadItemProvider.java   
/**
 * Constructor.
 * 
 * @param adapterFactory
 *            the {@link AdapterFactory}.
 */
public CustomThreadItemProvider(AdapterFactory adapterFactory) {
    super(adapterFactory);

    efactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    efactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    CustomDebugItemProviderAdapterFactory debugFactory = new CustomDebugItemProviderAdapterFactory();
    efactory.addAdapterFactory(debugFactory);
    efactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
}
项目:gemoc-studio-modeldebugging    文件:CustomStackFrameItemProvider.java   
/**
 * Constructor.
 * 
 * @param adapterFactory
 *            the {@link AdapterFactory}.
 */
public CustomStackFrameItemProvider(AdapterFactory adapterFactory) {
    super(adapterFactory);

    efactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    efactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    CustomDebugItemProviderAdapterFactory debugFactory = new CustomDebugItemProviderAdapterFactory();
    efactory.addAdapterFactory(debugFactory);
    efactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
}
项目:gemoc-studio-modeldebugging    文件:DSLBreakpoint.java   
/**
 * Initializes the {@link ComposedAdapterFactory} used for markers.
 * 
 * @return the {@link ComposedAdapterFactory} used for markers
 */
private static ComposedAdapterFactory initLabelProvider() {
    final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(
            ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    CustomDebugItemProviderAdapterFactory debugFactory = new CustomDebugItemProviderAdapterFactory();
    adapterFactory.addAdapterFactory(debugFactory);
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    return adapterFactory;
}
项目:gemoc-studio-modeldebugging    文件:DSLDebugModelPresentation.java   
/**
 * Constructor.
 */
public DSLDebugModelPresentation() {
    super();
    final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(
            ComposedAdapterFactory.Descriptor.Registry.INSTANCE);

    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    CustomDebugItemProviderAdapterFactory debugFactory = new CustomDebugItemProviderAdapterFactory();
    adapterFactory.addAdapterFactory(debugFactory);
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    eLabelProvider = new AdapterFactoryLabelProvider(adapterFactory);
}
项目:gemoc-studio-modeldebugging    文件:SelectDiagramDefinitionPage.java   
public SelectDiagramDefinitionPage(
        NewGemocDebugRepresentationWizard newGemocDebugRepresentationWizard) {
    super("Select diagram definition");
    this.newGemocDebugRepresentationWizard = newGemocDebugRepresentationWizard;

    adapterFactory = new ComposedAdapterFactory(
            ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory
            .addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory
            .addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
}
项目:neoscada    文件:ProjectBuilder.java   
@Override
protected IProject[] build ( final int kind, final Map<String, String> args, final IProgressMonitor monitor ) throws CoreException
{
    final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE );
    try
    {

        logger.debug ( "Requested build" );

        final Set<String> extensions = getExtensions ( args );

        IResourceDelta delta = null;
        if ( kind != FULL_BUILD )
        {
            delta = getDelta ( getProject () );
        }

        if ( delta == null || kind == FULL_BUILD )
        {
            if ( isInterestingProject ( getProject () ) )
            {
                validateAll ( getProject (), adapterFactory, extensions, monitor );
            }
        }
        else
        {
            delta.accept ( new DeltaVisitor ( monitor, adapterFactory, extensions ) );
        }
        return null;
    }
    finally
    {
        adapterFactory.dispose ();
    }
}
项目:neoscada    文件:ProjectBuilder.java   
public boolean handleResource ( final IResourceDelta delta, final IResource resource, final ComposedAdapterFactory adapterFactory, final Set<String> extensions, final IProgressMonitor monitor )
{
    logger.debug ( "Handle resource - file: {}", resource );

    if ( resource instanceof IProject )
    {
        return isInterestingProject ( (IProject)resource );
    }

    if ( resource instanceof IFolder )
    {
        return true;
    }

    if ( resource instanceof IFile )
    {
        final IFile file = (IFile)resource;
        if ( !isModelFile ( file, extensions ) )
        {
            return false;
        }

        if ( delta == null || delta.getKind () != IResourceDelta.REMOVED )
        {
            validateFile ( file, adapterFactory, monitor );
        }
    }
    return false;
}
项目:smarthome-cep-demonstrator    文件:SmarthomeEditor.java   
/**
 * 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 SmarthomeItemProviderAdapterFactory());
    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>());
}
项目:SimQRI    文件:MetamodelEditor.java   
/**
 * 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 MetamodelItemProviderAdapterFactory());
    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>());
}
项目:gemoc-studio-modeldebugging    文件:TracingannotationsEditor.java   
/**
 * 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 TracingannotationsItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    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>());
}
项目:neoscada    文件:ProtocolEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:ChartEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:ChartConfiguratorView.java   
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 ();
}
项目:neoscada    文件:DetailViewEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:VisualInterfaceEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:ProjectBuilder.java   
public ProjectDiagnostician ( final ComposedAdapterFactory adapterFactory )
{
    this.adapterFactory = adapterFactory;
}
项目:neoscada    文件:ProjectBuilder.java   
public DeltaVisitor ( final IProgressMonitor monitor, final ComposedAdapterFactory adapterFactory, final Set<String> extensions )
{
    this.monitor = monitor;
    this.adapterFactory = adapterFactory;
    this.extensions = extensions;
}
项目:OCCI-Studio    文件:SlaEditor.java   
/**
 * 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 SlaItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new OCCIItemProviderAdapterFactory());
    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>());
}
项目:OCCI-Studio    文件:OCCIEditor.java   
/**
 * 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 OCCIItemProviderAdapterFactory());
    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>());
}
项目:neoscada    文件:DeploymentEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:SetupEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:ProfileEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:WorldEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:MemoryEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:RecipeEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:InfrastructureEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:SecurityEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:GlobalizeEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:ComponentEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:ItemEditor.java   
/**
 * 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> () );
}
项目:neoscada    文件:NameLabelProvider.java   
public NameLabelProvider ( final Display display, final IObservableSet elements )
{
    super ( EMFProperties.value ( InfrastructurePackage.Literals.NAMED_APPLICATION__NAME ).observeDetail ( PojoProperties.value ( "master" ).observeDetail ( elements ) ) );
    this.resourceManager = new LocalResourceManager ( JFaceResources.getResources ( display ) );
    this.adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE );
}
项目:neoscada    文件:ConfigurationEditor.java   
/**
 * 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> () );
}
项目:OCCI-Studio    文件:InfrastructureEditor.java   
/**
 * 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 OCCIItemProviderAdapterFactory());
    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>());
}
项目:gemoc-studio    文件:GexpressionsEditor.java   
/**
 * 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 GexpressionsItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    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>());
}
项目:gemoc-studio    文件:FsmEditor.java   
/**
 * 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 FsmItemProviderAdapterFactory());
    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>());
}
项目:time4sys    文件:NfpEditor.java   
/**
 * 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 NfpItemProviderAdapterFactory());
    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>());
}
项目:time4sys    文件:GqamEditor.java   
/**
 * 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 GqamItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new GrmItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new NfpItemProviderAdapterFactory());
    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>());
}
项目:time4sys    文件:TraceEditor.java   
/**
 * 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 TraceItemProviderAdapterFactory());
    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>());
}