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 60782
Collapse All | Expand All

(-)core/swing/tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/ToolbarTabDisplayerUI.java (+8 lines)
Lines 498-502 Link Here
498
498
499
            g.setColor(color);
499
            g.setColor(color);
500
        }
500
        }
501
        
502
        public Dimension getPreferredSize() {
503
            Dimension result = new Dimension(super.getPreferredSize());
504
            if ("Aqua".equals(UIManager.getLookAndFeel().getID())) {
505
                result.height += 5;
506
            }
507
            return result;
508
        }
501
    }
509
    }
502
}
510
}
(-)core/windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedContainerBridgeImpl.java (-2 / +22 lines)
Lines 18-23 Link Here
18
18
19
package org.netbeans.core.windows.view.ui.tabcontrol;
19
package org.netbeans.core.windows.view.ui.tabcontrol;
20
20
21
import java.awt.Component;
21
import java.util.List;
22
import java.util.List;
22
import java.util.Arrays;
23
import java.util.Arrays;
23
import javax.swing.JComponent;
24
import javax.swing.JComponent;
Lines 115-122 Link Here
115
116
116
    public void setInnerComponent(JComponent jc, JComponent inner) {
117
    public void setInnerComponent(JComponent jc, JComponent inner) {
117
        TabbedContainer cont = (TabbedContainer) jc;
118
        TabbedContainer cont = (TabbedContainer) jc;
118
        ComponentConverter cc = new ComponentConverter.Fixed (inner);
119
        cont.setComponentConverter(new CC (inner));
119
        cont.setComponentConverter(cc);
120
    }
120
    }
121
    
121
    
122
    public JComponent getInnerComponent(JComponent jc) {
122
    public JComponent getInnerComponent(JComponent jc) {
Lines 132-137 Link Here
132
            td[i] = new TabData (objects[i], null, titles[i], null);
132
            td[i] = new TabData (objects[i], null, titles[i], null);
133
        }
133
        }
134
        cont.getModel().setTabs(td);
134
        cont.getModel().setTabs(td);
135
    }
136
    
137
    private static final class CC implements ComponentConverter {
138
        private final JComponent inner;
139
        public CC (JComponent inner) {
140
            this.inner = inner;
141
        }
142
        public Component getComponent(TabData data) {
143
            Component result = null;
144
            if (data == null) {
145
                result = inner;
146
            } else if (data.getUserObject() instanceof Component) {
147
                result = (Component) data.getUserObject();
148
            } else {
149
                result = inner;
150
            }
151
            if (!(result instanceof javax.swing.JSplitPane)) {
152
            }
153
            return result;
154
        }
135
    }
155
    }
136
    
156
    
137
}
157
}
(-)form/src/org/netbeans/modules/form/Bundle.properties (+5 lines)
Lines 685-687 Link Here
685
CTL_AlignmentButton_d=Set bottom alignment
685
CTL_AlignmentButton_d=Set bottom alignment
686
CTL_ResizeButton_h=Change horizontal resizability
686
CTL_ResizeButton_h=Change horizontal resizability
687
CTL_ResizeButton_v=Change vertical resizability
687
CTL_ResizeButton_v=Change vertical resizability
688
689
#CustPanel
690
FMT_ClassName=({0})
691
LBL_Enabled=Enabled
692
(-)form/src/org/netbeans/modules/form/CustPanel.java (+420 lines)
Added Link Here
1
/*
2
 * CustPanel.java
3
 *
4
 * Created on July 6, 2005, 7:19 AM
5
 *
6
 * To change this template, choose Tools | Options and locate the template under
7
 * the Source Creation and Management node. Right-click the template and choose
8
 * Open. You can then make changes to the template in the Source Editor.
9
 */
10
11
package org.netbeans.modules.form;
12
import java.awt.Color;
13
import java.awt.Component;
14
import java.awt.Dimension;
15
import java.awt.Font;
16
import java.awt.Graphics;
17
import java.awt.Insets;
18
import java.awt.event.ActionEvent;
19
import java.awt.event.ActionListener;
20
import java.awt.event.FocusEvent;
21
import java.awt.event.FocusListener;
22
import java.awt.event.KeyEvent;
23
import java.awt.event.KeyListener;
24
import java.awt.event.MouseEvent;
25
import java.awt.event.MouseListener;
26
import java.lang.reflect.InvocationTargetException;
27
import javax.swing.BoxLayout;
28
import javax.swing.JCheckBox;
29
import javax.swing.JLabel;
30
import javax.swing.JPanel;
31
import javax.swing.JSeparator;
32
import javax.swing.JTextField;
33
import javax.swing.SwingConstants;
34
import javax.swing.UIManager;
35
import javax.swing.border.Border;
36
import org.openide.ErrorManager;
37
import org.openide.explorer.propertysheet.PropertyPanel;
38
import org.openide.nodes.Node;
39
import org.openide.util.NbBundle;
40
41
/**
42
 *
43
 * @author tim
44
 */
45
class CustPanel extends JPanel implements MouseListener, FocusListener, Border, KeyListener, ActionListener {
46
    private JLabel nameLbl = new JLabel();
47
    private JLabel typeLbl = new JLabel();
48
    private JTextField nameField = new JTextField();
49
    private JSeparator js = new JSeparator();
50
    private PropertyPanel custom = new PropertyPanel();
51
    private JCheckBox enabled = new JCheckBox();
52
    private JLabel propLbl = new JLabel();
53
    
54
    /** Creates a new instance of CustPanel */
55
    CustPanel() {
56
        setLayout (new BoxLayout (this, BoxLayout.Y_AXIS));
57
        init();
58
    }
59
    
60
    void init() {
61
        nameLbl.setBorder (this);
62
        nameLbl.addMouseListener (this);
63
        nameField.addFocusListener (this);
64
        nameField.addKeyListener(this);
65
        nameField.addActionListener(this);
66
        enabled.addActionListener(this);
67
        enabled.setText (NbBundle.getMessage(CustPanel.class, "LBL_Enabled")); //NOI18N
68
        add (nameLbl);
69
        add (typeLbl);
70
        nameLbl.setHorizontalAlignment(SwingConstants.CENTER);
71
        typeLbl.setHorizontalAlignment(SwingConstants.CENTER);
72
        nameField.setHorizontalAlignment(SwingConstants.CENTER);
73
        add (custom);
74
        Font f = UIManager.getFont("Label.font"); //NOI18N
75
        if (f == null) {
76
            f = new Font ("Dialog", Font.PLAIN, 12); //NOI18N
77
        }
78
        propLbl.setFont (f.deriveFont(Font.BOLD));
79
        f = f.deriveFont (Font.BOLD, 16f);
80
        nameLbl.setFont (f);
81
        nameField.setFont (f);
82
        //Turn this on if we want to use custom editors
83
//        custom.setChangeImmediate(true);
84
        custom.putClientProperty ("radioButtonMax", new Integer (3)); //NOI18N
85
        custom.putClientProperty ("useLabels", Boolean.FALSE);
86
        enabled.setVisible(false);
87
        propLbl.setVisible(false);
88
        enabled.setVisible(false);
89
        js.setVisible(false);
90
        add (js);
91
        add (propLbl);
92
        add (enabled);
93
    }
94
    
95
    public Dimension getPreferredSize() {
96
        return new Dimension (300, 300);
97
    }
98
    
99
    public void paint (java.awt.Graphics g) {
100
        super.paint (g);
101
    }
102
    
103
    private RADComponentNode node = null;
104
    void setNode (RADComponentNode node) {
105
        this.node = node;
106
        updateContents();
107
    }
108
    
109
    private void updateContents() {
110
        if (nameField.isShowing()) {
111
            stopEditing(false);
112
        }
113
        if (node != null) {
114
            nameLbl.setText (node.getRADComponent().getName());
115
            String s = node.getRADComponent().getBeanClass().getName();
116
            int idx = s.lastIndexOf (".");
117
            if (idx != -1) {
118
                s = s.substring (idx + 1);
119
            }
120
            s = NbBundle.getMessage(CustPanel.class, "FMT_ClassName", s); //NOI18N
121
            typeLbl.setText (s);
122
        }
123
        updateProperty();
124
        validate();
125
        repaint();
126
    }
127
    
128
    public void doLayout() {
129
        Dimension d = nameLbl.getPreferredSize();
130
        int gap = 6;
131
        int wf = getWidth() / 4;
132
        int y = gap;
133
        nameLbl.setBounds(y, y, getWidth() - 8, d.height);
134
        y += d.height + gap;
135
        typeLbl.setBounds(4, y, getWidth() -8, typeLbl.getPreferredSize().height);
136
        nameField.setBounds (nameLbl.getBounds());
137
        y += d.height + gap;
138
        
139
        d = propLbl.getPreferredSize();
140
        propLbl.setBounds (gap, y, d.width, d.height);
141
        js.setBounds (gap + d.width + gap, y + (d.height / 2), getWidth() - (gap + gap + gap + d.width), d.height / 2);
142
        
143
        y += propLbl.getHeight() + gap;
144
        y += gap;
145
        d = custom.getPreferredSize();
146
        custom.setBounds (4, y, getWidth() - 8, Math.max (20, d.height));
147
        y += gap + custom.getHeight();
148
        d = enabled.getPreferredSize();
149
        enabled.setBounds (getWidth() - (d.width + gap), getHeight() - (gap + d.height), d.width, d.height);
150
    }
151
    
152
    private void stopEditing (boolean take) {
153
        if (take && node != null && nameField.isShowing()) {
154
            try {
155
                String s = nameField.getText().trim();
156
                node.setName(s);
157
            } catch (Exception e) {
158
                ErrorManager.getDefault().notify(e);
159
            }
160
        }
161
        nameLbl.setVisible (true);
162
        nameField.setVisible(false);
163
        remove (nameField);
164
        updateContents();
165
        revalidate();
166
        repaint();
167
    }
168
    
169
    private void startEditing () {
170
        if (!nameField.isShowing()) {
171
            nameField.setText (nameLbl.getText());
172
            nameField.setVisible(true);
173
            nameLbl.setVisible(false);
174
            add (nameField);
175
            validate();
176
            repaint();
177
            nameField.requestFocus();
178
        }
179
    }
180
    
181
    public void mouseClicked(MouseEvent e) {
182
    }
183
    
184
    boolean armed = false;
185
    public void mousePressed(MouseEvent e) {
186
        armed = node != null;
187
    }
188
    
189
    public void mouseReleased(MouseEvent e) {
190
        if (armed && node != null) {
191
            startEditing();
192
        }
193
        armed = false;
194
    }
195
    
196
    boolean containsMouse = false;
197
    public void mouseEntered(MouseEvent e) {
198
        containsMouse = true;
199
        nameLbl.repaint();
200
    }
201
    
202
    public void mouseExited(MouseEvent e) {
203
        containsMouse = false;
204
        nameLbl.repaint();
205
    }
206
    
207
    public void focusGained(FocusEvent e) {
208
        nameField.setSelectionStart (0);
209
        nameField.setSelectionEnd (nameField.getText().length());
210
    }
211
    
212
    public void focusLost(FocusEvent e) {
213
        stopEditing (true);
214
    }
215
    
216
    public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
217
        if (containsMouse) {
218
            g.setColor (new Color (180, 180, 255));
219
            g.drawRect (x, y, width - 1, height - 1);
220
        }
221
    }
222
    
223
    public Insets getBorderInsets(Component c) {
224
        return new Insets (1, 1, 1, 1);
225
    }
226
    
227
    public boolean isBorderOpaque() {
228
        return false;
229
    }
230
    
231
    private void updateProperty() {
232
        Node.Property p = null;
233
        if (node != null) {
234
//          Code below should work is form editor sets preferred properties
235
//            correctly; it doesn't.  Could hack w/ check for html display
236
//            name
237
//            
238
//            Node.PropertySet[] ps = node.getPropertySets();
239
//            for (int i=0; i < ps.length; i++) {
240
//                Node.Property[] props = ps[i].getProperties();
241
//                for (int j=0; j < props.length; j++) {
242
//                    if (props[j].isPreferred()) {
243
//                        p = props[j];
244
//                        break;
245
//                    }
246
//                }
247
//            }
248
            if (p == null) {
249
                Class clazz = node.getRADComponent().getBeanClass();
250
                String propName = getPropForClass (clazz);
251
                if (propName != null) {
252
                    p = node.getProperty(propName);
253
                }
254
            }
255
        }
256
        if (p != null) {
257
            //Optional - use custom editor - looks weird w/ form connection
258
            //editor, though
259
//            custom.setPreferences(PropertyPanel.PREF_CUSTOM_EDITOR);
260
            custom.setProperty (p);
261
        }
262
        custom.setVisible (p != null);
263
        js.setVisible (p != null);
264
        propLbl.setVisible (p != null);
265
        propLbl.setText (p == null ? "" : capitalize (p.getDisplayName()));
266
        Node.Property en = node.getProperty("enabled");
267
        if (en == null) {
268
            //??? sometimes it's capitalized
269
            en = node.getProperty("Enabled");
270
        }
271
        enabled.setVisible (en != null);
272
        if (en != null) {
273
            try {
274
                enabled.setSelected (Boolean.TRUE.equals(en.getValue()));
275
            } catch (Exception e) {
276
                ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
277
            }
278
        }
279
    }
280
    
281
    private String getPropForClass (Class clazz) {
282
        String result = null;
283
        String s = clazz.getName();
284
        int ix = s.lastIndexOf (".");
285
        if (ix != -1) {
286
            s = s.substring (ix + 1);
287
        }
288
        if ("JTable".equals(s) || "JList".equals(s) || "JTree".equals(s) || 
289
                "JComboBox".equals(s)) {
290
            return "model";
291
        } else if ("JLabel".equals(s) || "JTextField".equals (s) || 
292
                "JButton".equals(s) ||
293
                "JToggleButton".equals(s) || "JMenu".equals(s) || 
294
                "JMenuItem".equals(s) ||
295
                "JTextArea".equals(s) ||
296
                "JRadioButton".equals(s) ||
297
                "JCheckBox".equals(s)) {
298
            
299
            return "text";
300
        } else if ("JSpinner".equals(s) || "JSlider".equals(s) || 
301
                "JProgressBar".equals(s) || "JScrollBar".equals(s)) {
302
            return "value";
303
        } else if ("JSplitPane".equals(s)) {
304
            return "dividerLocation";
305
        } else if ("JScrollPane".equals(s)) {
306
            return "horizontalScrollBarPolicy";
307
        } else if ("JFrame".equals(s) || "JDialog".equals(s)) {
308
            return "title";
309
        }
310
        
311
        //XXX to be continued...AWT components & such
312
        return null;
313
    }
314
    
315
    private static String capitalize (String s) {
316
        if (s.length() > 0) {
317
            StringBuffer sb = new StringBuffer (s);
318
            sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
319
            return sb.toString();
320
        } else {
321
            return s;
322
        }
323
    }
324
    
325
    public void keyTyped(KeyEvent e) {
326
        if (Character.isDigit(e.getKeyChar()) 
327
            && (nameField.getText().trim().length() == 0 || 
328
            (nameField.getSelectionStart() == 0 && 
329
             nameField.getSelectionEnd() == nameField.getText().length()))) {
330
            System.err.println("block typed a");
331
                e.consume();
332
        } else {
333
            char[] c = new char[] { 
334
                ',', 
335
                '.', 
336
                ';', 
337
                '+', 
338
                '-', 
339
                '%', 
340
                '*', 
341
                '(',
342
                ')', 
343
                '{', 
344
                '}', 
345
                '[', 
346
                ']', 
347
                ' ', 
348
                '&', 
349
                '!', 
350
                '^', 
351
                '@', 
352
                '\\',
353
                '/'};
354
            boolean block = false;
355
            for (int i=0; i < c.length; i++) {
356
                if (c[i] == e.getKeyCode()) {
357
                    block = true;
358
                    break;
359
                }
360
            }
361
            if (block) {
362
                System.err.println("block typed b");
363
                e.consume();
364
            }
365
        }
366
    }
367
    
368
    public void keyPressed(KeyEvent e) {
369
        if (e.getKeyCode() >= KeyEvent.VK_0 && e.getKeyCode() <= KeyEvent.VK_9) {
370
            if (nameField.getText().trim().length() == 0 || 
371
                (nameField.getSelectionStart() == 0 && 
372
                 nameField.getSelectionEnd() == nameField.getText().length())) {
373
                System.err.println(" block pressed a");
374
                e.consume();
375
            } else if (e.getKeyCode() == KeyEvent.VK_COMMA || 
376
                    e.getKeyCode() == KeyEvent.VK_DIVIDE || 
377
                    e.getKeyCode() == KeyEvent.VK_PERIOD || 
378
                    e.getKeyCode() == KeyEvent.VK_SEMICOLON || 
379
                    e.getKeyCode() == KeyEvent.VK_PLUS || 
380
                    e.getKeyCode() == KeyEvent.VK_ASTERISK || 
381
                    e.getKeyCode() == KeyEvent.VK_LEFT_PARENTHESIS ||
382
                    e.getKeyCode() == KeyEvent.VK_RIGHT_PARENTHESIS ||
383
                    e.getKeyCode() == KeyEvent.VK_OPEN_BRACKET ||
384
                    e.getKeyCode() == KeyEvent.VK_SPACE || 
385
                    e.getKeyCode() == KeyEvent.VK_CLOSE_BRACKET ||
386
                    e.getKeyCode() == KeyEvent.VK_BRACELEFT ||
387
                    e.getKeyCode() == KeyEvent.VK_BRACERIGHT ||
388
                    e.getKeyCode() == KeyEvent.VK_AMPERSAND ||
389
                    e.getKeyCode() == KeyEvent.VK_COLON ||
390
                    e.getKeyCode() == KeyEvent.VK_CIRCUMFLEX ||
391
                    e.getKeyCode() == KeyEvent.VK_EXCLAMATION_MARK ||
392
                    e.getKeyCode() == KeyEvent.VK_SLASH) {
393
                System.err.println(" block pressed b");
394
                e.consume();
395
            }
396
        }
397
    }
398
    
399
    public void keyReleased(KeyEvent e) {
400
//        keyPressed (e);
401
    }
402
    
403
    public void actionPerformed(ActionEvent e) {
404
        if (e.getSource() == enabled) {
405
            Node.Property p = node.getProperty("enabled");
406
            if (p != null) {
407
                try {
408
                    p.setValue (enabled.isSelected() ? Boolean.TRUE : Boolean.FALSE);
409
                } catch (IllegalAccessException ex) {
410
                    ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
411
                } catch (InvocationTargetException ex1) {
412
                    ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex1);
413
                }
414
            }
415
        } else {
416
            stopEditing(true);
417
        }
418
    }
419
    
420
}
(-)form/src/org/netbeans/modules/form/RADComponentNode.java (-2 / +33 lines)
Lines 18-30 Link Here
18
import java.text.MessageFormat;
18
import java.text.MessageFormat;
19
import java.util.*;
19
import java.util.*;
20
import java.beans.*;
20
import java.beans.*;
21
import java.lang.ref.Reference;
22
import java.lang.ref.WeakReference;
21
import java.security.*;
23
import java.security.*;
22
import javax.swing.Action;
24
import javax.swing.Action;
25
import org.netbeans.modules.form.CustPanel;
23
26
24
import org.openide.ErrorManager;
27
import org.openide.ErrorManager;
25
import org.openide.actions.*;
28
import org.openide.actions.*;
26
import org.openide.cookies.*;
27
import org.openide.loaders.*;
28
import org.openide.nodes.*;
29
import org.openide.nodes.*;
29
import org.openide.util.*;
30
import org.openide.util.*;
30
import org.openide.util.actions.SystemAction;
31
import org.openide.util.actions.SystemAction;
Lines 520-525 Link Here
520
//        Node.Property prop = component.getPropertyByName(name, true);
521
//        Node.Property prop = component.getPropertyByName(name, true);
521
//        return (FormProperty) (prop instanceof FormProperty ? prop : null);
522
//        return (FormProperty) (prop instanceof FormProperty ? prop : null);
522
    }
523
    }
524
    
525
    private static Reference custPanel = null;
526
    
527
    /**
528
     * Overridden to return a class-wide shared panel from 
529
     * getValue("customizer").  getCustomizer() could be used instead,
530
     * but is far more likely to be inefficiently written, creating a 
531
     * new component for each call.
532
     */
533
    public Object getValue (String s) {
534
        if ("customizer".equals(s)) {
535
            return getCustPanel();
536
        } else {
537
            return super.getValue(s);
538
        }
539
    }
540
    
541
    private CustPanel getCustPanel() {
542
        CustPanel result = null;
543
        if (custPanel != null) {
544
            result = (CustPanel) custPanel.get();
545
        }
546
        if (result == null) {
547
            result = new CustPanel();
548
            custPanel = new WeakReference (result);
549
        }
550
        result.setNode(this);
551
        return result;
552
    }
553
    
523
554
524
    // -----------------------------------------------------------------------------
555
    // -----------------------------------------------------------------------------
525
    // Innerclasses
556
    // Innerclasses
(-)openide/explorer/src/org/openide/explorer/propertysheet/Bundle.properties (+3 lines)
Lines 211-213 Link Here
211
   object to display in the property sheet
211
   object to display in the property sheet
212
212
213
LBL_QUICKSEARCH=Quick Search:
213
LBL_QUICKSEARCH=Quick Search:
214
215
LBL_Customizer=Customizer
216
(-)openide/explorer/src/org/openide/explorer/propertysheet/PSheet.java (-4 / +12 lines)
Lines 116-125 Link Here
116
                    tabname = PropUtils.basicPropsTabName(); // use basic tab
116
                    tabname = PropUtils.basicPropsTabName(); // use basic tab
117
                }
117
                }
118
118
119
                boolean success = TabbedContainerBridge.getDefault().setSelectionByName(comp, tabname);
119
                TabbedContainerBridge tcb = TabbedContainerBridge.getDefault();
120
                
121
                //First try to use the Customizer button, which may be present
122
                boolean success = tcb.setSelectionByName(
123
                        comp, NbBundle.getMessage (PSheet.class, "LBL_Customizer"));
124
                
125
                if (!success) {
126
                    success = tcb.setSelectionByName(comp, tabname);
127
                }
120
128
121
                if (!success) {
129
                if (!success) {
122
                    TabbedContainerBridge.getDefault().setSelectionByName(comp, PropUtils.basicPropsTabName());
130
                    TabbedContainerBridge.getDefault().setSelectionByName(comp, 
131
                        PropUtils.basicPropsTabName());
123
                } else {
132
                } else {
124
                    if (selectionListener != null) {
133
                    if (selectionListener != null) {
125
                        ChangeEvent ce = new ChangeEvent(this);
134
                        ChangeEvent ce = new ChangeEvent(this);
Lines 730-737 Link Here
730
        if (tabbed != null) {
739
        if (tabbed != null) {
731
            Object o = TabbedContainerBridge.getDefault().getSelectedItem(tabbed);
740
            Object o = TabbedContainerBridge.getDefault().getSelectedItem(tabbed);
732
741
733
            if (o instanceof Node.PropertySet[]) { //won't be first time
742
            if (o instanceof Node.PropertySet[] || o instanceof JComponent) { //won't be first time
734
735
                return o;
743
                return o;
736
            }
744
            }
737
        }
745
        }
(-)openide/explorer/src/org/openide/explorer/propertysheet/PropertySheet.java (-14 / +37 lines)
Lines 560-567 Link Here
560
            psheet.setState(psheet.getState() | PSheet.STATE_HAS_TABS);
560
            psheet.setState(psheet.getState() | PSheet.STATE_HAS_TABS);
561
561
562
            TabInfo info = getTabItems(node);
562
            TabInfo info = getTabItems(node);
563
            
564
            Object[] sets;
565
            String[] titles;
566
            if (node.getValue("customizer") instanceof JComponent) {
567
                sets = new Object[info.sets.length + 1];
568
                titles = new String[info.titles.length+1];
569
                System.arraycopy (info.sets, 0, sets, 1, info.sets.length);
570
                System.arraycopy (info.titles, 0, titles, 1, info.titles.length);
571
                sets[0] = node.getValue("customizer");
572
                titles[0] = NbBundle.getMessage(PropertySheet.class, "LBL_Customizer");
573
            } else {
574
                sets = info.sets;
575
                titles = info.titles;
576
            }
563
577
564
            psheet.setTabbedContainerItems(info.sets, info.titles);
578
            psheet.setTabbedContainerItems(sets, titles);
565
            psheet.manager().setCurrentNodeName(node.getName());
579
            psheet.manager().setCurrentNodeName(node.getName());
566
            psm.setPropertySets(info.getSets(0));
580
            psm.setPropertySets(info.getSets(0));
567
        } else {
581
        } else {
Lines 799-804 Link Here
799
                }
813
                }
800
            }
814
            }
801
        }
815
        }
816
        if (n.getValue("customizer") instanceof JComponent) {
817
            needTabs = true;
818
        }
802
819
803
        return needTabs;
820
        return needTabs;
804
    }
821
    }
Lines 885-900 Link Here
885
                    psheet.storeScrollAndTabInfo();
902
                    psheet.storeScrollAndTabInfo();
886
                }
903
                }
887
904
888
                PropertySet[] sets = (PropertySet[]) psheet.getTabbedContainerSelection();
905
                Object o = psheet.getTabbedContainerSelection();
889
906
                if (o instanceof PropertySet[]) {
890
                if (sets != null) {
907
                    PropertySet[] sets = (PropertySet[]) o;
891
                    table.getPropertySetModel().setPropertySets(sets);
908
892
909
                    if (sets != null) {
893
                    if ((sets.length > 0) && !psheet.isAdjusting()) {
910
                        table.getPropertySetModel().setPropertySets(sets);
894
                        String tab = (String) sets[0].getValue("tabName"); //NOI18N
911
895
                        tab = (tab == null) ? PropUtils.basicPropsTabName() : tab;
912
                        if ((sets.length > 0) && !psheet.isAdjusting()) {
896
                        psheet.manager().storeLastSelectedGroup(tab);
913
                            String tab = (String) sets[0].getValue("tabName"); //NOI18N
897
                        psheet.adjustForName(tab);
914
                            tab = (tab == null) ? PropUtils.basicPropsTabName() : tab;
915
                            psheet.manager().storeLastSelectedGroup(tab);
916
                            psheet.adjustForName(tab);
917
                        }
898
                    }
918
                    }
899
                }
919
                }
900
            }
920
            }
Lines 991-1000 Link Here
991
                if ((psheet.getState() & PSheet.STATE_HAS_TABS) != 0) {
1011
                if ((psheet.getState() & PSheet.STATE_HAS_TABS) != 0) {
992
                    //If we're in a tabbed pane, we want the first visible
1012
                    //If we're in a tabbed pane, we want the first visible
993
                    //property set's help id
1013
                    //property set's help id
994
                    Node.PropertySet[] ps = (Node.PropertySet[]) psheet.getTabbedContainerSelection();
1014
                    Object o = psheet.getTabbedContainerSelection();
1015
                    if (o instanceof Node.PropertySet[]) {
1016
                        Node.PropertySet[] ps = (Node.PropertySet[]) psheet.getTabbedContainerSelection();
995
1017
996
                    if ((ps != null) && (ps.length > 0)) {
1018
                        if ((ps != null) && (ps.length > 0)) {
997
                        id = (String) ps[0].getValue("helpID"); //NOI18N
1019
                            id = (String) ps[0].getValue("helpID"); //NOI18N
1020
                        }
998
                    }
1021
                    }
999
                } else if ((id == null) && (pclistener != null)) {
1022
                } else if ((id == null) && (pclistener != null)) {
1000
                    //Otherwise, look for the first property set on the node
1023
                    //Otherwise, look for the first property set on the node

Return to bug 60782