PropertyPanel.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:incubator-netbeans 作者:
/** Creates new form PropertyPanel */
public PropertyPanel(String propCat, boolean add, SessionFactory sessionFactory, String propName, String propValue) {
    initComponents();

    // The comb box only contains the property names that are not defined yet when adding
    if (add) {
        nameComboBox.setModel(new DefaultComboBoxModel(Util.getAvailPropNames(propCat, sessionFactory)));
    } else {
        nameComboBox.setModel(new DefaultComboBoxModel(Util.getAllPropNames(propCat)));
        nameComboBox.setSelectedItem(propName);
    }

    valueTextField = new JTextField();
    valueComboBox = new JComboBox();

    // Add the appropriate component for the value 
    String selectedPropName = (String) nameComboBox.getSelectedItem();
    addValueComponent(selectedPropName, propValue);

    nameComboBox.addActionListener((ActionListener) this);

    // Disable the name combo box for editing
    nameComboBox.setEnabled(add);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号