Author: adietish
Date: 2011-02-03 11:42:26 -0500 (Thu, 03 Feb 2011)
New Revision: 28979
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
Log:
[JBIDE-8324]
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-03
16:10:53 UTC (rev 28978)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-03
16:42:26 UTC (rev 28979)
@@ -210,7 +210,7 @@
f.right = new FormAttachment(100, 0);
f.bottom = new FormAttachment(100, 0);
tableArea.setLayoutData(f);
-
+
// Create the help context id for the viewer's control
PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(),
"org.jboss.tools.deltacloud.ui.viewer");
hookContextMenu(viewer.getControl());
@@ -223,20 +223,17 @@
private TableViewer createTableViewer(Composite tableArea) {
TableColumnLayout tableLayout = new TableColumnLayout();
tableArea.setLayout(tableLayout);
-
- TableViewer viewer = new TableViewer(tableArea,
- SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.MULTI);
+ TableViewer viewer = new TableViewer(
+ tableArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER |
SWT.MULTI);
Table table = viewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
ITableContentAndLabelProvider<CLOUDELEMENT> provider =
getContentAndLabelProvider();
viewer.setContentProvider(provider);
viewer.setLabelProvider(provider);
- createColumns(provider, tableLayout, table);
-
+ createColumns(provider.getColumns(), tableLayout, table);
viewer.setComparator(new TableViewerColumnComparator());
table.setSortDirection(SWT.NONE);
-
return viewer;
}
@@ -306,18 +303,15 @@
return clouds[cloudIndex];
}
- private void createColumns(ITableContentAndLabelProvider<CLOUDELEMENT> provider,
TableColumnLayout tableLayout,
- Table table) {
- Columns<CLOUDELEMENT> columns = provider.getColumns();
-
+ private void createColumns(Columns<CLOUDELEMENT> columns, TableColumnLayout
tableLayout, Table table) {
for (int i = 0; i < columns.getSize(); ++i) {
Column<CLOUDELEMENT> c = columns.getColumn(i);
TableColumn tc = new TableColumn(table, SWT.NONE);
if (i == 0) {
table.setSortColumn(tc);
}
- tc.setText(c.getName());
tableLayout.setColumnData(tc, new ColumnWeightData(c.getWeight(), true));
+ tc.setText(c.getName());
tc.addSelectionListener(new ColumnListener(i));
}
}
Show replies by date