Java Code Examples for org.eclipse.emf.transaction.TransactionalEditingDomain#isReadOnly()
The following examples show how to use
org.eclipse.emf.transaction.TransactionalEditingDomain#isReadOnly() .
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: DiagramPartitioningDocumentProvider.java From statecharts with Eclipse Public License 1.0 | 5 votes |
@Override protected ElementInfo createElementInfo(Object element) throws CoreException { ElementInfo info = super.createElementInfo(element); if (element instanceof IDiagramEditorInput) { Resource eResource = ((IDiagramEditorInput) element).getDiagram().eResource(); TransactionalEditingDomain sharedDomain = DiagramPartitioningUtil.getSharedDomain(); if (eResource.isLoaded() && !sharedDomain.isReadOnly(eResource) && eResource.isModified()) { info.fCanBeSaved = true; } } return info; }
Example 2
Source File: CommandUtil.java From statecharts with Eclipse Public License 1.0 | 5 votes |
public static List<IFile> getAffectedFiles(ResourceSet resourceSet) { final List<IFile> affectedFiles = new ArrayList<IFile>(); final TransactionalEditingDomain domain = TransactionUtil .getEditingDomain(resourceSet); for (final Resource next : resourceSet.getResources()) { if (!domain.isReadOnly(next)) { final IFile file = WorkspaceSynchronizer .getUnderlyingFile(next); Assert.isNotNull(file, next.getURI() + ""); affectedFiles.add(file); } } return affectedFiles; }