@@ -127,6 +127,7 @@ export class TreeView extends Disposable implements ITreeView {
127
127
private _hasIconForParentNode = false ;
128
128
private _hasIconForLeafNode = false ;
129
129
private _showCollapseAllAction = false ;
130
+ private _showRefreshAction = false ;
130
131
131
132
private focused : boolean = false ;
132
133
private domNode ! : HTMLElement ;
@@ -284,12 +285,26 @@ export class TreeView extends Disposable implements ITreeView {
284
285
}
285
286
}
286
287
288
+ get showRefreshAction ( ) : boolean {
289
+ return this . _showRefreshAction ;
290
+ }
291
+
292
+ set showRefreshAction ( showRefreshAction : boolean ) {
293
+ if ( this . _showRefreshAction !== ! ! showRefreshAction ) {
294
+ this . _showRefreshAction = ! ! showRefreshAction ;
295
+ this . _onDidChangeActions . fire ( ) ;
296
+ }
297
+ }
298
+
287
299
getPrimaryActions ( ) : IAction [ ] {
300
+ const actions : IAction [ ] = [ ] ;
301
+ if ( this . showRefreshAction ) {
302
+ actions . push ( new Action ( 'vs.tree.refresh' , localize ( 'refresh' , "Refresh" ) , 'monaco-tree-action codicon-refresh' , true , ( ) => this . refresh ( ) ) ) ;
303
+ }
288
304
if ( this . showCollapseAllAction ) {
289
- return [ new Action ( 'vs.tree.collapse' , localize ( 'collapseAll' , "Collapse All" ) , 'monaco-tree-action codicon-collapse-all' , true , ( ) => this . tree ? new CollapseAllAction < ITreeItem , ITreeItem , FuzzyScore > ( this . tree , true ) . run ( ) : Promise . resolve ( ) ) ] ;
290
- } else {
291
- return [ ] ;
305
+ actions . push ( new Action ( 'vs.tree.collapse' , localize ( 'collapseAll' , "Collapse All" ) , 'monaco-tree-action codicon-collapse-all' , true , ( ) => this . tree ? new CollapseAllAction < ITreeItem , ITreeItem , FuzzyScore > ( this . tree , true ) . run ( ) : Promise . resolve ( ) ) ) ;
292
306
}
307
+ return actions ;
293
308
}
294
309
295
310
getSecondaryActions ( ) : IAction [ ] {
0 commit comments