Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-12-08 15:00:05 +0000
committerUwe Stieber2012-12-08 15:00:05 +0000
commit4b93a090cb6c113c8a7303c98279415e8025e868 (patch)
tree2fbad2a9199a41fb39cd9bd87f445fcbdef1f5e9 /target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf
parent7e5f1ef7c6faa6b570b277488ec5d29cab1cb4ca (diff)
downloadorg.eclipse.tcf-4b93a090cb6c113c8a7303c98279415e8025e868.tar.gz
org.eclipse.tcf-4b93a090cb6c113c8a7303c98279415e8025e868.tar.xz
org.eclipse.tcf-4b93a090cb6c113c8a7303c98279415e8025e868.zip
Target Explorer: Fix table and tree column initial size calculations
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/AbstractTreeControl.java9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.java72
2 files changed, 38 insertions, 43 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/AbstractTreeControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/AbstractTreeControl.java
index 218524124..c93fb9f76 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/AbstractTreeControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/AbstractTreeControl.java
@@ -46,7 +46,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.tcf.te.core.interfaces.IViewerInput;
-import org.eclipse.tcf.te.runtime.utils.Host;
import org.eclipse.tcf.te.ui.WorkbenchPartControl;
import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
import org.eclipse.ui.IDecoratorManager;
@@ -363,11 +362,6 @@ public abstract class AbstractTreeControl extends WorkbenchPartControl implement
for(ColumnDescriptor visibleColumn : visibleColumns) {
doCreateTreeColumn(visibleColumn, true);
}
- if(!Host.isWindowsHost()) {
- Tree tree = viewer.getTree();
- TreeColumn column = new TreeColumn(tree, SWT.LEFT);
- column.setWidth(1);
- }
// Set the default sort column to the first column (the tree column).
Assert.isTrue(viewer.getTree().getColumnCount() > 0);
TreeColumn treeColumn = viewer.getTree().getColumn(0);
@@ -379,7 +373,7 @@ public abstract class AbstractTreeControl extends WorkbenchPartControl implement
}
/**
- * Create the tree column described by the specified colum descriptor.
+ * Create the tree column described by the specified column descriptor.
*
* @param column The column descriptor.
* @param append If the new column should be appended.
@@ -396,6 +390,7 @@ public abstract class AbstractTreeControl extends WorkbenchPartControl implement
treeColumn.setImage(column.getImage());
treeColumn.setMoveable(column.isMoveable());
treeColumn.setResizable(column.isResizable());
+ treeColumn.setData("widthHint", Integer.valueOf(column.getWidth())); //$NON-NLS-1$
treeColumn.setWidth(column.getWidth());
treeColumn.addSelectionListener(this);
treeColumn.addControlListener(new ControlAdapter(){
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.java
index 884dcd0fe..3edf7e5b9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.java
@@ -18,7 +18,7 @@ import org.eclipse.swt.widgets.TreeColumn;
/**
* <p>
- * The data descriptor to describe tree columns of a tree viewer.
+ * The data descriptor to describe tree columns of a tree viewer.
* </p>
* <p>
* A ColumnDescriptor encapsulates the following information about the tree
@@ -82,7 +82,7 @@ public class ColumnDescriptor {
/**
* Create a column descriptor with specified column id.
- *
+ *
* @param id
* The column id;
*/
@@ -92,7 +92,7 @@ public class ColumnDescriptor {
/**
* Get the column's id.
- *
+ *
* @return the column's id.
*/
public String getId() {
@@ -101,16 +101,16 @@ public class ColumnDescriptor {
/**
* Set the column's id.
- *
+ *
* @param id
*/
public void setId(String id) {
this.id = id;
}
-
+
/**
* Get the column's sorting orientation.
- *
+ *
* @return The sorting orientation.
*/
public boolean isAscending() {
@@ -119,7 +119,7 @@ public class ColumnDescriptor {
/**
* Set the column's sorting orientation.
- *
+ *
* @param a The new orientation.
*/
public void setAscending(boolean a) {
@@ -128,7 +128,7 @@ public class ColumnDescriptor {
/**
* Set the column's sorting comparator.
- *
+ *
* @param comparator The new comparator.
*/
@SuppressWarnings("rawtypes")
@@ -138,7 +138,7 @@ public class ColumnDescriptor {
/**
* Get the column's sorting comparator.
- *
+ *
* @return The new comparator.
*/
@SuppressWarnings("rawtypes")
@@ -148,7 +148,7 @@ public class ColumnDescriptor {
/**
* Set the tree column.
- *
+ *
* @param column The tree column.
*/
public void setTreeColumn(TreeColumn column) {
@@ -157,7 +157,7 @@ public class ColumnDescriptor {
/**
* Get the tree column.
- *
+ *
* @return The tree column.
*/
public TreeColumn getTreeColumn() {
@@ -166,7 +166,7 @@ public class ColumnDescriptor {
/**
* Set the visibility of this tree column.
- *
+ *
* @param v the new visibility
*/
public void setVisible(boolean v) {
@@ -175,7 +175,7 @@ public class ColumnDescriptor {
/**
* Get the visibility of the tree column.
- *
+ *
* @return This column's visibility.
*/
public boolean isVisible() {
@@ -184,25 +184,25 @@ public class ColumnDescriptor {
/**
* Set the name of the column.
- *
+ *
* @param name The new name.
*/
- public void setName(String name) {
+ public void setName(String name) {
this.name = name;
}
/**
* Get the name of the column.
- *
+ *
* @return The column's name.
*/
public String getName() {
return name;
}
-
+
/**
* Set the description of the column.
- *
+ *
* @param desc The column's description.
*/
public void setDescription(String desc) {
@@ -211,7 +211,7 @@ public class ColumnDescriptor {
/**
* Get the description of the column.
- *
+ *
* @return The column's description.
*/
public String getDescription() {
@@ -220,7 +220,7 @@ public class ColumnDescriptor {
/**
* Set if the column is moveable.
- *
+ *
* @param m The new value.
*/
public void setMoveable(boolean m) {
@@ -229,7 +229,7 @@ public class ColumnDescriptor {
/**
* Get if the column is moveable.
- *
+ *
* @return If the column is moveable.
*/
public boolean isMoveable() {
@@ -238,7 +238,7 @@ public class ColumnDescriptor {
/**
* Set the column's creation style.
- *
+ *
* @param style The column's creation style.
*/
public void setStyle(int style) {
@@ -247,7 +247,7 @@ public class ColumnDescriptor {
/**
* Get the column's creation style.
- *
+ *
* @return The column's creation style.
*/
public int getStyle() {
@@ -256,7 +256,7 @@ public class ColumnDescriptor {
/**
* Set the column's alignment.
- *
+ *
* @param alignment The column's alignment.
*/
public void setAlignment(int alignment) {
@@ -265,7 +265,7 @@ public class ColumnDescriptor {
/**
* Get the column's alignment.
- *
+ *
* @return The column's alignment.
*/
public int getAlignment() {
@@ -274,7 +274,7 @@ public class ColumnDescriptor {
/**
* Set the column's image.
- *
+ *
* @param img The new image.
*/
public void setImage(Image img) {
@@ -283,7 +283,7 @@ public class ColumnDescriptor {
/**
* Get the column's image.
- *
+ *
* @return The column's image.
*/
public Image getImage() {
@@ -292,7 +292,7 @@ public class ColumnDescriptor {
/**
* Set if the column is resizable.
- *
+ *
* @param r The new value.
*/
public void setResizable(boolean r) {
@@ -301,7 +301,7 @@ public class ColumnDescriptor {
/**
* Get if the column is resizable.
- *
+ *
* @return If the column is resizable.
*/
public boolean isResizable() {
@@ -310,7 +310,7 @@ public class ColumnDescriptor {
/**
* Set the column's initial width.
- *
+ *
* @param width The new column width.
*/
public void setWidth(int width) {
@@ -319,7 +319,7 @@ public class ColumnDescriptor {
/**
* Get the column's initial width.
- *
+ *
* @return the column's initial width.
*/
public int getWidth() {
@@ -328,7 +328,7 @@ public class ColumnDescriptor {
/**
* Set the column's label provider.
- *
+ *
* @param p The new column label provider.
*/
public void setLabelProvider(ILabelProvider p) {
@@ -337,7 +337,7 @@ public class ColumnDescriptor {
/**
* Get the column's label provider.
- *
+ *
* @return The column's label provider.
*/
public ILabelProvider getLabelProvider() {
@@ -345,8 +345,8 @@ public class ColumnDescriptor {
}
/**
- * Get the column's order number.
- *
+ * Get the column's order number.
+ *
* @return The column's order.
*/
public int getOrder() {
@@ -355,7 +355,7 @@ public class ColumnDescriptor {
/**
* Set the column's order.
- *
+ *
* @param order The new order.
*/
public void setOrder(int order) {

Back to the top