Now I have full row selection see:
http://berdachuk.at.tut.by
But I need something leke
http://berdachuk.at.tut.by
There is some code (itemList - data model)
private void createTable(Composite parent) {
int style =
SWT.SINGLE
| SWT.BORDER
| SWT.H_SCROLL
| SWT.V_SCROLL
| SWT.FULL_SELECTION;
table = new Table(parent, style);
GridData gridData = new GridData(GridData.FILL_BOT
gridData.grabExcessVertica
gridData.horizontalSpan = 3;
table.setLayoutData(gridDa
table.setLinesVisible(true
table.setHeaderVisible(tru
TableColumn column0 = new TableColumn(table, SWT.NONE, 0);
column0.setText(itemList.g
column0.setAlignment(SWT.L
column0.setWidth(150);
TableColumn column1 = new TableColumn(table, SWT.NONE, 1);
column1.setText(itemList.g
column1.setAlignment(SWT.L
column1.setWidth(150);
TableColumn column2 = new TableColumn(table, SWT.NONE, 2);
column2.setText(itemList.g
column2.setAlignment(SWT.L
column2.setWidth(200);
TableColumn column3 = new TableColumn(table, SWT.NONE, 3);
column3.setText(itemList.g
column3.setAlignment(SWT.L
column3.setWidth(150);
}
private void createTableViewer() {
tableViewer = new TableViewer(table);
tableViewer.setUseHashlook
tableViewer.setColumnPrope
//Initialise cell editors
CellEditor editors[] = new CellEditor[itemList.column
editors[0] = new TextCellEditor(table);
editors[1] = new TextCellEditor(table);
editors[2] = new TextCellEditor(table);
// Column 3 (Combo Box)
editors[3] =
new ComboBoxCellEditor(
table,
itemList.getConfirmModes()
SWT.READ_ONLY);
tableViewer.setColumnPrope
//Assign the cell editors to the viewer
tableViewer.setCellEditors
// Set the cell modifier for the viewer
tableViewer.setCellModifie
}
//////////////////////////
import org.eclipse.jface.viewers.
import org.eclipse.swt.widgets.Ta
/**
* @author sberdachuk
* */
public class ItemListCellModifier implements ICellModifier {
private ItemList itemList = null;
/**
*
*/
public ItemListCellModifier(ItemL
super();
this.itemList = itemList;
}
public void modify(Object element, String property, Object value) {
int columnIndex = itemList.getColumnNames().
TableItem item = (TableItem) element;
Item r = (Item) item.getData();
String valueString;
switch (columnIndex) {
case 0 :
itemList.setData(r.getRowI
break;
case 1 :
itemList.setData(r.getRowI
break;
case 2 :
itemList.setData(r.getRowI
break;
case 3 :
valueString =
itemList
.getConfirmModes()[((Integ
.intValue()]
.trim();
String s = r.getString(3);
if (!s.equals(valueString)) {
r.setData(columnIndex, valueString);
}
break;
default :
}
}
public boolean canModify(Object element, String property) {
return true;
}
public Object getValue(Object element, String property) {
Item r = (Item) element;
int columnIndex = itemList.getColumnNames().
String stringValue = r.getString(columnIndex);
if (columnIndex == 3) {
String[] choices = itemList.getConfirmModes(p
int i = choices.length - 1;
while (!stringValue.equals(choic
--i;
return new Integer(i);
} else {
return stringValue;
}
}
}
Main Topics
Browse All Topics





by: JohnnyAffaPosted on 2004-08-06 at 22:29:00ID: 11741655
can you post you code here becuse im not really sure what you are talking about