@@ -120,13 +120,25 @@ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
120
120
121
121
// dispose all rows with irrelevant sections
122
122
123
+ // for (var control : _sectionsContainer.getChildren()) {
124
+ // var row = (RowComp) control;
125
+ //
126
+ // var newSection = sectionMap.get(row.getSection().getClass());
127
+ //
128
+ // if (newSection == null) {
129
+ // row.dispose();
130
+ // }
131
+ // }
132
+
123
133
for (var control : _sectionsContainer .getChildren ()) {
124
134
var row = (RowComp ) control ;
125
135
126
136
var newSection = sectionMap .get (row .getSection ().getClass ());
127
137
128
138
if (newSection == null ) {
129
- row .dispose ();
139
+ row .setVisible (false );
140
+ var gd = (GridData ) row .getLayoutData ();
141
+ gd .heightHint = 0 ;
130
142
}
131
143
}
132
144
@@ -141,6 +153,9 @@ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
141
153
var oldSection = row .getSection ();
142
154
143
155
if (oldSection .getClass () == section .getClass ()) {
156
+ row .setVisible (true );
157
+ var gd = (GridData ) row .getLayoutData ();
158
+ gd .heightHint = -1 ;
144
159
oldSection .setModels (models );
145
160
oldSection .update_UI_from_Model ();
146
161
createNew = false ;
@@ -209,12 +224,12 @@ public RowComp(Composite parent, FormPropertySection section) {
209
224
210
225
var control = section .createContent (this );
211
226
control .setLayoutData (new GridData (SWT .FILL , SWT .TOP , true , false ));
212
-
227
+
213
228
var toolbarManager = new ToolBarManager ();
214
229
section .fillToolbar (toolbarManager );
215
230
var toolbar = toolbarManager .createControl (header );
216
231
toolbar .setLayoutData (new GridData (SWT .RIGHT , SWT .CENTER , true , false ));
217
-
232
+
218
233
section .update_UI_from_Model ();
219
234
220
235
if (collapsed ) {
@@ -277,7 +292,9 @@ public void createControl(Composite parent) {
277
292
_scrolledCompo = new ScrolledComposite (parent , SWT .V_SCROLL );
278
293
_sectionsContainer = new Composite (_scrolledCompo , SWT .NONE );
279
294
_sectionsContainer .setBackgroundMode (SWT .INHERIT_FORCE );
280
- _sectionsContainer .setLayout (new GridLayout (1 , false ));
295
+ var layout = new GridLayout (1 , false );
296
+ layout .verticalSpacing = 0 ;
297
+ _sectionsContainer .setLayout (layout );
281
298
282
299
_scrolledCompo .setContent (_sectionsContainer );
283
300
_scrolledCompo .setExpandVertical (true );
0 commit comments