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; }
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; }
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); }
/** * * * @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()); }
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); }
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); }
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); }
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); } }
/** * 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>()); }
/** * 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> () ); }
/** * 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> () ); }
/** * 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> () ); }
/** * 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> () ); }
/** * 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>()); }
/** * 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>()); }
/** * 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>()); }
/** * 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>()); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }
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(); }