Author: snjeza
Date: 2008-05-15 17:27:47 -0400 (Thu, 15 May 2008)
New Revision: 8127
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLSourceViewerConfiguration.java
Log:
JBIDE-2208 Minor changes in Hibernate necessary to use the HQL editor in a SWT/JFace
dialog
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/META-INF/MANIFEST.MF
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/META-INF/MANIFEST.MF 2008-05-15
21:22:41 UTC (rev 8126)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/META-INF/MANIFEST.MF 2008-05-15
21:27:47 UTC (rev 8127)
@@ -16,6 +16,7 @@
org.hibernate.eclipse.console.properties,
org.hibernate.eclipse.console.utils,
org.hibernate.eclipse.console.utils.xpl,
+ org.hibernate.eclipse.console.viewers.xpl,
org.hibernate.eclipse.console.views,
org.hibernate.eclipse.console.views.navigator,
org.hibernate.eclipse.console.views.properties,
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java 2008-05-15
21:22:41 UTC (rev 8126)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java 2008-05-15
21:27:47 UTC (rev 8127)
@@ -34,7 +34,7 @@
import org.hibernate.console.KnownConfigurationsListener;
import org.hibernate.eclipse.console.workbench.DeferredContentProvider;
-class KnownConfigurationsProvider extends DeferredContentProvider implements
KnownConfigurationsListener {
+public class KnownConfigurationsProvider extends DeferredContentProvider implements
KnownConfigurationsListener {
private TreeViewer tv;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2008-05-15
21:22:41 UTC (rev 8126)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2008-05-15
21:27:47 UTC (rev 8127)
@@ -37,6 +37,7 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.tool.ide.completion.HQLCodeAssist;
import org.hibernate.tool.ide.completion.IHQLCodeAssist;
@@ -48,12 +49,13 @@
private char[] autoActivationChars = { '.' };
protected IContextInformationValidator validator = new
MinimalDiffContextInformationValidator(5);
private final Comparator completionComparator;
- private final HQLEditor editor;
+ //private final HQLEditor editor;
+ private QueryEditor hqlEditor;
private String errorMessage;
- public HQLCompletionProcessor(HQLEditor editor) {
+ public HQLCompletionProcessor(QueryEditor editor) {
super();
- this.editor = editor;
+ this.hqlEditor = editor;
completionComparator = DisplayStringProposalComparator.INSTANCE;
}
@@ -72,7 +74,7 @@
}
if(partition!=null) {
- result = computeProposals( doc, partition.getOffset(), documentOffset,
editor.getConsoleConfiguration() );
+ result = computeProposals( doc, partition.getOffset(), documentOffset,
hqlEditor.getConsoleConfiguration() );
}
}
catch (BadLocationException x) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLSourceViewerConfiguration.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLSourceViewerConfiguration.java 2008-05-15
21:22:41 UTC (rev 8126)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLSourceViewerConfiguration.java 2008-05-15
21:27:47 UTC (rev 8127)
@@ -36,13 +36,16 @@
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.eclipse.hqleditor.preferences.HQLPreferenceConstants;
public class HQLSourceViewerConfiguration extends SourceViewerConfiguration {
public final static String HQL_PARTITIONING= "__hql_partitioning";
//$NON-NLS-1$
private HQLCompletionProcessor completionProcessor;
- private HQLEditor hqlEditor;
+ //private HQLEditor hqlEditor;
+ private QueryEditor hqlEditor;
static class SingleTokenScanner extends BufferedRuleBasedScanner {
public SingleTokenScanner( TextAttribute attribute ) {
@@ -50,14 +53,10 @@
}
}
- public HQLSourceViewerConfiguration(HQLEditor editor) {
- hqlEditor = editor;
+ public HQLSourceViewerConfiguration(QueryEditor editor) {
+ this.hqlEditor = editor;
completionProcessor = new HQLCompletionProcessor(editor);
}
-
- public HQLEditor getHQLEditor() {
- return hqlEditor;
- }
public String getConfiguredDocumentPartitioning( ISourceViewer sourceViewer ) {
return HQL_PARTITIONING;
Show replies by date