VariablesPanel.java 文件源码

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

项目:incubator-netbeans 作者:
private Variable showDialog() {
    JPanel inset = new JPanel(new BorderLayout());
    inset.setBorder(new EmptyBorder(12,12,0,12));
    inset.add(this);
    inset.getAccessibleContext().setAccessibleName(NbBundle.getMessage(VariablesPanel.class, "AN_Manage_Variables"));
    inset.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(VariablesPanel.class, "AD_Manage_Variables"));
    DialogDescriptor dd = new DialogDescriptor(inset, NbBundle.getMessage(VariablesPanel.class, "TITLE_Manage_Variables")); // NOI18N
    dd.setModal(true);
    final JButton ok = new JButton(NbBundle.getMessage(VariablesPanel.class, "BUTTON_OK")); // NOI18N
    ok.setDefaultCapable(true);
    explorer.addPropertyChangeListener(new PropertyChangeListener() {
       public void propertyChange(PropertyChangeEvent evt) {
           removeButton.setEnabled(explorer.getSelectedNodes().length > 0);
           editButton.setEnabled(explorer.getSelectedNodes().length == 1);
       }
    });
    dd.setOptions(new Object[] {ok, NotifyDescriptor.CANCEL_OPTION});
    dd.setClosingOptions(new Object[] {ok, NotifyDescriptor.CANCEL_OPTION});
    if (DialogDisplayer.getDefault().notify(dd) == ok) {
        model.save();
        if (explorer.getSelectedNodes().length == 1) {
            return explorer.getSelectedNodes()[0].getLookup().lookup(Variable.class);
        }
    }
    return null;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号