use of javax.swing.table.DefaultTableModel in project processdash by dtuma.
the class PermissionList method setContents.
public void setContents(List<Permission> permissions) {
clearSelection();
DefaultTableModel m = getTableModel();
if (permissions.isEmpty()) {
m.setRowCount(1);
m.setValueAt(NO_PERMISSION, 0, 0);
} else {
m.setRowCount(permissions.size());
for (int i = 0; i < permissions.size(); i++) m.setValueAt(permissions.get(i), i, 0);
}
this.dirty = false;
}
use of javax.swing.table.DefaultTableModel in project android by JetBrains.
the class ResourceTablePanel method select.
public void select(@Nullable ResourceChooserItem item) {
if (item != null) {
myTable.setModel(new ResourceTableModel(item));
// Pick a font that can display the various translations
TableColumn valueColumn = myTable.getColumnModel().getColumn(1);
valueColumn.setCellRenderer(new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (column == 1) {
String s = value.toString();
component.setFont(FontUtil.getFontAbleToDisplay(s, table.getFont()));
} else {
component.setFont(table.getFont());
}
return component;
}
});
myNameLabel.setText(item.getName());
myTable.setRowHeight(ChooseResourceDialog.TABLE_CELL_HEIGHT);
myEditTranslationsLink.setVisible(item.getType() == ResourceType.STRING && !item.isFramework());
} else {
myNameLabel.setText("");
myTable.setModel(new DefaultTableModel(0, 2));
myEditTranslationsLink.setVisible(false);
}
}
use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class SubscriptionsDialog method setSubscriptions.
private void setSubscriptions() {
DefaultTableModel model = (DefaultTableModel) table.getModel();
for (SubscriptionDetail sd : sdl) {
model.addRow(new Object[] { sd.isSelected(), sd.getSubscriptionName(), sd.getSubscriptionId() });
}
model.fireTableDataChanged();
}
use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class WarSelectDialog method doOKAction.
@Override
protected void doOKAction() {
DefaultTableModel tableModel = (DefaultTableModel) table.getModel();
int i = table.getSelectedRow();
if (i < 0) {
JOptionPane.showMessageDialog(contentPane, "Please select an artifact", "Select Artifact Status", JOptionPane.INFORMATION_MESSAGE);
return;
}
selectedArtifact = artifactList.get(i);
super.doOKAction();
}
use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class WebAppDeployDialog method cleanTable.
private void cleanTable() {
DefaultTableModel dm = (DefaultTableModel) table.getModel();
dm.getDataVector().removeAllElements();
webAppWebAppDetailsMap.clear();
dm.fireTableDataChanged();
}
Aggregations