Author: vyemialyanchyk
Date: 2009-06-11 09:00:38 -0400 (Thu, 11 Jun 2009)
New Revision: 15877
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
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/console/actions/ExecuteQueryAction.java
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/CriteriaEditorActionContributor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4466 - tooltip for Run button for Hibernate
Criteria Editor
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2009-06-11
12:43:51 UTC (rev 15876)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2009-06-11
13:00:38 UTC (rev 15877)
@@ -449,4 +449,12 @@
return files[0];
return null;
}
+
+ public boolean initTextAndToolTip(String text) {
+ if (execAction != null) {
+ execAction.initTextAndToolTip(text);
+ return true;
+ }
+ return false;
+ }
}
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 2009-06-11
12:43:51 UTC (rev 15876)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2009-06-11
13:00:38 UTC (rev 15877)
@@ -60,7 +60,9 @@
public static String EditConsoleConfiguration_exception_while_edit_config;
public static String EditConsoleConfiguration_no_launch_cfg_matched;
public static String EditConsoleConfiguration_problem_adding_console_cfg;
+ public static String ExecuteQueryAction_run_default;
public static String ExecuteQueryAction_run_hql;
+ public static String ExecuteQueryAction_run_criteria;
public static String HQLScratchpadAction_hql_editor;
public static String HQLScratchpadAction_open_hql_editor;
public static String JTidyFormatAction_do_you_want_format_xml_files_with_jtidy;
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 2009-06-11
12:43:51 UTC (rev 15876)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2009-06-11
13:00:38 UTC (rev 15877)
@@ -53,7 +53,9 @@
EditConsoleConfiguration_exception_while_edit_config=Exception while trying to edit
configuration
EditConsoleConfiguration_no_launch_cfg_matched=No launch configuration matched the
configuration named
EditConsoleConfiguration_problem_adding_console_cfg=Problem adding a console
configuration
+ExecuteQueryAction_run_default=Run
ExecuteQueryAction_run_hql=Run HQL
+ExecuteQueryAction_run_criteria=Run criteria
HQLScratchpadAction_hql_editor=HQL Editor
HQLScratchpadAction_open_hql_editor=Open HQL Editor
JTidyFormatAction_do_you_want_format_xml_files_with_jtidy=Do you want to format {0} xml
files with JTidy?
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ExecuteQueryAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ExecuteQueryAction.java 2009-06-11
12:43:51 UTC (rev 15876)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ExecuteQueryAction.java 2009-06-11
13:00:38 UTC (rev 15877)
@@ -40,7 +40,7 @@
public ExecuteQueryAction() {
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.EXECUTE) );
- initTextAndToolTip();
+ initTextAndToolTip(HibernateConsoleMessages.ExecuteQueryAction_run_default);
}
@@ -58,31 +58,26 @@
}
protected void execute(QueryEditor queryEditor) {
- try {
- ConsoleConfiguration cfg = queryEditor.getConsoleConfiguration();
- if(cfg!=null) {
- if (!cfg.isSessionFactoryCreated()) {
- if (queryEditor.askUserForConfiguration(cfg.getName())) {
- if(cfg.getConfiguration()==null) {
- cfg.build();
- }
- cfg.buildSessionFactory();
- queryEditor.executeQuery(cfg);
+
+ ConsoleConfiguration cfg = queryEditor.getConsoleConfiguration();
+ if(cfg!=null) {
+ if (!cfg.isSessionFactoryCreated()) {
+ if (queryEditor.askUserForConfiguration(cfg.getName())) {
+ if(cfg.getConfiguration()==null) {
+ cfg.build();
}
- } else {
+ cfg.buildSessionFactory();
queryEditor.executeQuery(cfg);
}
+ } else {
+ queryEditor.executeQuery(cfg);
}
}
- finally {
- initTextAndToolTip();
- }
-
}
- private void initTextAndToolTip() {
- setText(HibernateConsoleMessages.ExecuteQueryAction_run_hql);
- setToolTipText(HibernateConsoleMessages.ExecuteQueryAction_run_hql);
+ public void initTextAndToolTip(String text) {
+ setText(text);
+ setToolTipText(text);
}
public void run(IAction action) {
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 2009-06-11
12:43:51 UTC (rev 15876)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2009-06-11
13:00:38 UTC (rev 15877)
@@ -239,7 +239,7 @@
}
});
-
+ initTextAndToolTip(HibernateConsoleMessages.ExecuteQueryAction_run_criteria);
}
@Override
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorActionContributor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorActionContributor.java 2009-06-11
12:43:51 UTC (rev 15876)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorActionContributor.java 2009-06-11
13:00:38 UTC (rev 15877)
@@ -36,11 +36,11 @@
*/
public class CriteriaEditorActionContributor extends TextEditorActionContributor {
- private ExecuteQueryAction executeHQLAction;
+ private ExecuteQueryAction executeQueryAction;
public CriteriaEditorActionContributor() {
super();
- executeHQLAction = new ExecuteQueryAction();
+ executeQueryAction = new ExecuteQueryAction();
}
/**
@@ -63,7 +63,7 @@
super.setActiveEditor( targetEditor );
if(targetEditor instanceof QueryEditor) {
- executeHQLAction.setHibernateQueryEditor((QueryEditor) targetEditor);
+ executeQueryAction.setHibernateQueryEditor((QueryEditor) targetEditor);
}
}
@@ -71,7 +71,7 @@
public void init(IActionBars bars, IWorkbenchPage page) {
super.init( bars, page );
-
bars.setGlobalActionHandler("org.hibernate.eclipse.console.actions.ExecuteQueryAction",
executeHQLAction); //$NON-NLS-1$
+
bars.setGlobalActionHandler("org.hibernate.eclipse.console.actions.ExecuteQueryAction",
executeQueryAction); //$NON-NLS-1$
bars.updateActionBars();
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2009-06-11
12:43:51 UTC (rev 15876)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2009-06-11
13:00:38 UTC (rev 15877)
@@ -181,6 +181,7 @@
}
});
+ initTextAndToolTip(HibernateConsoleMessages.ExecuteQueryAction_run_hql);
}
/**