@@ -7,6 +7,7 @@ import { IColorTheme } from 'mo/model/colorTheme';
7
7
import { FileTypes , IEditorTab , TreeNodeModel } from 'mo/model' ;
8
8
import { ILocale } from 'mo/i18n/localization' ;
9
9
import { localize } from 'mo/i18n/localize' ;
10
+ import { Scrollable } from 'mo/components' ;
10
11
11
12
export default class TestPane extends React . Component {
12
13
constructor ( props ) {
@@ -211,19 +212,17 @@ export type GenericClassDecorator<T> = (target: T) => void;`,
211
212
} ;
212
213
213
214
const addRootFolder = ( ) => {
214
- molecule . folderTree . addRootFolder ?.(
215
- new TreeNodeModel ( {
216
- name : 'molecule_temp' ,
217
- fileType : FileTypes . RootFolder ,
218
- children : [
219
- new TreeNodeModel ( {
220
- name : 'test_sql.txt' ,
221
- fileType : FileTypes . File ,
222
- icon : molecule . folderTree . getFileIconByExtensionName (
223
- 'test_sql.txt' ,
224
- FileTypes . File
225
- ) ,
226
- content : `show tables;
215
+ const children = new Array ( 50 ) . fill ( 1 ) . map (
216
+ ( _ , index ) =>
217
+ new TreeNodeModel ( {
218
+ id : index ,
219
+ name : `test_sql_${ index } .txt` ,
220
+ fileType : FileTypes . File ,
221
+ icon : molecule . folderTree . getFileIconByExtensionName (
222
+ 'test_sql.txt' ,
223
+ FileTypes . File
224
+ ) ,
225
+ content : `show tables;
227
226
SELECT 1;
228
227
DESC 6d_target_test;
229
228
create table if not exists ods_order_header1213 (
@@ -236,64 +235,75 @@ order_header_id string comment '订单头id'
236
235
)comment '销售订单明细表'
237
236
PARTITIONED BY (ds string) lifecycle 1000;
238
237
` ,
239
- } ) ,
240
- ] ,
238
+ } )
239
+ ) ;
240
+ molecule . folderTree . addRootFolder ?.(
241
+ new TreeNodeModel ( {
242
+ name : 'molecule_temp' ,
243
+ fileType : FileTypes . RootFolder ,
244
+ children,
241
245
} )
242
246
) ;
243
247
} ;
244
248
245
249
return (
246
- < div >
247
- < div style = { { margin : '50px 20px' } } >
248
- < Button onClick = { addABar } > Add Bar</ Button >
249
- < Button onClick = { newEditor } > New Editor</ Button >
250
- < Button onClick = { openCommand } > Command Palette</ Button >
251
- </ div >
252
- < div style = { { margin : '50px 20px' } } >
253
- < h1 > Select a ColorTheme:</ h1 >
254
- { this . renderColorThemes ( ) }
255
- </ div >
256
- < div style = { { margin : '50px 20px' } } >
257
- < h1 > Select a localization language:</ h1 >
258
- { this . renderLocales ( ) }
259
- { localize ( 'test.id' , 'aaaa' ) }
260
- </ div >
261
- < div style = { { margin : '50px 20px' } } >
262
- < h2 > Add a new Panel:</ h2 >
263
- < Button onClick = { addPanel } > Add Panel</ Button >
264
- < Button onClick = { showHidePanel } > Show/Hide Panel</ Button >
265
- < Button onClick = { updateOutput } > Update Output</ Button >
266
- </ div >
267
- < div style = { { margin : '50px 20px' } } >
268
- < h2 > Notification:</ h2 >
269
- < Button onClick = { addANotification } >
270
- Add A Notification
271
- </ Button >
272
- < Button onClick = { removeNotification } >
273
- Remove A Notification
274
- </ Button >
275
- </ div >
276
- < div style = { { margin : '50px 20px' } } >
277
- < h2 > MenuBar:</ h2 >
278
- < Button onClick = { appendMenu } > Add MenuBar</ Button >
279
- < Button onClick = { removeMenu } > Remove MenuBar</ Button >
280
- < Button onClick = { updateMenu } > Update MenuBar</ Button >
281
- < Button onClick = { addSettingsItem } >
282
- Append Settings Item
283
- </ Button >
284
- </ div >
285
- < div style = { { margin : '50px 20px' } } >
286
- < h2 > Exploer:</ h2 >
287
- < Button onClick = { addExplorer } > Add Explorer Panel</ Button >
288
- < Button onClick = { addRootFolder } > Add Root Folder</ Button >
289
- </ div >
250
+ < Scrollable >
290
251
< div >
291
- < molecule . component . Button > AAA</ molecule . component . Button >
292
- </ div >
293
- < div style = { { margin : '50px 20px' } } >
294
- < molecule . MenuBar onClick = { ( ) => { } } />
252
+ < div style = { { margin : '50px 20px' } } >
253
+ < Button onClick = { addABar } > Add Bar</ Button >
254
+ < Button onClick = { newEditor } > New Editor</ Button >
255
+ < Button onClick = { openCommand } > Command Palette</ Button >
256
+ </ div >
257
+ < div style = { { margin : '50px 20px' } } >
258
+ < h1 > Select a ColorTheme:</ h1 >
259
+ { this . renderColorThemes ( ) }
260
+ </ div >
261
+ < div style = { { margin : '50px 20px' } } >
262
+ < h1 > Select a localization language:</ h1 >
263
+ { this . renderLocales ( ) }
264
+ { localize ( 'test.id' , 'aaaa' ) }
265
+ </ div >
266
+ < div style = { { margin : '50px 20px' } } >
267
+ < h2 > Add a new Panel:</ h2 >
268
+ < Button onClick = { addPanel } > Add Panel</ Button >
269
+ < Button onClick = { showHidePanel } > Show/Hide Panel</ Button >
270
+ < Button onClick = { updateOutput } > Update Output</ Button >
271
+ </ div >
272
+ < div style = { { margin : '50px 20px' } } >
273
+ < h2 > Notification:</ h2 >
274
+ < Button onClick = { addANotification } >
275
+ Add A Notification
276
+ </ Button >
277
+ < Button onClick = { removeNotification } >
278
+ Remove A Notification
279
+ </ Button >
280
+ </ div >
281
+ < div style = { { margin : '50px 20px' } } >
282
+ < h2 > MenuBar:</ h2 >
283
+ < Button onClick = { appendMenu } > Add MenuBar</ Button >
284
+ < Button onClick = { removeMenu } > Remove MenuBar</ Button >
285
+ < Button onClick = { updateMenu } > Update MenuBar</ Button >
286
+ < Button onClick = { addSettingsItem } >
287
+ Append Settings Item
288
+ </ Button >
289
+ </ div >
290
+ < div style = { { margin : '50px 20px' } } >
291
+ < h2 > Exploer:</ h2 >
292
+ < Button onClick = { addExplorer } >
293
+ Add Explorer Panel
294
+ </ Button >
295
+ < Button onClick = { addRootFolder } > Add Root Folder</ Button >
296
+ </ div >
297
+ < div >
298
+ < molecule . component . Button >
299
+ AAA
300
+ </ molecule . component . Button >
301
+ </ div >
302
+ < div style = { { margin : '50px 20px' } } >
303
+ < molecule . MenuBar onClick = { ( ) => { } } />
304
+ </ div >
295
305
</ div >
296
- </ div >
306
+ </ Scrollable >
297
307
) ;
298
308
}
299
309
}
0 commit comments