use of javax.swing.table.AbstractTableModel in project intellij-community by JetBrains.
the class CodeStyleImportsPanelBase method refreshTable.
private void refreshTable(final JBTable table, final PackageEntryTable packageTable) {
AbstractTableModel model = (AbstractTableModel) table.getModel();
table.createDefaultColumnsFromModel();
model.fireTableDataChanged();
ImportLayoutPanel.resizeColumns(packageTable, table, myImportLayoutPanel.areStaticImportsEnabled());
}
use of javax.swing.table.AbstractTableModel in project intellij-community by JetBrains.
the class AddEditRemovePanel method initTable.
private void initTable() {
myTableModel = new AbstractTableModel() {
public int getColumnCount() {
return myModel.getColumnCount();
}
public int getRowCount() {
return myData != null ? myData.size() : 0;
}
public Class getColumnClass(int columnIndex) {
return myModel.getColumnClass(columnIndex);
}
public String getColumnName(int column) {
return myModel.getColumnName(column);
}
public Object getValueAt(int rowIndex, int columnIndex) {
return myModel.getField(myData.get(rowIndex), columnIndex);
}
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
myModel.setValue(aValue, myData.get(rowIndex), columnIndex);
fireTableRowsUpdated(rowIndex, rowIndex);
}
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
return myModel.isEditable(columnIndex);
}
};
myTable = createTable();
myTable.setModel(myTableModel);
myTable.setShowColumns(false);
myTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
myTable.setStriped(true);
new DoubleClickListener() {
@Override
protected boolean onDoubleClick(MouseEvent event) {
doEdit();
return true;
}
}.installOn(myTable);
}
use of javax.swing.table.AbstractTableModel in project processdash by dtuma.
the class TaskScheduleDialog method evRecalculated.
public void evRecalculated(EventObject e) {
recalcActiveMilestoneDateRow();
// We have to manually generate events for the JTreeTable,
// since it has installed some wrapper object to convert the
// TreeTableModel into a TableModel.
AbstractTableModel model = (AbstractTableModel) treeTable.getModel();
model.fireTableChanged(new TableModelEvent(model, 0, treeTable.getRowCount() - 1));
// Calculating the schedule may mean that direct time columns now
// need to be displayed or hidden
showHideColumns();
// Since rows may have been added or deleted to the schedule, and
// rows may have changed to or from automatic rows, update the
// buttons appropriately.
enableScheduleButtons();
// Display the error button if necessary.
maybeDisplayErrorButton();
// highlight any errors in the EVModel if they exist.
highlightErrors(getErrors());
}
use of javax.swing.table.AbstractTableModel in project cayenne by apache.
the class TemplatePreferences method addTemplateAction.
public void addTemplateAction() {
FSPath path = new TemplateCreator(this).startupAction();
if (path != null) {
int len = templateEntries.size();
templateEntries.add(path);
((AbstractTableModel) view.getTable().getModel()).fireTableRowsInserted(len, len);
}
}
use of javax.swing.table.AbstractTableModel in project cayenne by apache.
the class MergerTokenSelectorController method reverseAllAction.
public void reverseAllAction() {
isReverse = !isReverse;
for (int i = 0; i < selectableTokensList.size(); i++) {
MergerToken token = selectableTokensList.get(i);
MergerToken reverse = token.createReverse(mergerTokenFactory);
selectableTokensList.set(i, reverse);
if (excludedTokens.remove(token)) {
excludedTokens.add(reverse);
}
}
Collections.sort(selectableTokensList);
AbstractTableModel model = (AbstractTableModel) view.getTokens().getModel();
model.fireTableDataChanged();
}
Aggregations