Author: max.andersen(a)jboss.com
Date: 2008-01-25 14:48:30 -0500 (Fri, 25 Jan 2008)
New Revision: 5980
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
Log:
fix for JBIDE-1465 show returned elements in property sheet for hql/criterias
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java 2008-01-25
19:13:18 UTC (rev 5979)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/AbstractQueryPage.java 2008-01-25
19:48:30 UTC (rev 5980)
@@ -51,6 +51,14 @@
id = i;
}
+ public int getResultSize() {
+ if(list==null) {
+ return -1;
+ } else {
+ return list.size();
+ }
+ }
+
public AbstractQueryPage(ConsoleConfiguration cfg) {
this.cfg = cfg;
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java 2008-01-25
19:13:18 UTC (rev 5979)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/HQLQueryPage.java 2008-01-25
19:48:30 UTC (rev 5980)
@@ -63,7 +63,8 @@
}
return list;
}
-
+
+
private void setupParameters(Query query2, QueryInputModel model) {
if(model.getMaxResults()!=null) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2008-01-25
19:13:18 UTC (rev 5979)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/QueryPage.java 2008-01-25
19:48:30 UTC (rev 5980)
@@ -79,4 +79,6 @@
public void addException(Throwable he);
+ /** Return result size if known, -1 if not */
+ public int getResultSize();
}
\ No newline at end of file
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java 2008-01-25
19:13:18 UTC (rev 5979)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java 2008-01-25
19:48:30 UTC (rev 5980)
@@ -176,6 +176,7 @@
composite.setLayoutData(new GridData(GridData.FILL_BOTH) );
this.tabItem.setText(this.queryPage.getQueryString().replace('\n', '
').replace('\r', ' ') );
+ this.tabItem.setToolTipText(this.queryPage.getQueryString());
/* different icon dependent on java/hql etc.
if (this.queryPage.getEntity() == null) {
this.tabItem.setImage(ImageStore.getImage(ImageStore.SCRIPT) );
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java 2008-01-25
19:13:18 UTC (rev 5979)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java 2008-01-25
19:48:30 UTC (rev 5980)
@@ -37,23 +37,32 @@
private static final Object CONFIGURATION_TEXT =
"QueryPage.consoleConfiguration";
+ private static final String QUERY_SIZE = "QueryPage.size";
+
static {
- descriptors = new IPropertyDescriptor[2];
+ descriptors = new IPropertyDescriptor[3];
PropertyDescriptor descriptor;
// query string
descriptor = new TextPropertyDescriptor(QUERY_TEXT,
"Query string");
- descriptor.setAlwaysIncompatible(true);
+ descriptor.setAlwaysIncompatible(false);
//descriptor.setCategory(IResourcePropertyConstants.P_FILE_SYSTEM_CATEGORY);
descriptors[0] = descriptor;
// configuration name
descriptor = new TextPropertyDescriptor(CONFIGURATION_TEXT,
"Console configuration");
- descriptor.setAlwaysIncompatible(true);
+ descriptor.setAlwaysIncompatible(false);
//descriptor.setCategory(IResourcePropertyConstants.P_FILE_SYSTEM_CATEGORY);
descriptors[1] = descriptor;
+
+ // number of items
+ descriptor = new TextPropertyDescriptor(QUERY_SIZE,
+ "Query size");
+ descriptor.setAlwaysIncompatible(false);
+ //descriptor.setCategory(IResourcePropertyConstants.P_FILE_SYSTEM_CATEGORY);
+ descriptors[2] = descriptor;
}
public QueryPagePropertySource (QueryPage page) {
@@ -79,6 +88,10 @@
if(QUERY_TEXT.equals(id) ) {
return page.getQueryString();
}
+ if(QUERY_SIZE.equals(id) ) {
+ int resultSize = page.getResultSize();
+ return resultSize==-1?"(unknown)":resultSize;
+ }
return null;
}
Show replies by date