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 ); }
private void createEditingDomain() { // Create an adapter factory that yields item providers. // ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new BibtexItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); // Create the command stack that will notify this editor as commands are // executed. // BasicCommandStack commandStack = new BasicCommandStack(); // Create the editing domain with a special command stack. // sharedEditingDomain = new AdapterFactoryEditingDomain(adapterFactory,commandStack, new HashMap<Resource, Boolean>()); }
/** * Opens the {@link EObject first instruction} selection dialog. * * @param shell * the {@link Shell} to use for display * @param resourceSet * the {@link ResourceSet} to get the first instruction from * @return the selected first instruction {@link URI} if any selected, <code>null</code> otherwise */ public static EObject openFirstInstructionSelection(final Shell shell, ResourceSet resourceSet) { final EObject res; final ComposedAdapterFactory fatory = new ComposedAdapterFactory( ComposedAdapterFactory.Descriptor.Registry.INSTANCE); fatory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); fatory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell, new AdapterFactoryLabelProvider(fatory), new AdapterFactoryContentProvider(fatory)); dialog.setTitle("Select first instruction"); dialog.setMessage("Select the first instruction:"); dialog.setInput(resourceSet); if (dialog.open() == Window.OK) { res = (EObject)dialog.getFirstResult(); } else { res = null; } fatory.dispose(); return res; }
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; }
/** * 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()); }
/** * 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()); }
/** * Constructor. * * @param adapterFactory * the {@link AdapterFactory}. */ public CustomDebugTargetItemProvider(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()); }
/** * 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; }
/** * 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); }
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()); }
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); }
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); } }
@Override protected void createPages() { OICEditorInput editorInput = (OICEditorInput)getEditorInput(); OperationInterfaceContainer oic = editorInput.getOperationInterfaceContainer(); EditingDomain ed = TransactionUtil.getEditingDomain(oic); adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ApplicationAdapterFactory()); adapterFactory.addAdapterFactory(new ArchitectureAdapterFactory()); adapterFactory.addAdapterFactory(new ParametertypeAdapterFactory()); adapterFactory.addAdapterFactory(new OverviewAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new EcoreAdapterFactory()); editingDomain = new AdapterFactoryEditingDomain(adapterFactory, ed.getCommandStack()); try { this.importEditor = new ImportEditor(); //this.importEditor.init(getEditorSite(), getEditorInput()); int pageIndex = addPage(importEditor, getEditorInput()); setPageText(pageIndex, "Import"); this.interfacesEditor = new InterfacesEditor(this); //this.interfacesEditor.init(getEditorSite(), getEditorInput()); pageIndex = addPage(interfacesEditor, getEditorInput()); System.out.println(pageIndex); setPageText(pageIndex, "Provided interfaces"); setActiveEditor(interfacesEditor); } catch (PartInitException e) { e.printStackTrace(); } }
public EditDiagramEditor() { adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new MethodItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new EcoreAdapterFactory()); }
/** * @generated */ protected void fillItemProviderFactories(List<AdapterFactory> factories) { factories .add(new SimpleBPMN.provider.SimpleBPMNItemProviderAdapterFactory()); factories.add(new ResourceItemProviderAdapterFactory()); factories.add(new ReflectiveItemProviderAdapterFactory()); }
/** * @generated */ protected void fillItemProviderFactories(List<AdapterFactory> factories) { factories.add( new edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.provider.ICSE15_SequenceDiagram_MAVOItemProviderAdapterFactory()); factories.add(new MAVOItemProviderAdapterFactory()); factories.add(new ResourceItemProviderAdapterFactory()); factories.add(new ReflectiveItemProviderAdapterFactory()); }
/** * @generated */ protected void fillItemProviderFactories(List<AdapterFactory> factories) { factories .add(new edu.toronto.cs.se.modelepedia.necsis14_classdiagram.provider.NECSIS14_ClassDiagramItemProviderAdapterFactory()); factories.add(new ResourceItemProviderAdapterFactory()); factories.add(new ReflectiveItemProviderAdapterFactory()); }
/** * @generated */ protected void fillItemProviderFactories(List<AdapterFactory> factories) { factories .add(new edu.toronto.cs.se.modelepedia.necsis14_databaseschema.provider.NECSIS14_DatabaseSchemaItemProviderAdapterFactory()); factories.add(new ResourceItemProviderAdapterFactory()); factories.add(new ReflectiveItemProviderAdapterFactory()); }