Search in sources :

Example 71 with ConsoleConfiguration

use of org.hibernate.console.ConsoleConfiguration in project jbosstools-hibernate by jbosstools.

the class OrmDiagram method getConsoleConfig.

public ConsoleConfiguration getConsoleConfig() {
    final KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
    ConsoleConfiguration consoleConfig = knownConfigurations.find(consoleConfigName);
    return consoleConfig;
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) KnownConfigurations(org.hibernate.console.KnownConfigurations)

Example 72 with ConsoleConfiguration

use of org.hibernate.console.ConsoleConfiguration in project jbosstools-hibernate by jbosstools.

the class OrmDiagram method getStoreFolderPath.

public IPath getStoreFolderPath() {
    IPath storePath = null;
    ConsoleConfiguration consoleConfig = getConsoleConfig();
    IJavaProject javaProject = ProjectUtils.findJavaProject(consoleConfig);
    if (javaProject != null && javaProject.getProject() != null) {
        storePath = javaProject.getProject().getLocation();
    } else {
        storePath = UiPlugin.getDefault().getStateLocation();
    }
    // $NON-NLS-1$
    return storePath.append(".settings").append(HIBERNATE_MAPPING_LAYOUT_FOLDER_NAME);
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) IJavaProject(org.eclipse.jdt.core.IJavaProject) IPath(org.eclipse.core.runtime.IPath)

Example 73 with ConsoleConfiguration

use of org.hibernate.console.ConsoleConfiguration in project jbosstools-hibernate by jbosstools.

the class Shape method getConsoleConfig.

public ConsoleConfiguration getConsoleConfig() {
    final KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
    ConsoleConfiguration consoleConfig = knownConfigurations.find(consoleConfigName);
    return consoleConfig;
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) KnownConfigurations(org.hibernate.console.KnownConfigurations)

Example 74 with ConsoleConfiguration

use of org.hibernate.console.ConsoleConfiguration in project jbosstools-hibernate by jbosstools.

the class OrmLabelProvider method getConfig.

protected IConfiguration getConfig() {
    final ConsoleConfiguration consoleConfig = getConsoleConfig();
    if (consoleConfig != null) {
        if (!consoleConfig.hasConfiguration()) {
            try {
                consoleConfig.build();
                consoleConfig.buildMappings();
            } catch (Exception he) {
                // $NON-NLS-1$
                HibernateConsolePlugin.getDefault().logErrorMessage("HibernateException: ", he);
            }
        }
        return consoleConfig.getConfiguration();
    }
    return null;
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration)

Example 75 with ConsoleConfiguration

use of org.hibernate.console.ConsoleConfiguration in project jbosstools-hibernate by jbosstools.

the class ConsoleConfigUtils method deleteConsoleConfig.

/**
 * Delete console configuration with given name.
 * @param name
 */
public static void deleteConsoleConfig(String name) {
    final KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
    final ConsoleConfiguration consoleConfig = knownConfigurations.find(name);
    if (consoleConfig != null) {
        consoleConfig.reset();
    }
    knownConfigurations.removeConfiguration(consoleConfig, false);
}
Also used : ConsoleConfiguration(org.hibernate.console.ConsoleConfiguration) KnownConfigurations(org.hibernate.console.KnownConfigurations)

Aggregations

ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)107 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)19 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)17 CoreException (org.eclipse.core.runtime.CoreException)16 PartInitException (org.eclipse.ui.PartInitException)13 IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)12 KnownConfigurations (org.hibernate.console.KnownConfigurations)11 JavaModelException (org.eclipse.jdt.core.JavaModelException)10 TreePath (org.eclipse.jface.viewers.TreePath)10 Test (org.junit.Test)10 File (java.io.File)9 ArrayList (java.util.ArrayList)9 FileNotFoundException (java.io.FileNotFoundException)8 IPath (org.eclipse.core.runtime.IPath)8 TreeSelection (org.eclipse.jface.viewers.TreeSelection)8 IService (org.jboss.tools.hibernate.runtime.spi.IService)8 ITreeSelection (org.eclipse.jface.viewers.ITreeSelection)7 IEditorPart (org.eclipse.ui.IEditorPart)7 ConsoleConfigurationPreferences (org.hibernate.console.preferences.ConsoleConfigurationPreferences)7 GridLayout (org.eclipse.swt.layout.GridLayout)6