table.addListener(SWT.Selection, event -> handleSelectionChanged(table.indexOf((TableItem) event.item))); text.addListener(SWT.Modify, event -> { ColumnObject columnObject = columnObjects[table.getSelectionIndex()];
table.addListener(SWT.Selection, event -> handleSelectionChanged(table.indexOf((TableItem) event.item))); text.addListener(SWT.Modify, event -> { ColumnObject columnObject = columnObjects[table.getSelectionIndex()];
/** * @param table * @param up */ protected void handleMove(Table table, boolean up) { int index = table.getSelectionIndex(); int newIndex = index + (up ? -1 : 1); if (index < 0 || index >= table.getItemCount()) { return; } ColumnObject columnObject = columnObjects[index]; columnObjects[index] = columnObjects[newIndex]; columnObjects[newIndex] = columnObject; table.getItem(index).dispose(); TableItem newItem = new TableItem(table, SWT.NONE, newIndex); newItem.setText(columnObject.name); newItem.setImage(columnObject.image); newItem.setData(columnObject); table.setSelection(newIndex); handleSelectionChanged(newIndex); }
/** * @param table * @param up */ protected void handleMove(Table table, boolean up) { int index = table.getSelectionIndex(); int newIndex = index + (up ? -1 : 1); if (index < 0 || index >= table.getItemCount()) { return; } ColumnObject columnObject = columnObjects[index]; columnObjects[index] = columnObjects[newIndex]; columnObjects[newIndex] = columnObject; table.getItem(index).dispose(); TableItem newItem = new TableItem(table, SWT.NONE, newIndex); newItem.setText(columnObject.name); newItem.setImage(columnObject.image); newItem.setData(columnObject); table.setSelection(newIndex); handleSelectionChanged(newIndex); }
/** * @param table * @param up */ protected void handleMove(Table table, boolean up) { int index = table.getSelectionIndex(); int newIndex = index + (up ? -1 : 1); if (index < 0 || index >= table.getItemCount()) { return; } ColumnObject columnObject = columnObjects[index]; columnObjects[index] = columnObjects[newIndex]; columnObjects[newIndex] = columnObject; table.getItem(index).dispose(); TableItem newItem = new TableItem(table, SWT.NONE, newIndex); newItem.setText(columnObject.name); newItem.setImage(columnObject.image); newItem.setData(columnObject); table.setSelection(newIndex); handleSelectionChanged(newIndex); }
protected void initializeBounds() { super.initializeBounds(); table.setSelection(0); handleSelectionChanged(0); }
@Override protected void initializeBounds() { super.initializeBounds(); table.setSelection(0); handleSelectionChanged(0); }
@Override protected void initializeBounds() { super.initializeBounds(); table.setSelection(0); handleSelectionChanged(0); }