org.eclipse.xtext.resource.DescriptionUtils Java Examples

The following examples show how to use org.eclipse.xtext.resource.DescriptionUtils. 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: ProcResourceServiceProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public ProcResourceServiceProvider(ProcResourceDescriptionManager manager) {
    ProcResourceDescriptionStrategy startegy = new ProcResourceDescriptionStrategy();
    resourceDescriptionManager = manager;
    resourceDescriptionManager.setStrategy(startegy);
    resourceDescriptionManager.setDescriptionUtils(new DescriptionUtils());
    resourceDescriptionManager.setContainerManager(new SimpleResourceDescriptionsBasedContainerManager());
}
 
Example #2
Source File: N4JSRuntimeModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Returns empty set for out going references (as calculation of reference descriptions is disabled)
 */
public Class<? extends DescriptionUtils> bindDescriptionUtils() {
	return N4JSDescriptionUtils.class;
}
 
Example #3
Source File: ValidationJobSchedulerTest.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void setUp() throws Exception {
	super.setUp();
	referenceDescriptions = Lists.newArrayList();
	dirtyStateManager = new DirtyStateManager();
	testMe = new ValidationJobScheduler();
	testMe.setDirtyStateManager(dirtyStateManager);
	testMe.setDescriptionUtils(new DescriptionUtils());
	testMe.setResourceDescriptions(this);
	testMe.setResourceDescriptionManager(new DefaultResourceDescriptionManager());
	DocumentTokenSource nullSource = new DocumentTokenSource() {
		@Override
		protected IRegion computeDamageRegion(DocumentEvent e) {
			return new Region(0, 0);
		}
	};
	document = new XtextDocument(nullSource, null, outdatedStateManager, operationCanceledManager) {

		@Override
		public URI getResourceURI() {
			return documentURI;
		}
		
		@Override
		public void checkAndUpdateAnnotations() {
			validationScheduled = true;
		}
	};
	documentResource = new TestableDocumentResource();
	targetResource = new AbstractResourceDescription() {
		
		@Override
		public URI getURI() {
			return targetURI;
		}
		
		@Override
		public Iterable<IReferenceDescription> getReferenceDescriptions() {
			throw new UnsupportedOperationException();
		}
		
		@Override
		public Iterable<QualifiedName> getImportedNames() {
			throw new UnsupportedOperationException();
		}
		
		@Override
		protected List<IEObjectDescription> computeExportedObjects() {
			if (documentResource.importedName == null)
				throw new UnsupportedOperationException();
			return Collections.emptyList();
		}
	};
}
 
Example #4
Source File: ValidationJobScheduler.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected DescriptionUtils getDescriptionUtils() {
	return descriptionUtils;
}
 
Example #5
Source File: ValidationJobScheduler.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @noreference This method is not intended to be referenced by clients.
 */
public void setDescriptionUtils(DescriptionUtils descriptionUtils) {
	this.descriptionUtils = descriptionUtils;
}
 
Example #6
Source File: DefaultResourceDescriptionManager.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public DescriptionUtils getDescriptionUtils() {
	return descriptionUtils;
}
 
Example #7
Source File: DefaultResourceDescriptionManager.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public void setDescriptionUtils(DescriptionUtils descriptionUtils) {
	this.descriptionUtils = descriptionUtils;
}
 
Example #8
Source File: ProcResourceServiceProvider.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public ProcResourceServiceProvider(){
	ProcResourceDescriptionStrategy startegy = new ProcResourceDescriptionStrategy();
	resourceDescriptionManager.setStrategy(startegy);
	resourceDescriptionManager.setDescriptionUtils(new DescriptionUtils());
	resourceDescriptionManager.setContainerManager(new SimpleResourceDescriptionsBasedContainerManager());
}