<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.http.servlet</artifactId>
</dependency>
- <dependency>
- <groupId>org.eclipse.rap</groupId>
- <artifactId>org.eclipse.rap.demo.databinding</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.rap</groupId>
- <artifactId>org.eclipse.rap.demo</artifactId>
- </dependency>
- <dependency>
- <groupId>org.eclipse.rap</groupId>
- <artifactId>org.eclipse.rap.design.example</artifactId>
- </dependency>
+ <!-- <dependency> <groupId>org.eclipse.rap</groupId> <artifactId>org.eclipse.rap.demo.databinding</artifactId>
+ </dependency> <dependency> <groupId>org.eclipse.rap</groupId> <artifactId>org.eclipse.rap.demo</artifactId>
+ </dependency> <dependency> <groupId>org.eclipse.rap</groupId> <artifactId>org.eclipse.rap.design.example</artifactId>
+ </dependency> -->
<dependency>
<groupId>org.eclipse.rap</groupId>
<artifactId>org.eclipse.rap.jface.databinding</artifactId>
<groupId>org.eclipse.core</groupId>
<artifactId>org.eclipse.core.databinding.beans</artifactId>
</dependency>
-
</dependencies>
</project>
Composite bottom = new Composite(sashForm, SWT.NONE);
bottom.setLayout(new GridLayout(1, false));
- sashForm.setWeights(new int[] { 30, 70 });
+ sashForm.setWeights(getWeights());
viewer = new TableViewer(bottom);
viewer.getTable().setLayoutData(
viewer.setContentProvider(new QueryResultContentProvider());
// viewer.setLabelProvider(new QueryResultLabelProvider());
viewer.setInput(getEditorSite());
+
+ // viewer.addDoubleClickListener(new QueryResultDoubleClickListener());
+
+ }
+
+ /**
+ * To be overidden to adapt size of form and result frames.
+ *
+ * @return
+ */
+ protected int[] getWeights() {
+ return new int[] { 30, 70 };
}
protected void executeQuery(String statement) {
for (final String columnName : qr.getColumnNames()) {
TableViewerColumn tvc = new TableViewerColumn(viewer, SWT.NONE);
- tvc.getColumn().setWidth(50);
- tvc.getColumn().setText(columnName);
+ configureColumn(columnName, tvc);
tvc.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
}
}
+ /** To be overridden in order to configure the columns. */
+ protected void configureColumn(String jcrColumnName,
+ TableViewerColumn column) {
+ column.getColumn().setWidth(50);
+ column.getColumn().setText(jcrColumnName);
+ }
+
private class QueryResultContentProvider implements
IStructuredContentProvider {
return false;
}
+ // IoC
public void setSession(Session session) {
this.session = session;
}