org.eclipse.emf.edit.provider.ComposedAdapterFactory Java Examples
The following examples show how to use
org.eclipse.emf.edit.provider.ComposedAdapterFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProjectBuilder.java From neoscada with Eclipse Public License 1.0 | 6 votes |
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 () ); } }
Example #2
Source File: PreviewEditorImpl.java From neoscada with Eclipse Public License 1.0 | 6 votes |
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 ); }
Example #3
Source File: TestConnectorOperation.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
private AdapterFactoryEditingDomain createEditingDomain() { final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory( ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ConfigurationAdapterFactory()); adapterFactory.addAdapterFactory(new ProcessAdapterFactory()); // command stack that will notify this editor as commands are executed final BasicCommandStack commandStack = new BasicCommandStack(); // Create the editing domain with our adapterFactory and command stack. final AdapterFactoryEditingDomain editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>()); editingDomain.getResourceSet().getResourceFactoryRegistry().getExtensionToFactoryMap().put("conf", new ConfigurationResourceFactoryImpl()); return editingDomain; }
Example #4
Source File: ImportWorkspaceApplication.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
private boolean isSPDiagram(File file) { ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory( ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ProcessAdapterFactory()); adapterFactory.addAdapterFactory(new ParameterAdapterFactory()); adapterFactory.addAdapterFactory(new ConnectorDefinitionAdapterFactory()); adapterFactory .addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory .addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); AdapterFactoryEditingDomain editingDomain = new AdapterFactoryEditingDomain(adapterFactory, new BasicCommandStack(), new HashMap<Resource, Boolean>()); URI fileURI = URI.createFileURI(file.getAbsolutePath()); editingDomain.getResourceSet().getLoadOptions().put(XMIResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); Resource resource = editingDomain.getResourceSet().getResource(fileURI, true); MainProcess process = (MainProcess) resource.getContents().get(0); return process.getConfigId().toString().contains("sp"); }
Example #5
Source File: ContractInputTreeViewer.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public void initialize(final ContractInputController inputController, final IMessageManager messageManager, final EMFDataBindingContext emfDataBindingContext) { this.messageManager = messageManager; this.inputController = inputController; this.emfDataBindingContext = emfDataBindingContext; final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory( ComposedAdapterFactory.Descriptor.Registry.INSTANCE); propertySourceProvider = new ContractInputTypePropertyDescriptor(adapterFactory); adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(adapterFactory); getTree().setHeaderVisible(true); getTree().setLinesVisible(true); addFilter(new ComplexTypeChildrenViewerFilter()); final ObservableListTreeContentProvider contentProvider = new ObservableListTreeContentProvider( new ContractInputObservableFactory(), new ContractInputTreeStructureAdvisor()); setContentProvider(contentProvider); final CellNavigationStrategy cellNavigationStrategy = new AddRowOnEnterCellNavigationStrategy(this, inputController); final TreeViewerFocusCellManager focusCellManager = new TreeViewerFocusCellManager(this, new FocusCellOwnerDrawHighlighter( this), cellNavigationStrategy); TreeViewerEditor.create(this, focusCellManager, new CharriageColumnViewerEditorActivationStrategy(this), ColumnViewerEditor.TABBING_HORIZONTAL | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION); ColumnViewerToolTipSupport.enableFor(this); createColumns(); configureTableLayout(); }
Example #6
Source File: ConfigurationSynchronizer.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
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 ReflectiveItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ConfigurationAdapterFactory()); adapterFactory.addAdapterFactory(new ProcessAdapterFactory()); // command stack that will notify this editor as commands are executed final BasicCommandStack commandStack = new BasicCommandStack(); // Create the editing domain with our adapterFactory and command stack. editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>()); editingDomain.getResourceSet().getResourceFactoryRegistry().getExtensionToFactoryMap().put("conf", new ConfigurationResourceFactoryImpl()); }
Example #7
Source File: AbstractEMFRepositoryStore.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public AbstractEMFRepositoryStore() { super(); adapterFactory = new ComposedAdapterFactory( ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory .addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory .addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); addAdapterFactory(adapterFactory); }
Example #8
Source File: DataStyledTreeLabelProvider.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
private void initStyle() { imageProvider = new AdapterFactoryLabelProvider(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE)) ; italicGrey = new StyledString.Styler() { @Override public void applyStyles(TextStyle textStyle) { textStyle.font = BonitaStudioFontRegistry.getTransientDataFont(); textStyle.foreground = JFaceResources.getColorRegistry().get(JFacePreferences.QUALIFIER_COLOR); } }; }
Example #9
Source File: ActorMappingConfigurationWizardPage.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public ActorMappingConfigurationWizardPage() { super(ActorMappingConfigurationWizardPage.class.getName()); setTitle(Messages.actorMappingTitle); setDescription(Messages.actorMappingDesc); adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ActorMappingAdapterFactory()); }
Example #10
Source File: TestDocumentRefactor.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
private TransactionalEditingDomain createEditingDomain() { final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory( ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ProcessAdapterFactory()); // command stack that will notify this editor as commands are executed final TransactionalCommandStackImpl commandStack = new TransactionalCommandStackImpl(); // Create the editing domain with our adapterFactory and command stack. return new TransactionalEditingDomainImpl(adapterFactory, commandStack); }
Example #11
Source File: ExportBarWizardPage.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
protected ExportBarWizardPage() { super(ExportBarWizardPage.class.getName()); setTitle(Messages.buildTitle); setDescription(Messages.buildDesc); adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); final String confId = ConfigurationPlugin.getDefault().getPreferenceStore() .getString(ConfigurationPreferenceConstants.DEFAULT_CONFIGURATION); setConfigurationId(confId); }
Example #12
Source File: ComparisonExpressionEditor.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public ComparisonExpressionEditor(final EObject context) { this.context = context; adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterLabelProvider = new AdapterFactoryLabelProvider(adapterFactory); final Injector injector = ConditionModelActivator.getInstance() .getInjector(ConditionModelActivator.ORG_BONITASOFT_STUDIO_CONDITION_CONDITIONMODEL); if (context != null && context.eResource() != null) { final ConditionModelJavaValidator validator = injector.getInstance(ConditionModelJavaValidator.class); validator.setCurrentResourceSet(context.eResource().getResourceSet()); } }
Example #13
Source File: MoveConnectorWizardPage.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public MoveConnectorWizardPage(final AbstractProcess sourceProcess, final WritableValue targetLocationObservable, final WritableValue connectorEventObservable) { super(MoveConnectorWizardPage.class.getName(), Messages.switchContainerConnectorTitle, Pics.getWizban()); setDescription(Messages.switchContainerConnectorMessage); this.sourceProcess = sourceProcess; this.targetLocationObservable = targetLocationObservable; this.connectorEventObservable = connectorEventObservable; originalLocation = (ConnectableElement) targetLocationObservable.getValue(); adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); }
Example #14
Source File: ContractInputLabelProvider.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
public ContractInputLabelProvider() { final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterLabelProvider = new AdapterFactoryLabelProvider(adapterFactory); }
Example #15
Source File: WorldEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * 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> () ); }
Example #16
Source File: ContractInputExpressionProvider.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
public ContractInputExpressionProvider() { final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterLabelProvider = new AdapterFactoryLabelProvider(adapterFactory); }
Example #17
Source File: AbstractEMFRepositoryStore.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
protected abstract void addAdapterFactory( ComposedAdapterFactory adapterFactory);
Example #18
Source File: DiagramRepositoryStore.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Override protected void addAdapterFactory(final ComposedAdapterFactory adapterFactory) { adapterFactory.addAdapterFactory(new ProcessItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new NotationAdapterFactory()); }
Example #19
Source File: OrganizationRepositoryStore.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Override protected void addAdapterFactory(final ComposedAdapterFactory adapterFactory) { adapterFactory.addAdapterFactory(new OrganizationAdapterFactory()) ; }
Example #20
Source File: ProjectBuilder.java From neoscada with Eclipse Public License 1.0 | 4 votes |
public DeltaVisitor ( final IProgressMonitor monitor, final ComposedAdapterFactory adapterFactory, final Set<String> extensions ) { this.monitor = monitor; this.adapterFactory = adapterFactory; this.extensions = extensions; }
Example #21
Source File: MemoryEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * 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 MemoryItemProviderAdapterFactory () ); 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> () ); }
Example #22
Source File: RecipeEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * 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 RecipeItemProviderAdapterFactory () ); 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> () ); }
Example #23
Source File: InfrastructureEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * 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> () ); }
Example #24
Source File: GlobalizeEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * 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> () ); }
Example #25
Source File: ComponentEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * 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> () ); }
Example #26
Source File: ItemEditor.java From neoscada with Eclipse Public License 1.0 | 4 votes |
/** * 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 ItemItemProviderAdapterFactory () ); 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> () ); }
Example #27
Source File: CrossflowDiagramEditorPlugin.java From scava with Eclipse Public License 2.0 | 4 votes |
/** * @generated */ protected ComposedAdapterFactory createAdapterFactory() { ArrayList<AdapterFactory> factories = new ArrayList<AdapterFactory>(); fillItemProviderFactories(factories); return new ComposedAdapterFactory(factories); }
Example #28
Source File: DocumentExpressionEditor.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Override public Control createExpressionEditor(final Composite parent, final EMFDataBindingContext ctx) { mainComposite = new Composite(parent, SWT.NONE); mainComposite.setLayoutData(GridDataFactory.fillDefaults() .grab(true, true).create()); gridLayout = new GridLayout(1, false); mainComposite.setLayout(gridLayout); viewer = new TableViewer(mainComposite, SWT.FULL_SELECTION | SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL); final TableLayout layout = new TableLayout(); layout.addColumnData(new ColumnWeightData(100, false)); viewer.getTable().setLayout(layout); viewer.getTable().setLayoutData( GridDataFactory.fillDefaults().grab(true, true).create()); final TableViewerColumn columnViewer = new TableViewerColumn(viewer, SWT.NONE); final TableColumn column = columnViewer.getColumn(); column.setText(org.bonitasoft.studio.document.i18n.Messages.name); final TableColumnSorter sorter = new TableColumnSorter(viewer); sorter.setColumn(column); viewer.getTable().setHeaderVisible(true); viewer.setContentProvider(new ArrayContentProvider()); viewer.setLabelProvider(new AdapterFactoryLabelProvider( new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE)) { @Override public String getColumnText(final Object object, final int columnIndex) { if (object instanceof Document) { return ((Document) object).getName(); } return super.getColumnText(object, columnIndex); } }); viewer.addPostSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(final SelectionChangedEvent event) { if (!event.getSelection().isEmpty()) { DocumentExpressionEditor.this.fireSelectionChanged(); } } }); createReturnTypeComposite(parent); return mainComposite; }
Example #29
Source File: NameLabelProvider.java From neoscada with Eclipse Public License 1.0 | 4 votes |
public NameLabelProvider ( final Display display, final IObservableSet elements ) { super ( EMFProperties.value ( InfrastructurePackage.Literals.NAMED_APPLICATION__NAME ).observeDetail ( PojoProperties.value ( "master" ).observeDetail ( elements ) ) ); this.resourceManager = new LocalResourceManager ( JFaceResources.getResources ( display ) ); this.adapterFactory = new ComposedAdapterFactory ( ComposedAdapterFactory.Descriptor.Registry.INSTANCE ); }
Example #30
Source File: DebugConnectorLabelProvider.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
public DebugConnectorLabelProvider() { super(); adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); labelProvider = new AdapterFactoryLabelProvider(adapterFactory) ; }