This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 35334
Collapse All | Expand All

(-)openide/src/org/openide/explorer/propertysheet/IndexedEditorPanel.form (-26 / +15 lines)
Lines 8-34 Link Here
8
      </Border>
8
      </Border>
9
    </Property>
9
    </Property>
10
  </Properties>
10
  </Properties>
11
  <SyntheticProperties>
11
  <AuxValues>
12
    <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
12
    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
13
  </SyntheticProperties>
13
  </AuxValues>
14
14
15
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
15
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
16
  <SubComponents>
16
  <SubComponents>
17
    <Container class="org.openide.explorer.view.TreeTableView" name="treeTableView1">
18
19
      <AuxValues>
20
        <AuxValue name="JavaCodeGenerator_InitCodePre" type="java.lang.String" value=""/>
21
        <AuxValue name="JavaCodeGenerator_CreateCodePre" type="java.lang.String" value=""/>
22
        <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value=""/>
23
      </AuxValues>
24
      <Constraints>
25
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
26
          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="-1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="11" anchor="10" weightX="1.0" weightY="0.1"/>
27
        </Constraint>
28
      </Constraints>
29
30
      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
31
    </Container>
32
    <Container class="javax.swing.JPanel" name="jPanel1">
17
    <Container class="javax.swing.JPanel" name="jPanel1">
33
      <Constraints>
18
      <Constraints>
34
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
19
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
Lines 48-54 Link Here
48
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_New" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
33
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_New" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
49
            </Property>
34
            </Property>
50
          </Properties>
35
          </Properties>
51
52
          <Events>
36
          <Events>
53
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="newButtonActionPerformed"/>
37
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="newButtonActionPerformed"/>
54
          </Events>
38
          </Events>
Lines 59-65 Link Here
59
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_Delete" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
43
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_Delete" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
60
            </Property>
44
            </Property>
61
          </Properties>
45
          </Properties>
62
63
          <Events>
46
          <Events>
64
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteButtonActionPerformed"/>
47
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteButtonActionPerformed"/>
65
          </Events>
48
          </Events>
Lines 70-76 Link Here
70
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_MoveUp" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
53
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_MoveUp" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
71
            </Property>
54
            </Property>
72
          </Properties>
55
          </Properties>
73
74
          <Events>
56
          <Events>
75
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="upButtonActionPerformed"/>
57
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="upButtonActionPerformed"/>
76
          </Events>
58
          </Events>
Lines 81-87 Link Here
81
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_MoveDown" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
63
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_MoveDown" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
82
            </Property>
64
            </Property>
83
          </Properties>
65
          </Properties>
84
85
          <Events>
66
          <Events>
86
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="downButtonActionPerformed"/>
67
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="downButtonActionPerformed"/>
87
          </Events>
68
          </Events>
Lines 92-98 Link Here
92
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_HideDetails" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
73
              <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_HideDetails" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
93
            </Property>
74
            </Property>
94
          </Properties>
75
          </Properties>
95
96
          <Events>
76
          <Events>
97
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="detailsButtonActionPerformed"/>
77
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="detailsButtonActionPerformed"/>
98
          </Events>
78
          </Events>
Lines 101-112 Link Here
101
    </Container>
81
    </Container>
102
    <Component class="javax.swing.JLabel" name="propertiesLabel">
82
    <Component class="javax.swing.JLabel" name="propertiesLabel">
103
      <Properties>
83
      <Properties>
104
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
105
          <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_Properties" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
106
        </Property>
107
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
84
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
108
          <Connection component="treeTableView1" type="bean"/>
85
          <Connection component="treeTableView1" type="bean"/>
109
        </Property>
86
        </Property>
87
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
88
          <ResourceString bundle="org/openide/explorer/propertysheet/Bundle.properties" key="CTL_Properties" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString(&quot;{key}&quot;)"/>
89
        </Property>
110
      </Properties>
90
      </Properties>
111
      <Constraints>
91
      <Constraints>
112
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
92
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
Lines 114-118 Link Here
114
        </Constraint>
94
        </Constraint>
115
      </Constraints>
95
      </Constraints>
116
    </Component>
96
    </Component>
97
    <Container class="javax.swing.JPanel" name="jPanel2">
98
      <Constraints>
99
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
100
          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="11" anchor="10" weightX="1.0" weightY="0.0"/>
101
        </Constraint>
102
      </Constraints>
103
104
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
105
    </Container>
117
  </SubComponents>
106
  </SubComponents>
118
</Form>
107
</Form>
(-)openide/src/org/openide/explorer/propertysheet/IndexedEditorPanel.java (-26 / +40 lines)
Lines 15-25 Link Here
15
15
16
import java.beans.*;
16
import java.beans.*;
17
import java.awt.Component;
17
import java.awt.Component;
18
import javax.swing.Action;
18
import javax.swing.Scrollable;
19
import javax.swing.Scrollable;
19
import javax.swing.JScrollPane;
20
import javax.swing.JScrollPane;
20
import javax.swing.JPanel;
21
import javax.swing.JPanel;
21
                
22
                
22
import org.openide.explorer.ExplorerManager;
23
import org.openide.explorer.ExplorerManager;
24
import org.openide.explorer.ExplorerPanel;
25
import org.openide.explorer.view.TreeTableView;
23
import org.openide.nodes.Node;
26
import org.openide.nodes.Node;
24
import org.openide.util.actions.NodeAction;
27
import org.openide.util.actions.NodeAction;
25
import org.openide.util.actions.SystemAction;
28
import org.openide.util.actions.SystemAction;
Lines 34-42 Link Here
34
37
35
    private ExplorerManager em;
38
    private ExplorerManager em;
36
39
37
    private NodeAction moveUp;
40
    private Action moveUp;
38
    private NodeAction moveDown;
41
    private Action moveDown;
39
    private NodeAction newAction;
42
    private Action newAction;
40
    private boolean showingDetails = false;
43
    private boolean showingDetails = false;
41
    private Node rootNode;
44
    private Node rootNode;
42
    private Node.Property prop;
45
    private Node.Property prop;
Lines 46-52 Link Here
46
49
47
    /** Creates new form IndexedEditorPanel */
50
    /** Creates new form IndexedEditorPanel */
48
    public IndexedEditorPanel(Node node, Node.Property[] props) {
51
    public IndexedEditorPanel(Node node, Node.Property[] props) {
52
        // XXX just hot fix (setLabelFor is in initComponents).
53
        treeTableView1 = new TreeTableView();
49
        initComponents();
54
        initComponents();
55
56
        ExplorerPanel exPanel = new ExplorerPanel(getExplorerManager());
57
        exPanel.add(treeTableView1);
58
        jPanel2.setLayout(new java.awt.BorderLayout());
59
        jPanel2.add(exPanel);
50
        
60
        
51
        detailsPanel.setLayout(new java.awt.BorderLayout());
61
        detailsPanel.setLayout(new java.awt.BorderLayout());
52
        getExplorerManager().setRootContext(node);
62
        getExplorerManager().setRootContext(node);
Lines 61-69 Link Here
61
        
71
        
62
        node.addPropertyChangeListener(this);
72
        node.addPropertyChangeListener(this);
63
        try {
73
        try {
64
            moveUp = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.MoveUpAction")); // NOI18N
74
            NodeAction globalMoveUp = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.MoveUpAction")); // NOI18N
65
            moveDown = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.MoveDownAction")); // NOI18N
75
            NodeAction globalMoveDown = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.MoveDownAction")); // NOI18N
66
            newAction = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.NewAction")); // NOI18N
76
            NodeAction globalNewAction = (NodeAction)SystemAction.get(Class.forName("org.openide.actions.NewAction")); // NOI18N
77
            // Get context aware instances.
78
            moveUp = globalMoveUp.createContextAwareInstance(exPanel.getLookup());
79
            moveDown = globalMoveDown.createContextAwareInstance(exPanel.getLookup());
80
            newAction = globalNewAction.createContextAwareInstance(exPanel.getLookup());
67
        } catch (ClassNotFoundException cnfe) {
81
        } catch (ClassNotFoundException cnfe) {
68
        }
82
        }
69
        
83
        
Lines 95-101 Link Here
95
    private void initComponents() {//GEN-BEGIN:initComponents
109
    private void initComponents() {//GEN-BEGIN:initComponents
96
        java.awt.GridBagConstraints gridBagConstraints;
110
        java.awt.GridBagConstraints gridBagConstraints;
97
111
98
        treeTableView1 = new org.openide.explorer.view.TreeTableView();
99
        jPanel1 = new javax.swing.JPanel();
112
        jPanel1 = new javax.swing.JPanel();
100
        newButton = new javax.swing.JButton();
113
        newButton = new javax.swing.JButton();
101
        deleteButton = new javax.swing.JButton();
114
        deleteButton = new javax.swing.JButton();
Lines 103-122 Link Here
103
        downButton = new javax.swing.JButton();
116
        downButton = new javax.swing.JButton();
104
        detailsButton = new javax.swing.JButton();
117
        detailsButton = new javax.swing.JButton();
105
        propertiesLabel = new javax.swing.JLabel();
118
        propertiesLabel = new javax.swing.JLabel();
119
        jPanel2 = new javax.swing.JPanel();
106
120
107
        setLayout(new java.awt.GridBagLayout());
121
        setLayout(new java.awt.GridBagLayout());
108
122
109
        setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(12, 12, 0, 12)));
123
        setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(12, 12, 0, 12)));
110
        gridBagConstraints = new java.awt.GridBagConstraints();
111
        gridBagConstraints.gridx = 0;
112
        gridBagConstraints.gridy = 1;
113
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE;
114
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
115
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 11);
116
        gridBagConstraints.weightx = 1.0;
117
        gridBagConstraints.weighty = 0.1;
118
        add(treeTableView1, gridBagConstraints);
119
120
        jPanel1.setLayout(new java.awt.GridLayout(5, 1, 0, 5));
124
        jPanel1.setLayout(new java.awt.GridLayout(5, 1, 0, 5));
121
125
122
        newButton.setText(org.openide.util.NbBundle.getBundle(IndexedEditorPanel.class).getString("CTL_New"));
126
        newButton.setText(org.openide.util.NbBundle.getBundle(IndexedEditorPanel.class).getString("CTL_New"));
Lines 173-180 Link Here
173
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 0);
177
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 0);
174
        add(jPanel1, gridBagConstraints);
178
        add(jPanel1, gridBagConstraints);
175
179
176
        propertiesLabel.setText(org.openide.util.NbBundle.getBundle(IndexedEditorPanel.class).getString("CTL_Properties"));
177
        propertiesLabel.setLabelFor(treeTableView1);
180
        propertiesLabel.setLabelFor(treeTableView1);
181
        propertiesLabel.setText(org.openide.util.NbBundle.getBundle(IndexedEditorPanel.class).getString("CTL_Properties"));
178
        gridBagConstraints = new java.awt.GridBagConstraints();
182
        gridBagConstraints = new java.awt.GridBagConstraints();
179
        gridBagConstraints.gridx = 0;
183
        gridBagConstraints.gridx = 0;
180
        gridBagConstraints.gridy = 0;
184
        gridBagConstraints.gridy = 0;
Lines 183-188 Link Here
183
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 11);
187
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 11);
184
        add(propertiesLabel, gridBagConstraints);
188
        add(propertiesLabel, gridBagConstraints);
185
189
190
        gridBagConstraints = new java.awt.GridBagConstraints();
191
        gridBagConstraints.gridx = 0;
192
        gridBagConstraints.gridy = 1;
193
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
194
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 11);
195
        gridBagConstraints.weightx = 1.0;
196
        add(jPanel2, gridBagConstraints);
197
186
    }//GEN-END:initComponents
198
    }//GEN-END:initComponents
187
199
188
private void detailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_detailsButtonActionPerformed
200
private void detailsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_detailsButtonActionPerformed
Lines 204-210 Link Here
204
            PropertyDialogManager.notify(pve);
216
            PropertyDialogManager.notify(pve);
205
        }
217
        }
206
        if ((newAction != null) && (newAction.isEnabled())) {
218
        if ((newAction != null) && (newAction.isEnabled())) {
207
            newAction.performAction();
219
            newAction.actionPerformed(evt);
208
        } 
220
        } 
209
}//GEN-LAST:event_newButtonActionPerformed
221
}//GEN-LAST:event_newButtonActionPerformed
210
222
Lines 224-230 Link Here
224
private void downButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downButtonActionPerformed
236
private void downButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_downButtonActionPerformed
225
        Node[] sn = getExplorerManager().getSelectedNodes();    
237
        Node[] sn = getExplorerManager().getSelectedNodes();    
226
        if ((moveDown != null) && (moveDown.isEnabled())) {
238
        if ((moveDown != null) && (moveDown.isEnabled())) {
227
            moveDown.performAction();
239
            moveDown.actionPerformed(evt);
228
        } 
240
        } 
229
        
241
        
230
        if ((sn == null) || (sn.length != 1) || (sn[0] == rootNode)) {
242
        if ((sn == null) || (sn.length != 1) || (sn[0] == rootNode)) {
Lines 240-246 Link Here
240
private void upButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_upButtonActionPerformed
252
private void upButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_upButtonActionPerformed
241
        Node[] sn = getExplorerManager().getSelectedNodes();    
253
        Node[] sn = getExplorerManager().getSelectedNodes();    
242
        if ((moveUp != null) && (moveUp.isEnabled())) {
254
        if ((moveUp != null) && (moveUp.isEnabled())) {
243
            moveUp.performAction();
255
            moveUp.actionPerformed(evt);
244
        }
256
        }
245
        
257
        
246
        if ((sn == null) || (sn.length != 1) || (sn[0] == rootNode)) {
258
        if ((sn == null) || (sn.length != 1) || (sn[0] == rootNode)) {
Lines 260-275 Link Here
260
    }
272
    }
261
273
262
    // Variables declaration - do not modify//GEN-BEGIN:variables
274
    // Variables declaration - do not modify//GEN-BEGIN:variables
263
    private org.openide.explorer.view.TreeTableView treeTableView1;
275
    private javax.swing.JButton deleteButton;
264
    private javax.swing.JButton detailsButton;
276
    private javax.swing.JButton detailsButton;
265
    private javax.swing.JLabel propertiesLabel;
266
    private javax.swing.JButton newButton;
267
    private javax.swing.JButton downButton;
277
    private javax.swing.JButton downButton;
268
    private javax.swing.JButton deleteButton;
269
    private javax.swing.JPanel jPanel1;
278
    private javax.swing.JPanel jPanel1;
279
    private javax.swing.JPanel jPanel2;
280
    private javax.swing.JButton newButton;
281
    private javax.swing.JLabel propertiesLabel;
270
    private javax.swing.JButton upButton;
282
    private javax.swing.JButton upButton;
271
    // End of variables declaration//GEN-END:variables
283
    // End of variables declaration//GEN-END:variables
272
284
    // XXX look into constructor
285
    private TreeTableView treeTableView1;
286
    
273
    private void updateButtonState() {
287
    private void updateButtonState() {
274
        if (showingDetails) {
288
        if (showingDetails) {
275
            detailsButton.setText(NbBundle.getBundle(IndexedEditorPanel.class).getString("CTL_HideDetails"));
289
            detailsButton.setText(NbBundle.getBundle(IndexedEditorPanel.class).getString("CTL_HideDetails"));

Return to bug 35334