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

(-)apichanges.xml (+17 lines)
Lines 183-188 Link Here
183
        <class package="org.netbeans.spi.viewmodel" name="ModelEvent" />
183
        <class package="org.netbeans.spi.viewmodel" name="ModelEvent" />
184
        <issue number="60499"/>
184
        <issue number="60499"/>
185
    </change>
185
    </change>
186
    <change>
187
        <api name="ViewModelAPI"/>
188
        <summary>CompoundModel enhanced with a possibility to set help ID.</summary>
189
        <version major="1" minor="7"/>
190
        <date day="18" month="8" year="2005"/>
191
        <author login="mentlicher"/>
192
        <compatibility binary="compatible" source="compatible" deletion="no" addition="yes" modification="no"/>
193
        <description>
194
            In order to have a help ID defined for the GUI component that is
195
            created from the compound model, it's necessary to be able to set
196
            that help ID on the compound model instance.
197
            Two methods are added for that purpose:
198
            void setHelpId(String) and String getHelpId().
199
        </description>
200
        <class package="org.netbeans.spi.viewmodel" name="Models" />
201
        <issue number="62617"/>
202
    </change>
186
    
203
    
187
204
188
</changes>
205
</changes>
(-)manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.spi.viewmodel/2
2
OpenIDE-Module: org.netbeans.spi.viewmodel/2
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/viewmodel/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/viewmodel/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.6
4
OpenIDE-Module-Specification-Version: 1.7
5
5
(-)src/org/netbeans/modules/viewmodel/TreeModelNode.java (+10 lines)
Lines 84-89 Link Here
84
        this.model = model;
84
        this.model = model;
85
        this.treeModelRoot = treeModelRoot;
85
        this.treeModelRoot = treeModelRoot;
86
        this.object = object;
86
        this.object = object;
87
        
88
        // <RAVE>
89
        // Use the modified CompoundModel class's field to set the 
90
        // propertiesHelpID for properties sheets if the model's helpID
91
        // has been set
92
        if (model.getHelpId() != null) {
93
            this.setValue("propertiesHelpID", model.getHelpId()); // NOI18N
94
        }
95
        // </RAVE>
96
        
87
        treeModelRoot.registerNode (object, this); 
97
        treeModelRoot.registerNode (object, this); 
88
        refreshNode ();
98
        refreshNode ();
89
        initProperties ();
99
        initProperties ();
(-)src/org/netbeans/spi/viewmodel/Models.java (-4 / +36 lines)
Lines 118-123 Link Here
118
     * @return {@link CompoundModel} encapsulating given list of models
118
     * @return {@link CompoundModel} encapsulating given list of models
119
     */
119
     */
120
    public static CompoundModel createCompoundModel (List models) {
120
    public static CompoundModel createCompoundModel (List models) {
121
        return createCompoundModel(models, null);
122
    }
123
    
124
    /**
125
     * Creates one {@link CompoundModel} from given list of models.
126
     * 
127
     * @param models a list of models
128
     * @param propertiesHelpID The help ID, which is set for the properties
129
     *        sheets created from this model.
130
     * @return {@link CompoundModel} encapsulating given list of models
131
     * @since 1.7
132
     */
133
    public static CompoundModel createCompoundModel (List models, String propertiesHelpID) {
121
        List treeModels;
134
        List treeModels;
122
        List treeModelFilters;
135
        List treeModelFilters;
123
        List treeExpansionModels;
136
        List treeExpansionModels;
Lines 242-248 Link Here
242
            createCompoundTableModel (
255
            createCompoundTableModel (
243
                new DelegatingTableModel (tableModels),
256
                new DelegatingTableModel (tableModels),
244
                tableModelFilters
257
                tableModelFilters
245
            )
258
            ),
259
            propertiesHelpID
246
        );
260
        );
247
    }
261
    }
248
    
262
    
Lines 2093-2100 Link Here
2093
        private ColumnModel[]   columnModels;
2107
        private ColumnModel[]   columnModels;
2094
        private TableModel      tableModel;
2108
        private TableModel      tableModel;
2095
        private TreeExpansionModel treeExpansionModel;
2109
        private TreeExpansionModel treeExpansionModel;
2096
2110
        
2097
2111
        // <RAVE>
2112
        // New field, setter/getter for propertiesHelpID, which is used
2113
        // for property sheet help
2114
        private String propertiesHelpID = null;
2115
        // </RAVE>
2116
        
2098
        // init ....................................................................
2117
        // init ....................................................................
2099
2118
2100
        /**
2119
        /**
Lines 2111-2117 Link Here
2111
            NodeModel nodeModel, 
2130
            NodeModel nodeModel, 
2112
            NodeActionsProvider nodeActionsProvider,
2131
            NodeActionsProvider nodeActionsProvider,
2113
            List columnModels,
2132
            List columnModels,
2114
            TableModel tableModel
2133
            TableModel tableModel,
2134
            String propertiesHelpID
2115
        ) {
2135
        ) {
2116
            if (treeModel == null) throw new NullPointerException ();
2136
            if (treeModel == null) throw new NullPointerException ();
2117
            if (treeModel == null) throw new NullPointerException ();
2137
            if (treeModel == null) throw new NullPointerException ();
Lines 2127-2134 Link Here
2127
            this.columnModels = (ColumnModel[]) columnModels.toArray (
2147
            this.columnModels = (ColumnModel[]) columnModels.toArray (
2128
                new ColumnModel [columnModels.size ()]
2148
                new ColumnModel [columnModels.size ()]
2129
            );
2149
            );
2150
            this.propertiesHelpID = propertiesHelpID;
2130
        }
2151
        }
2131
2152
2153
        // <RAVE>
2154
        /**
2155
         * Get a help ID for this model.
2156
         * @return The help ID defined for the properties sheets,
2157
         *         or <code>null</code>.
2158
         * @since 1.7
2159
         */
2160
        public String getHelpId() {
2161
            return propertiesHelpID;
2162
        }
2163
        // </RAVE>
2132
2164
2133
        // TreeModel ...............................................................
2165
        // TreeModel ...............................................................
2134
2166
(-)test/unit/src/org/netbeans/api/viewmodel/BasicTest.java (-2 / +4 lines)
Lines 40-45 Link Here
40
 */
40
 */
41
public class BasicTest  extends NbTestCase {
41
public class BasicTest  extends NbTestCase {
42
42
43
    private String helpID = "A test help ID"; // NOI18N
43
44
44
    public BasicTest (String s) {
45
    public BasicTest (String s) {
45
        super (s);
46
        super (s);
Lines 49-56 Link Here
49
        ArrayList l = new ArrayList ();
50
        ArrayList l = new ArrayList ();
50
        CompoundModel cm = new CompoundModel ();
51
        CompoundModel cm = new CompoundModel ();
51
        l.add (cm);
52
        l.add (cm);
52
        TreeTable tt = (TreeTable) Models.createView 
53
        Models.CompoundModel mcm = Models.createCompoundModel(l, helpID);
53
            (Models.createCompoundModel (l));
54
        TreeTable tt = (TreeTable) Models.createView(mcm);
54
        waitFinished ();
55
        waitFinished ();
55
        Node n = tt.getExplorerManager ().
56
        Node n = tt.getExplorerManager ().
56
            getRootContext ();
57
            getRootContext ();
Lines 61-66 Link Here
61
        // TODO: Expansion test does not work - probably written in a bad way...
62
        // TODO: Expansion test does not work - probably written in a bad way...
62
        //assertEquals ("nodeExpanded notification number", 3, cm.expandedTest.size ());
63
        //assertEquals ("nodeExpanded notification number", 3, cm.expandedTest.size ());
63
        //assertEquals ("nodeExpanded ", cm.toBeExpandedTest, cm.expandedTest);
64
        //assertEquals ("nodeExpanded ", cm.toBeExpandedTest, cm.expandedTest);
65
        assertEquals(n.getValue("propertiesHelpID"), helpID);
64
    }
66
    }
65
    
67
    
66
    private void checkNode (Node n, String name) {
68
    private void checkNode (Node n, String name) {

Return to bug 62617