Author: dgeraskov
Date: 2010-01-13 02:56:17 -0500 (Wed, 13 Jan 2010)
New Revision: 19723
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4613
Catch and log errors which appears while console configuration is being built.
In criteria editor error about wrong project shown as dialog because completion proposals
in it can't work at all with such problem.
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2010-01-13
01:11:17 UTC (rev 19722)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2010-01-13
07:56:17 UTC (rev 19723)
@@ -265,6 +265,7 @@
public static String CriteriaEditorStorage_none;
public static String JavaCompletionProcessor_error;
public static String JavaCompletionProcessor_error_while_performing_code_completion;
+ public static String JavaCompletionProcessor_error_find_project;
public static String JavaCompletionProcessor_no_console_configuration_found;
public static String JavaCompletionProcessor_session_session;
//
@@ -284,6 +285,7 @@
//
public static String CompletionHelper_could_not_complete_java_types;
public static String CompletionHelper_error_unknown_completion_proposal_class;
+ public static String CompletionHelper_error_could_not_build_cc;
public static String HQLCompletionProcessor_could_not_get_document_contents;
public static String HQLCompletionProcessor_error_while_performing_hql_completion;
public static String HQLCompletionProcessor_no_hql_completions_available;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-01-13
01:11:17 UTC (rev 19722)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2010-01-13
07:56:17 UTC (rev 19723)
@@ -267,6 +267,7 @@
CriteriaEditorStorage_none=<None>
JavaCompletionProcessor_error=Error
JavaCompletionProcessor_error_while_performing_code_completion=Error while performing
code completion
+JavaCompletionProcessor_error_find_project=Could not compute project for console
configuration ''{0}''
JavaCompletionProcessor_no_console_configuration_found=No console configuration found
JavaCompletionProcessor_session_session=Session session;
@@ -286,6 +287,7 @@
CompletionHelper_could_not_complete_java_types=Could not complete java types
CompletionHelper_error_unknown_completion_proposal_class=ERROR: unknown
CompletionProposal class.
+CompletionHelper_error_could_not_build_cc=Could not build console configuration
''{0}''
HQLCompletionProcessor_could_not_get_document_contents=Could not get document contents
HQLCompletionProcessor_error_while_performing_hql_completion=Error while performing HQL
completion
HQLCompletionProcessor_no_hql_completions_available=No HQL completions available.
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2010-01-13
01:11:17 UTC (rev 19722)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2010-01-13
07:56:17 UTC (rev 19723)
@@ -39,6 +39,7 @@
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
@@ -186,7 +187,8 @@
}
});
} catch (HibernateException e) {
-
+ String mess =
NLS.bind(HibernateConsoleMessages.CompletionHelper_error_could_not_build_cc,
consoleConfiguration.getName());
+ HibernateConsolePlugin.getDefault().logErrorMessage(mess, e);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2010-01-13
01:11:17 UTC (rev 19722)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2010-01-13
07:56:17 UTC (rev 19723)
@@ -92,8 +92,15 @@
String prefix = HibernateConsoleMessages.JavaCompletionProcessor_session_session; //
has to do this because of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=141518
IJavaCompletionProposal[] results = new IJavaCompletionProposal[0];
- IJavaProject[] projects =
ProjectUtils.findJavaProjects(editor.getConsoleConfiguration());
- for (int i = 0; i < projects.length && results.length <= 0; i++) {
+ IJavaProject[] projects = null;
+ //try {
+ ProjectUtils.findJavaProjects(editor.getConsoleConfiguration());
+ /*} catch (RuntimeException e){
+ String mess =
NLS.bind(HibernateConsoleMessages.JavaCompletionProcessor_error_find_project,
+ editor.getConsoleConfiguration().getName());
+ HibernateConsolePlugin.getDefault().logErrorMessage(mess, e);
+ }*/
+ for (int i = 0; projects != null && i < projects.length &&
results.length <= 0; i++) {
IJavaProject javaProject = projects[i];
collector = new CompletionProposalCollector( javaProject );
collector.acceptContext( new CompletionContext() );
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 2010-01-13
01:11:17 UTC (rev 19722)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2010-01-13
07:56:17 UTC (rev 19723)
@@ -34,6 +34,7 @@
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
@@ -126,6 +127,8 @@
}
});
} catch (HibernateException e){
+ String mess =
NLS.bind(HibernateConsoleMessages.CompletionHelper_error_could_not_build_cc,
consoleConfiguration.getName());
+ HibernateConsolePlugin.getDefault().logErrorMessage(mess, e);
}
}