Search in sources :

Example 1 with AssetContractEditDialog

use of com.moneychanger.ui.dialogs.AssetContractEditDialog in project otapij by FellowTraveler.

the class MainPage method jButton_EditAccount2ActionPerformed.

//GEN-LAST:event_jButton_AddAccount2ActionPerformed
private void jButton_EditAccount2ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton_EditAccount2ActionPerformed
    if (jTable_AssetList.getSelectedRow() > -1) {
        new AssetContractEditDialog(this, true, (String) jTable_AssetList.getModel().getValueAt(jTable_AssetList.getSelectedRow(), 1)).setVisible(true);
        refreshAssetContractList();
    } else {
        JOptionPane.showMessageDialog(this, "Please select an Asset Contract to edit.", "Asset Contract Edit Error", JOptionPane.ERROR_MESSAGE);
    }
}
Also used : AssetContractEditDialog(com.moneychanger.ui.dialogs.AssetContractEditDialog)

Example 2 with AssetContractEditDialog

use of com.moneychanger.ui.dialogs.AssetContractEditDialog in project otapij by FellowTraveler.

the class MainPage method jButton32ActionPerformed.

private void jButton32ActionPerformed(java.awt.event.ActionEvent evt) {
    //GEN-FIRST:event_jButton32ActionPerformed
    if (jTable19.getSelectedRow() > -1) {
        String assetID = (String) jTable19.getModel().getValueAt(jTable19.getSelectedRow(), 1);
        new AssetContractEditDialog(this, true, (String) jTable19.getModel().getValueAt(jTable19.getSelectedRow(), 1)).setVisible(true);
        refreshAssetContractList();
        String currentServerID = "ALL";
        if (serverMap != null && serverMap.size() > 0 && jComboBox7.getSelectedIndex() > -1) {
            currentServerID = ((String[]) serverMap.get((Integer) jComboBox7.getSelectedIndex()))[1];
        }
        System.out.println("currentServerID:" + currentServerID);
        List baskets = Basket.getBasketList(currentServerID, null);
        if (baskets != null && baskets.size() > 0 && !"Popup Dialog".equalsIgnoreCase(((String[]) baskets.get(0))[0])) {
            ((BasketTableModel) jTable19.getModel()).setValue(baskets);
            if (Utility.VerifyStringVal(assetID)) {
                for (int i = 0; i < jTable19.getRowCount(); i++) {
                    String id = (String) jTable19.getModel().getValueAt(i, 1);
                    if (!Utility.VerifyStringVal(id)) {
                        continue;
                    }
                    if (assetID.equals(id)) {
                        jTable19.setRowSelectionInterval(i, i);
                        break;
                    }
                }
            }
        }
    } else {
        JOptionPane.showMessageDialog(this, "Please select an Asset Contract to edit.", "Asset Contract Edit Error", JOptionPane.ERROR_MESSAGE);
    }
}
Also used : BasketTableModel(com.moneychanger.ui.model.BasketTableModel) List(java.util.List) AssetContractEditDialog(com.moneychanger.ui.dialogs.AssetContractEditDialog) Point(java.awt.Point)

Aggregations

AssetContractEditDialog (com.moneychanger.ui.dialogs.AssetContractEditDialog)2 BasketTableModel (com.moneychanger.ui.model.BasketTableModel)1 Point (java.awt.Point)1 List (java.util.List)1