use of javax.swing.table.DefaultTableModel in project nhin-d by DirectProject.
the class PKCS11SecretKeyManager method initUI.
private void initUI() {
this.getContentPane().setLayout(new BorderLayout(5, 5));
// Top Panel
JPanel topPanel = new JPanel();
topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
addAESKeyButton = new JButton("Add AES Key");
addAESKeyButton.setSize(new Dimension(30, 100));
addGenericKeyButton = new JButton("Add Text Key");
addGenericKeyButton.setSize(new Dimension(30, 100));
removeKeyButton = new JButton("Remove Key(s)");
removeKeyButton.setSize(new Dimension(30, 100));
topPanel.add(addAESKeyButton);
topPanel.add(addGenericKeyButton);
topPanel.add(removeKeyButton);
this.getContentPane().add(topPanel, BorderLayout.NORTH);
// Middle and list panel
JPanel midPanel = new JPanel();
midPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
midPanel.setLayout(new BorderLayout(5, 5));
JLabel keyListLabel = new JLabel("Secret Keys:");
Object[][] data = {};
String[] columnNames = { "Key Alias", "Key Type", "Key Value" };
keyDataModel = new DefaultTableModel(data, columnNames);
keyDataTable = new JTable(keyDataModel);
JScrollPane scrollPane = new JScrollPane(keyDataTable);
keyDataTable.setFillsViewportHeight(true);
midPanel.add(keyListLabel, BorderLayout.NORTH);
midPanel.add(scrollPane, BorderLayout.CENTER);
this.getContentPane().add(midPanel, BorderLayout.CENTER);
// Bottom Panel
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
quitButton = new JButton("Quit");
quitButton.setSize(new Dimension(30, 100));
bottomPanel.add(quitButton);
this.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
}
use of javax.swing.table.DefaultTableModel in project nhin-d by DirectProject.
the class PKCS11SecretKeyManagerUI method initUI.
private void initUI() {
this.getContentPane().setLayout(new BorderLayout(5, 5));
// Top Panel
JPanel topPanel = new JPanel();
topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
addAESKeyButton = new JButton("Add AES Key");
addAESKeyButton.setSize(new Dimension(30, 100));
addGenericKeyButton = new JButton("Add Text Key");
addGenericKeyButton.setSize(new Dimension(30, 100));
removeKeyButton = new JButton("Remove Key(s)");
removeKeyButton.setSize(new Dimension(30, 100));
topPanel.add(addAESKeyButton);
topPanel.add(addGenericKeyButton);
topPanel.add(removeKeyButton);
this.getContentPane().add(topPanel, BorderLayout.NORTH);
// Middle and list panel
JPanel midPanel = new JPanel();
midPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
midPanel.setLayout(new BorderLayout(5, 5));
JLabel keyListLabel = new JLabel("Secret Keys:");
Object[][] data = {};
String[] columnNames = { "Key Alias", "Key Type", "Key Value" };
keyDataModel = new DefaultTableModel(data, columnNames);
keyDataTable = new JTable(keyDataModel);
JScrollPane scrollPane = new JScrollPane(keyDataTable);
keyDataTable.setFillsViewportHeight(true);
midPanel.add(keyListLabel, BorderLayout.NORTH);
midPanel.add(scrollPane, BorderLayout.CENTER);
this.getContentPane().add(midPanel, BorderLayout.CENTER);
// Bottom Panel
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
quitButton = new JButton("Quit");
quitButton.setSize(new Dimension(30, 100));
bottomPanel.add(quitButton);
this.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
}
use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class AzureSelectDockerHostStep method onRemoveDockerHostAction.
private void onRemoveDockerHostAction() {
DefaultTableModel tableModel = (DefaultTableModel) dockerHostsTable.getModel();
String apiURL = (String) tableModel.getValueAt(dockerHostsTable.getSelectedRow(), 4);
DockerHost deleteHost = dockerManager.getDockerHostForURL(apiURL);
Azure azureClient = dockerManager.getSubscriptionsMap().get(deleteHost.sid).azureClient;
int option = AzureDockerUIResources.deleteAzureDockerHostConfirmationDialog(azureClient, deleteHost);
if (option != 1 && option != 2) {
if (AzureDockerUtils.DEBUG)
System.out.format("User canceled delete Docker host op: %d\n", option);
return;
}
AppInsightsClient.createByType(AppInsightsClient.EventType.DockerHost, deleteHost.name, "Remove");
int currentRow = dockerHostsTable.getSelectedRow();
tableModel.removeRow(currentRow);
tableModel.fireTableDataChanged();
if (dockerHostsTableSelection.row == currentRow) {
dockerHostsTableSelection = null;
}
AzureDockerUIResources.deleteDockerHost(model.getProject(), azureClient, deleteHost, option, new Runnable() {
@Override
public void run() {
dockerManager.refreshDockerHostDetails();
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
refreshDockerHostsTable();
}
});
}
});
setFinishButtonState(doValidate(false) == null);
setNextButtonState(doValidate(false) == null);
}
use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class AzureSelectDockerHostStep method onAddNewDockerHostAction.
private void onAddNewDockerHostAction() {
AppInsightsClient.createByType(AppInsightsClient.EventType.DockerHost, "", "Add");
AzureNewDockerWizardModel newDockerHostModel = new AzureNewDockerWizardModel(model.getProject(), dockerManager);
AzureNewDockerWizardDialog wizard = new AzureNewDockerWizardDialog(newDockerHostModel);
wizard.setTitle("Create Docker Host");
wizard.show();
if (wizard.getExitCode() == 0) {
dockerHostsTable.setEnabled(false);
DockerHost host = newDockerHostModel.getDockerHost();
dockerImageDescription.host = host;
dockerImageDescription.hasNewDockerHost = true;
dockerImageDescription.sid = host.sid;
model.setSubscription(this.dockerManager.getSubscriptionsMap().get(host.sid));
AzureDockerPreferredSettings dockerPrefferedSettings = dockerManager.getDockerPreferredSettings();
if (dockerPrefferedSettings == null) {
dockerPrefferedSettings = new AzureDockerPreferredSettings();
}
dockerPrefferedSettings.region = host.hostVM.region;
dockerPrefferedSettings.vmSize = host.hostVM.vmSize;
dockerPrefferedSettings.vmOS = host.hostOSType.name();
dockerManager.setDockerPreferredSettings(dockerPrefferedSettings);
final DefaultTableModel tableModel = (DefaultTableModel) dockerHostsTable.getModel();
if (dockerHostsTableSelection != null && (Boolean) tableModel.getValueAt(dockerHostsTableSelection.row, 0)) {
tableModel.setValueAt(false, dockerHostsTableSelection.row, 0);
}
Vector<Object> row = new Vector<>();
row.add(false);
row.add(host.name);
row.add("TO_BE_CREATED");
row.add(host.hostOSType.toString());
row.add(host.apiUrl);
tableModel.insertRow(0, row);
tableModel.setValueAt(true, 0, 0);
dockerHostsTable.setRowSelectionInterval(0, 0);
setFinishButtonState(doValidate(false) == null);
setNextButtonState(doValidate(false) == null);
}
}
use of javax.swing.table.DefaultTableModel in project azure-tools-for-java by Microsoft.
the class TablesQueryDesigner method addClause.
private void addClause() {
DefaultTableModel model = (DefaultTableModel) queryTable.getModel();
model.addRow(new Object[] { "", LogicalOperator.And, QueryField.PartitionKey, Operator.EqualsTo, "" });
}
Aggregations