本文整理汇总了Java中org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory类的典型用法代码示例。如果您正苦于以下问题:Java EcoreItemProviderAdapterFactory类的具体用法?Java EcoreItemProviderAdapterFactory怎么用?Java EcoreItemProviderAdapterFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EcoreItemProviderAdapterFactory类属于org.eclipse.emf.ecore.provider包,在下文中一共展示了EcoreItemProviderAdapterFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createViewer
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的package包/类
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;
}
示例2: getAdapterFactory
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的package包/类
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;
}
示例3: getImage
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的package包/类
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);
}
示例4: fillItemProviderFactories
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的package包/类
/**
*
*
* @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());
}
示例5: StackedchartsEditControl
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的package包/类
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);
}
示例6: getContentProviderForMetamodelViewer
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的package包/类
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);
}
示例7: getLabelProviderForMetamodelViewer
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的package包/类
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);
}
示例8: createMetamodelViewer
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的package包/类
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);
}
}
示例9: initializeEditingDomain
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的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>());
}
示例10: initializeEditingDomain
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的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 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> () );
}
示例11: initializeEditingDomain
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的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 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> () );
}
示例12: initializeEditingDomain
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的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 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> () );
}
示例13: initializeEditingDomain
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的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 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> () );
}
示例14: initializeEditingDomain
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的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 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>());
}
示例15: initializeEditingDomain
import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; //导入依赖的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 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>());
}