Java 类org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory 实例源码

项目:econ-na-2014-emf-edit    文件:NotYourFathersSWT.java   
protected TreeViewer createViewer(Composite composite) {
    TreeViewer treeViewer = new TreeViewer(composite);
    treeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory();
    adapterFactory.addAdapterFactory(new DecoratorEXTLibraryItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EXTLibraryItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new TreeItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());

    treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
    treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));

    return treeViewer;
}
项目:DarwinSPL    文件:DwprofileAdapterFactoryProvider.java   
public AdapterFactory getAdapterFactory() {
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    return adapterFactory;
}
项目:DarwinSPL    文件:DwprofileCodeCompletionHelper.java   
protected Image getImage(EObject element) {
    if (!Platform.isRunning()) {
        return null;
    }
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
    return labelProvider.getImage(element);
}
项目:DarwinSPL    文件:HyexpressionCodeCompletionHelper.java   
protected Image getImage(EObject element) {
    if (!Platform.isRunning()) {
        return null;
    }
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
    return labelProvider.getImage(element);
}
项目:DarwinSPL    文件:HyexpressionAdapterFactoryProvider.java   
public AdapterFactory getAdapterFactory() {
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    return adapterFactory;
}
项目:DarwinSPL    文件:HyvalidityformulaCodeCompletionHelper.java   
protected Image getImage(EObject element) {
    if (!Platform.isRunning()) {
        return null;
    }
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
    return labelProvider.getImage(element);
}
项目:DarwinSPL    文件:HyvalidityformulaAdapterFactoryProvider.java   
public AdapterFactory getAdapterFactory() {
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    return adapterFactory;
}
项目:DarwinSPL    文件:HydatavalueCodeCompletionHelper.java   
protected Image getImage(EObject element) {
    if (!Platform.isRunning()) {
        return null;
    }
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
    return labelProvider.getImage(element);
}
项目:DarwinSPL    文件:HydatavalueAdapterFactoryProvider.java   
public AdapterFactory getAdapterFactory() {
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    return adapterFactory;
}
项目:DarwinSPL    文件:HymappingAdapterFactoryProvider.java   
public AdapterFactory getAdapterFactory() {
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    return adapterFactory;
}
项目:DarwinSPL    文件:HymappingCodeCompletionHelper.java   
protected Image getImage(EObject element) {
    if (!Platform.isRunning()) {
        return null;
    }
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
    return labelProvider.getImage(element);
}
项目:DarwinSPL    文件:HyconstraintsCodeCompletionHelper.java   
protected Image getImage(EObject element) {
    if (!Platform.isRunning()) {
        return null;
    }
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
    return labelProvider.getImage(element);
}
项目:DarwinSPL    文件:HyconstraintsAdapterFactoryProvider.java   
public AdapterFactory getAdapterFactory() {
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    return adapterFactory;
}
项目:DarwinSPL    文件:HymanifestAdapterFactoryProvider.java   
public AdapterFactory getAdapterFactory() {
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    return adapterFactory;
}
项目:DarwinSPL    文件:HymanifestCodeCompletionHelper.java   
protected Image getImage(EObject element) {
    if (!Platform.isRunning()) {
        return null;
    }
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(adapterFactory);
    return labelProvider.getImage(element);
}
项目:NEXCORE-UML-Modeler    文件:UiCorePlugin.java   
/**
 * 
 * 
 * @param factories
 *            void
 */
@SuppressWarnings("unchecked")
protected void fillItemProviderFactories(List factories) {
    factories.add(new EcoreItemProviderAdapterFactory());
    factories.add(new ReflectiveItemProviderAdapterFactory());
    factories.add(new UMLItemProviderAdapterFactory());
    // factories.add(new RelativeItemProviderAdapterFactory());
}
项目:limpet    文件:StackedchartsEditControl.java   
public StackedchartsEditControl(Composite parent)
{
  super(parent, SWT.NONE);

  setLayout(new FillLayout());

  editDomain = new EditDomain();

  viewer = new ScrollingGraphicalViewer();

  // connect external Drop support
  // add Dataset to Axis

  viewer.addDropTargetListener(new ProxyDropTargetListener(
      new DatasetToAxisDropTargetListener(viewer),
      new DatasetToAxisLandingDropTargetListener(viewer),
      new ScatterSetToScatterSetContainerTargetListener(viewer),
      new DatasetToChartDropTargetListener(viewer)
      ));

  viewer.createControl(this);
  editDomain.addViewer(viewer);

  viewer.getControl().setBackground(ColorConstants.listBackground);

  viewer.setEditPartFactory(new StackedChartsEditPartFactory());

  // emf edit domain
  adapterFactory =
      new ComposedAdapterFactory(
          ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
  BasicCommandStack commandStack = new BasicCommandStack();
  adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
  adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
  adapterFactory
      .addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
  emfEditingDomain =
      new AdapterFactoryEditingDomain(adapterFactory, commandStack);

}
项目:anatlyzer    文件:UiUtils.java   
public static IContentProvider getContentProviderForMetamodelViewer(Resource metamodelResource) {       
    // From EcoreEditor
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);

    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());

    return new AdapterFactoryContentProvider(adapterFactory);

}
项目:anatlyzer    文件:UiUtils.java   
public static ILabelProvider getLabelProviderForMetamodelViewer(Resource metamodelResource) {
    // From EcoreEditor
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);

    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());

    return new AdapterFactoryLabelProvider(adapterFactory);

}
项目:anatlyzer    文件:AbstractAtlExplanation.java   
protected void createMetamodelViewer(Composite composite, String mmName, EObject revealedElement) {
    TreeViewer selectionViewer = new TreeViewer(composite);

    // From EcoreEditor
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);

    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());

    selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
    selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    //selectionViewer.setLabelProvider(new DecoratingColumLabelProvider(new AdapterFactoryLabelProvider(adapterFactory), null));
            // new DiagnosticDecorator(editingDomain, selectionViewer, EcoreEditorPlugin.getPlugin().getDialogSettings())));
    //  selectionViewer.setInput(editingDomain.getResourceSet());
    //  selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);



    Resource r = getAnalysis().getNamespace().getLogicalNamesToMetamodels().get(mmName);
    selectionViewer.setInput(r);

    if ( revealedElement != null ) {
        // Reveal the problematic meta-model element
        selectionViewer.setSelection(new StructuredSelection(revealedElement), true);
    }
}
项目: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    文件: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    文件:OsgiEditor.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    文件: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    文件: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> () );
}
项目: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>());
}
项目:time4sys    文件:AnalysisEditor.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 AnalysisItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new NfpItemProviderAdapterFactory());
    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>());
}
项目:time4sys    文件:ConstraintsEditor.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 ConstraintsItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new AnalysisItemProviderAdapterFactory());
    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>());
}
项目:time4sys    文件:DesignEditor.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 DesignItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new GqamItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new GrmItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new SrmItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new HrmItemProviderAdapterFactory());
    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>());
}
项目:DarwinSPL    文件:DwprofileOutlinePage.java   
public void createControl(Composite parent) {
    treeViewer = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileOutlinePageTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    Object[] listeners = selectionChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
        treeViewer.addSelectionChangedListener(l);
    }
    selectionChangedListeners.clear();
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(adapterFactory) {

        @Override
        public void notifyChanged(Notification notification) {
            if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                viewerRefresh = new ViewerRefresh(viewer) {

                    protected void refresh(IViewerNotification notification) {
                        if (viewer instanceof de.darwinspl.preferences.resource.dwprofile.ui.DwprofileOutlinePageTreeViewer) {
                            de.darwinspl.preferences.resource.dwprofile.ui.DwprofileOutlinePageTreeViewer pageTreeViewer = (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileOutlinePageTreeViewer) viewer;
                            pageTreeViewer.setSuppressNotifications(true);
                            super.refresh(notification);
                            pageTreeViewer.setSuppressNotifications(false);
                        } else {
                            super.refresh(notification);
                        }
                    }
                };
            }
            super.notifyChanged(notification);
        }
    };

    treeViewer.setAutoExpandLevel(AUTO_EXPAND_LEVEL);
    treeViewer.setContentProvider(contentProvider);
    treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    Resource resource = resourceProvider.getResource();
    treeViewer.setInput(resource);
    if (resource != null) {
        // Select the root object in the view.
        treeViewer.setSelection(new StructuredSelection(resource), true);
    }
    treeViewer.setComparator(new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileOutlinePageTreeViewerComparator());
    createContextMenu();
    createActions();
}
项目:DarwinSPL    文件:HyexpressionOutlinePage.java   
public void createControl(Composite parent) {
    treeViewer = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionOutlinePageTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    Object[] listeners = selectionChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
        treeViewer.addSelectionChangedListener(l);
    }
    selectionChangedListeners.clear();
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(adapterFactory) {

        @Override
        public void notifyChanged(Notification notification) {
            if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                viewerRefresh = new ViewerRefresh(viewer) {

                    protected void refresh(IViewerNotification notification) {
                        if (viewer instanceof eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionOutlinePageTreeViewer) {
                            eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionOutlinePageTreeViewer pageTreeViewer = (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionOutlinePageTreeViewer) viewer;
                            pageTreeViewer.setSuppressNotifications(true);
                            super.refresh(notification);
                            pageTreeViewer.setSuppressNotifications(false);
                        } else {
                            super.refresh(notification);
                        }
                    }
                };
            }
            super.notifyChanged(notification);
        }
    };

    treeViewer.setAutoExpandLevel(AUTO_EXPAND_LEVEL);
    treeViewer.setContentProvider(contentProvider);
    treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    Resource resource = resourceProvider.getResource();
    treeViewer.setInput(resource);
    if (resource != null) {
        // Select the root object in the view.
        treeViewer.setSelection(new StructuredSelection(resource), true);
    }
    treeViewer.setComparator(new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionOutlinePageTreeViewerComparator());
    createContextMenu();
    createActions();
}
项目:DarwinSPL    文件:HyvalidityformulaOutlinePage.java   
public void createControl(Composite parent) {
    treeViewer = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaOutlinePageTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    Object[] listeners = selectionChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
        treeViewer.addSelectionChangedListener(l);
    }
    selectionChangedListeners.clear();
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(adapterFactory) {

        @Override
        public void notifyChanged(Notification notification) {
            if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                viewerRefresh = new ViewerRefresh(viewer) {

                    protected void refresh(IViewerNotification notification) {
                        if (viewer instanceof eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaOutlinePageTreeViewer) {
                            eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaOutlinePageTreeViewer pageTreeViewer = (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaOutlinePageTreeViewer) viewer;
                            pageTreeViewer.setSuppressNotifications(true);
                            super.refresh(notification);
                            pageTreeViewer.setSuppressNotifications(false);
                        } else {
                            super.refresh(notification);
                        }
                    }
                };
            }
            super.notifyChanged(notification);
        }
    };

    treeViewer.setAutoExpandLevel(AUTO_EXPAND_LEVEL);
    treeViewer.setContentProvider(contentProvider);
    treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    Resource resource = resourceProvider.getResource();
    treeViewer.setInput(resource);
    if (resource != null) {
        // Select the root object in the view.
        treeViewer.setSelection(new StructuredSelection(resource), true);
    }
    treeViewer.setComparator(new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaOutlinePageTreeViewerComparator());
    createContextMenu();
    createActions();
}
项目:DarwinSPL    文件:HydatavalueOutlinePage.java   
public void createControl(Composite parent) {
    treeViewer = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueOutlinePageTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    Object[] listeners = selectionChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
        treeViewer.addSelectionChangedListener(l);
    }
    selectionChangedListeners.clear();
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(adapterFactory) {

        @Override
        public void notifyChanged(Notification notification) {
            if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                viewerRefresh = new ViewerRefresh(viewer) {

                    protected void refresh(IViewerNotification notification) {
                        if (viewer instanceof eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueOutlinePageTreeViewer) {
                            eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueOutlinePageTreeViewer pageTreeViewer = (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueOutlinePageTreeViewer) viewer;
                            pageTreeViewer.setSuppressNotifications(true);
                            super.refresh(notification);
                            pageTreeViewer.setSuppressNotifications(false);
                        } else {
                            super.refresh(notification);
                        }
                    }
                };
            }
            super.notifyChanged(notification);
        }
    };

    treeViewer.setAutoExpandLevel(AUTO_EXPAND_LEVEL);
    treeViewer.setContentProvider(contentProvider);
    treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    Resource resource = resourceProvider.getResource();
    treeViewer.setInput(resource);
    if (resource != null) {
        // Select the root object in the view.
        treeViewer.setSelection(new StructuredSelection(resource), true);
    }
    treeViewer.setComparator(new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueOutlinePageTreeViewerComparator());
    createContextMenu();
    createActions();
}
项目:DarwinSPL    文件:HymappingOutlinePage.java   
public void createControl(Composite parent) {
    treeViewer = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingOutlinePageTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    Object[] listeners = selectionChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
        treeViewer.addSelectionChangedListener(l);
    }
    selectionChangedListeners.clear();
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(adapterFactory) {

        @Override
        public void notifyChanged(Notification notification) {
            if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                viewerRefresh = new ViewerRefresh(viewer) {

                    protected void refresh(IViewerNotification notification) {
                        if (viewer instanceof eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingOutlinePageTreeViewer) {
                            eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingOutlinePageTreeViewer pageTreeViewer = (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingOutlinePageTreeViewer) viewer;
                            pageTreeViewer.setSuppressNotifications(true);
                            super.refresh(notification);
                            pageTreeViewer.setSuppressNotifications(false);
                        } else {
                            super.refresh(notification);
                        }
                    }
                };
            }
            super.notifyChanged(notification);
        }
    };

    treeViewer.setAutoExpandLevel(AUTO_EXPAND_LEVEL);
    treeViewer.setContentProvider(contentProvider);
    treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    Resource resource = resourceProvider.getResource();
    treeViewer.setInput(resource);
    if (resource != null) {
        // Select the root object in the view.
        treeViewer.setSelection(new StructuredSelection(resource), true);
    }
    treeViewer.setComparator(new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingOutlinePageTreeViewerComparator());
    createContextMenu();
    createActions();
}
项目:DarwinSPL    文件:HyconstraintsOutlinePage.java   
public void createControl(Composite parent) {
    treeViewer = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsOutlinePageTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    Object[] listeners = selectionChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
        treeViewer.addSelectionChangedListener(l);
    }
    selectionChangedListeners.clear();
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(adapterFactory) {

        @Override
        public void notifyChanged(Notification notification) {
            if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                viewerRefresh = new ViewerRefresh(viewer) {

                    protected void refresh(IViewerNotification notification) {
                        if (viewer instanceof eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsOutlinePageTreeViewer) {
                            eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsOutlinePageTreeViewer pageTreeViewer = (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsOutlinePageTreeViewer) viewer;
                            pageTreeViewer.setSuppressNotifications(true);
                            super.refresh(notification);
                            pageTreeViewer.setSuppressNotifications(false);
                        } else {
                            super.refresh(notification);
                        }
                    }
                };
            }
            super.notifyChanged(notification);
        }
    };

    treeViewer.setAutoExpandLevel(AUTO_EXPAND_LEVEL);
    treeViewer.setContentProvider(contentProvider);
    treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    Resource resource = resourceProvider.getResource();
    treeViewer.setInput(resource);
    if (resource != null) {
        // Select the root object in the view.
        treeViewer.setSelection(new StructuredSelection(resource), true);
    }
    treeViewer.setComparator(new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsOutlinePageTreeViewerComparator());
    createContextMenu();
    createActions();
}
项目:DarwinSPL    文件:HymanifestOutlinePage.java   
public void createControl(Composite parent) {
    treeViewer = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestOutlinePageTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    Object[] listeners = selectionChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
        treeViewer.addSelectionChangedListener(l);
    }
    selectionChangedListeners.clear();
    ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
    adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
    AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(adapterFactory) {

        @Override
        public void notifyChanged(Notification notification) {
            if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                viewerRefresh = new ViewerRefresh(viewer) {

                    protected void refresh(IViewerNotification notification) {
                        if (viewer instanceof eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestOutlinePageTreeViewer) {
                            eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestOutlinePageTreeViewer pageTreeViewer = (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestOutlinePageTreeViewer) viewer;
                            pageTreeViewer.setSuppressNotifications(true);
                            super.refresh(notification);
                            pageTreeViewer.setSuppressNotifications(false);
                        } else {
                            super.refresh(notification);
                        }
                    }
                };
            }
            super.notifyChanged(notification);
        }
    };

    treeViewer.setAutoExpandLevel(AUTO_EXPAND_LEVEL);
    treeViewer.setContentProvider(contentProvider);
    treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    Resource resource = resourceProvider.getResource();
    treeViewer.setInput(resource);
    if (resource != null) {
        // Select the root object in the view.
        treeViewer.setSelection(new StructuredSelection(resource), true);
    }
    treeViewer.setComparator(new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestOutlinePageTreeViewerComparator());
    createContextMenu();
    createActions();
}