Search in sources :

Example 1 with IDirtyStateManagerExtension

use of org.eclipse.xtext.ui.editor.IDirtyStateManagerExtension in project xtext-eclipse by eclipse.

the class JdtTypesProposalProvider method getDirtyTypeNames.

/**
 * @since 2.8
 */
protected Set<String> getDirtyTypeNames() {
    Iterable<IEObjectDescription> dirtyTypes = dirtyStateManager.getExportedObjectsByType(TypesPackage.Literals.JVM_TYPE);
    final Set<String> dirtyNames = new HashSet<String>();
    for (IEObjectDescription description : dirtyTypes) {
        dirtyNames.add(description.getQualifiedName().toString());
    }
    for (URI dirtyURI : ((IDirtyStateManagerExtension) dirtyStateManager).getDirtyResourceURIs()) {
        IResourceDescriptions index = resourceDescriptionsProvider.createPersistedResourceDescriptions();
        IResourceDescription indexedResourceDescription = index.getResourceDescription(dirtyURI);
        if (indexedResourceDescription != null)
            for (IEObjectDescription desc : indexedResourceDescription.getExportedObjectsByType(TypesPackage.Literals.JVM_TYPE)) {
                dirtyNames.add(desc.getQualifiedName().toString());
            }
    }
    return dirtyNames;
}
Also used : IResourceDescription(org.eclipse.xtext.resource.IResourceDescription) IDirtyStateManagerExtension(org.eclipse.xtext.ui.editor.IDirtyStateManagerExtension) IResourceDescriptions(org.eclipse.xtext.resource.IResourceDescriptions) StyledString(org.eclipse.jface.viewers.StyledString) URI(org.eclipse.emf.common.util.URI) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 URI (org.eclipse.emf.common.util.URI)1 StyledString (org.eclipse.jface.viewers.StyledString)1 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)1 IResourceDescription (org.eclipse.xtext.resource.IResourceDescription)1 IResourceDescriptions (org.eclipse.xtext.resource.IResourceDescriptions)1 IDirtyStateManagerExtension (org.eclipse.xtext.ui.editor.IDirtyStateManagerExtension)1