Search in sources :

Example 1 with HibernateExtension

use of org.hibernate.eclipse.console.common.HibernateExtension in project jbosstools-hibernate by jbosstools.

the class StructuredTextViewerConfigurationUtil method getService.

public static IService getService(ISourceViewer sourceViewer) {
    IJavaProject javaProject = findJavaProject(sourceViewer);
    HibernateNature hibnat = HibernateNature.getHibernateNature(javaProject);
    if (hibnat != null) {
        ConsoleConfiguration cc = hibnat.getDefaultConsoleConfiguration();
        if (cc != null) {
            HibernateExtension extension = cc.getHibernateExtension();
            if (extension != null) {
                return extension.getHibernateService();
            }
        }
    }
    return ServiceLookup.getDefault();
}
Also used : IJavaProject(org.eclipse.jdt.core.IJavaProject) ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) HibernateExtension(org.hibernate.eclipse.console.common.HibernateExtension) HibernateNature(org.hibernate.eclipse.nature.HibernateNature)

Aggregations

IJavaProject (org.eclipse.jdt.core.IJavaProject)1 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)1 HibernateExtension (org.hibernate.eclipse.console.common.HibernateExtension)1 HibernateNature (org.hibernate.eclipse.nature.HibernateNature)1