use of ch.cyberduck.binding.application.NSTableView in project cyberduck by iterate-ch.
the class ActivityController method setTable.
public void setTable(NSTableView table) {
this.table = table;
this.table.setRowHeight(new CGFloat(42));
{
final NSTableColumn c = tableColumnsFactory.create(ActivityColumn.single.name());
c.setMinWidth(80f);
c.setWidth(300f);
c.setResizingMask(NSTableColumn.NSTableColumnAutoresizingMask);
this.table.addTableColumn(c);
}
this.table.setDataSource((model = new ListDataSource() {
@Override
public NSObject tableView_objectValueForTableColumn_row(final NSTableView view, final NSTableColumn tableColumn, final NSInteger row) {
return null;
}
@Override
public NSInteger numberOfRowsInTableView(NSTableView view) {
return new NSInteger(tasks.size());
}
}).id());
this.table.setDelegate((delegate = new AbstractTableDelegate<TaskController, ActivityColumn>(table.tableColumnWithIdentifier("Default")) {
@Override
public void enterKeyPressed(final ID sender) {
}
@Override
public void deleteKeyPressed(final ID sender) {
}
@Override
public String tooltip(final TaskController c, final ActivityColumn column) {
return null;
}
@Override
public boolean tableView_shouldSelectRow(final NSTableView view, final NSInteger row) {
return false;
}
@Override
public void tableColumnClicked(final NSTableView view, final NSTableColumn tableColumn) {
}
@Override
public void tableRowDoubleClicked(final ID sender) {
}
@Override
public void selectionDidChange(final NSNotification notification) {
}
@Override
protected boolean isTypeSelectSupported() {
return false;
}
public NSView tableView_viewForTableColumn_row(final NSTableView view, final NSTableColumn column, final NSInteger row) {
final TaskController controller = getController(row);
return controller.view();
}
}).id());
this.table.sizeToFit();
}
Aggregations