fTemplatesTree= new Tree(treeComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI
| SWT.FULL_SELECTION);
fTemplatesTree.setHeaderVisible(true);
fTemplatesTree.setLinesVisible(true);
PixelConverter pixelConverter= new PixelConverter(fTemplatesTree);
TreeColumn columnName= new TreeColumn(fTemplatesTree, SWT.NONE);
columnName.setText(TemplatesMessages.TemplatesPage_column_name);
int minWidth= fPreferenceStore.getInt(COLUMN_NAME_WIDTH_PREF_ID);
if (minWidth == 0) {
minWidth= pixelConverter.convertWidthInCharsToPixels(30);
}
columnLayout.setColumnData(columnName, new ColumnPixelData(minWidth, true));
columnName.addControlListener(new ControlListener() {
public void controlMoved(ControlEvent e) {
}
public void controlResized(ControlEvent e) {
int nameWidth= ((TreeColumn) e.getSource()).getWidth();
fPreferenceStore.setValue(COLUMN_NAME_WIDTH_PREF_ID, nameWidth);
}
});
TreeColumn columnDescription= new TreeColumn(fTemplatesTree, SWT.NONE);
columnDescription.setText(TemplatesMessages.TemplatesPage_column_description);
minWidth= fPreferenceStore.getInt(COLUMN_DESCRIPTION_WIDTH_PREF_ID);
if (minWidth == 0) {
minWidth= pixelConverter.convertWidthInCharsToPixels(45);
}
columnLayout.setColumnData(columnDescription, new ColumnPixelData(minWidth, false));
columnDescription.addControlListener(new ControlListener() {
public void controlMoved(ControlEvent e) {
}