use of org.erlide.ui.internal.util.TableLayoutComposite in project erlide_eclipse by erlang.
the class ListDialogField method getListControl.
// ------ ui creation
/**
* Returns the list control. When called the first time, the control will be created.
*
* @param parent
* The parent composite when called the first time, or <code>null</code>
* after.
*/
public Control getListControl(final Composite parent) {
if (fTableControl == null) {
assertCompositeNotNull(parent);
if (fTableColumns == null) {
fTable = createTableViewer(parent);
final Table tableControl = fTable.getTable();
fTableControl = tableControl;
tableControl.setLayout(new TableLayout());
} else {
final TableLayoutComposite composite = new TableLayoutComposite(parent, SWT.NONE);
fTableControl = composite;
fTable = createTableViewer(composite);
final Table tableControl = fTable.getTable();
tableControl.setHeaderVisible(fTableColumns.fHeaders != null);
tableControl.setLinesVisible(fTableColumns.fDrawLines);
final ColumnLayoutData[] columns = fTableColumns.fColumns;
for (int i = 0; i < columns.length; i++) {
composite.addColumnData(columns[i]);
final TableColumn column = new TableColumn(tableControl, SWT.NONE);
// tableLayout.addColumnData(columns[i]);
if (fTableColumns.fHeaders != null) {
column.setText(fTableColumns.fHeaders[i]);
}
}
}
fTable.getTable().addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(final KeyEvent e) {
handleKeyPressed(e);
}
});
// fTableControl.setLayout(tableLayout);
fTable.setContentProvider(fListViewerAdapter);
fTable.setLabelProvider(fLabelProvider);
fTable.addSelectionChangedListener(fListViewerAdapter);
fTable.addDoubleClickListener(fListViewerAdapter);
fTable.setInput(fParentElement);
if (fViewerSorter != null) {
fTable.setComparator(fViewerSorter);
}
fTableControl.setEnabled(isEnabled());
if (fSelectionWhenEnabled != null) {
postSetSelection(fSelectionWhenEnabled);
}
}
return fTableControl;
}
Aggregations