Search in sources :

Example 51 with DefaultTableModel

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;
}
Also used : DefaultTableModel(javax.swing.table.DefaultTableModel)

Example 52 with DefaultTableModel

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);
    }
}
Also used : DefaultTableModel(javax.swing.table.DefaultTableModel) TableColumn(javax.swing.table.TableColumn) DefaultTableCellRenderer(javax.swing.table.DefaultTableCellRenderer)

Example 53 with DefaultTableModel

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();
}
Also used : DefaultTableModel(javax.swing.table.DefaultTableModel) SubscriptionDetail(com.microsoft.azuretools.authmanage.models.SubscriptionDetail)

Example 54 with DefaultTableModel

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();
}
Also used : DefaultTableModel(javax.swing.table.DefaultTableModel)

Example 55 with DefaultTableModel

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();
}
Also used : DefaultTableModel(javax.swing.table.DefaultTableModel)

Aggregations

DefaultTableModel (javax.swing.table.DefaultTableModel)139 JTable (javax.swing.JTable)18 Dimension (java.awt.Dimension)14 Vector (java.util.Vector)14 JScrollPane (javax.swing.JScrollPane)14 TableColumn (javax.swing.table.TableColumn)12 JBTable (com.intellij.ui.table.JBTable)10 Point (java.awt.Point)10 ActionEvent (java.awt.event.ActionEvent)9 JPanel (javax.swing.JPanel)9 ListSelectionEvent (javax.swing.event.ListSelectionEvent)9 ListSelectionListener (javax.swing.event.ListSelectionListener)9 JButton (javax.swing.JButton)8 ActionListener (java.awt.event.ActionListener)7 WebAppDetails (com.microsoft.azuretools.utils.WebAppUtils.WebAppDetails)6 Color (java.awt.Color)6 ArrayList (java.util.ArrayList)6 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)5 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)5 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5