use of org.jboss.tools.hibernate.runtime.spi.IService in project jbosstools-hibernate by jbosstools.
the class TypeVisitor method createConfiguration.
protected IConfiguration createConfiguration(IJavaProject project, Map<String, EntityInfo> entities) {
IConfiguration result = null;
IService service = getService(project);
if (service != null) {
result = service.newDefaultConfiguration();
ProcessEntityInfo processor = new ProcessEntityInfo(service);
processor.setEntities(entities);
for (Entry<String, EntityInfo> entry : entities.entrySet()) {
String fullyQualifiedName = entry.getValue().getFullyQualifiedName();
ICompilationUnit icu = Utils.findCompilationUnit(project, fullyQualifiedName);
if (icu != null) {
CompilationUnit cu = Utils.getCompilationUnit(icu, true);
processor.setEntityInfo(entry.getValue());
cu.accept(processor);
}
}
Collection<IPersistentClass> classesCollection = createHierarhyStructure(project, processor.getRootClasses());
for (IPersistentClass persistentClass : classesCollection) {
result.addClass(persistentClass);
}
}
return result;
}
use of org.jboss.tools.hibernate.runtime.spi.IService in project jbosstools-hibernate by jbosstools.
the class CFGXMLStructuredTextViewerConfiguration method getContentAssistProcessors.
protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
IContentAssistProcessor[] processors = null;
IService service = StructuredTextViewerConfigurationUtil.getService(sourceViewer);
if ((IStructuredPartitions.DEFAULT_PARTITION.equals(partitionType)) || (IXMLPartitions.XML_DEFAULT.equals(partitionType))) {
// TODO: return cached one ?
processors = new IContentAssistProcessor[] { new CFGXMLContentAssistProcessor(service) };
} else if (IStructuredPartitions.UNKNOWN_PARTITION.equals(partitionType)) {
processors = new IContentAssistProcessor[] { new NoRegionContentAssistProcessor() };
}
return processors;
}
use of org.jboss.tools.hibernate.runtime.spi.IService in project jbosstools-hibernate by jbosstools.
the class HBMXMLStructuredTextViewerConfiguration method getHyperlinkDetectors.
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
if (sourceViewer == null || hyperLinksEnabled()) {
return null;
}
IHyperlinkDetector[] baseDetectors = super.getHyperlinkDetectors(sourceViewer);
IService service = StructuredTextViewerConfigurationUtil.getService(sourceViewer);
HBMXMLHyperlinkDetector hyperlinkDetector = new HBMXMLHyperlinkDetector(service);
if (baseDetectors == null || baseDetectors.length == 0) {
return new IHyperlinkDetector[] { hyperlinkDetector };
} else {
IHyperlinkDetector[] result = new IHyperlinkDetector[baseDetectors.length + 1];
result[0] = hyperlinkDetector;
for (int i = 0; i < baseDetectors.length; i++) {
result[i + 1] = baseDetectors[i];
}
return result;
}
}
Aggregations