當前位置: 首頁>>代碼示例>>Java>>正文


Java ComposedAdapterFactory類代碼示例

本文整理匯總了Java中org.eclipse.emf.edit.provider.ComposedAdapterFactory的典型用法代碼示例。如果您正苦於以下問題:Java ComposedAdapterFactory類的具體用法?Java ComposedAdapterFactory怎麽用?Java ComposedAdapterFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ComposedAdapterFactory類屬於org.eclipse.emf.edit.provider包,在下文中一共展示了ComposedAdapterFactory類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: validateAll

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
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 () );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:21,代碼來源:ProjectBuilder.java

示例2: PreviewEditorImpl

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
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 );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:22,代碼來源:PreviewEditorImpl.java

示例3: CustomThreadItemProvider

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
/**
 * 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());
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:16,代碼來源:CustomThreadItemProvider.java

示例4: CustomStackFrameItemProvider

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
/**
 * 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());
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:16,代碼來源:CustomStackFrameItemProvider.java

示例5: initLabelProvider

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
/**
 * 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;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:15,代碼來源:DSLBreakpoint.java

示例6: DSLDebugModelPresentation

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:15,代碼來源:DSLDebugModelPresentation.java

示例7: SelectDiagramDefinitionPage

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
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());
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:13,代碼來源:SelectDiagramDefinitionPage.java

示例8: build

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
@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 ();
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:36,代碼來源:ProjectBuilder.java

示例9: handleResource

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:30,代碼來源:ProjectBuilder.java

示例10: initializeEditingDomain

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
/**
 * 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>());
}
 
開發者ID:IncQueryLabs,項目名稱:smarthome-cep-demonstrator,代碼行數:54,代碼來源:SmarthomeEditor.java

示例11: initializeEditingDomain

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
/**
 * 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>());
}
 
開發者ID:cetic,項目名稱:SimQRI,代碼行數:54,代碼來源:MetamodelEditor.java

示例12: initializeEditingDomain

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
/**
 * 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>());
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:55,代碼來源:TracingannotationsEditor.java

示例13: initializeEditingDomain

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
/**
 * 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> () );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:63,代碼來源:ProtocolEditor.java

示例14: initializeEditingDomain

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
/**
 * 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> () );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:69,代碼來源:ChartEditor.java

示例15: createEditingDomain

import org.eclipse.emf.edit.provider.ComposedAdapterFactory; //導入依賴的package包/類
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 ();
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:43,代碼來源:ChartConfiguratorView.java


注:本文中的org.eclipse.emf.edit.provider.ComposedAdapterFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。