@@ -93,14 +93,22 @@ export class ECLWatchTree extends Tree {
93
93
wuNode . delete ( ) ;
94
94
} ) ;
95
95
96
+ vscode . commands . registerCommand ( "hpccPlatform.protectWU" , ( wuNode : ECLWUNode ) => {
97
+ wuNode . protect ( ) ;
98
+ } ) ;
99
+
100
+ vscode . commands . registerCommand ( "hpccPlatform.unprotectWU" , ( wuNode : ECLWUNode ) => {
101
+ wuNode . unprotect ( ) ;
102
+ } ) ;
103
+
96
104
vscode . commands . registerCommand ( "hpccPlatform.setStateCompiled" , ( wuNode : ECLWUNode ) => {
97
105
wuNode . setStateCompiled ( ) ;
98
106
} ) ;
99
107
100
108
vscode . commands . registerCommand ( "hpccPlatform.setStateRunning" , ( wuNode : ECLWUNode ) => {
101
109
wuNode . setStateRunning ( ) ;
102
110
} ) ;
103
-
111
+
104
112
vscode . commands . registerCommand ( "hpccPlatform.setStateCompleted" , ( wuNode : ECLWUNode ) => {
105
113
wuNode . setStateCompleted ( ) ;
106
114
} ) ;
@@ -448,6 +456,14 @@ export class ECLWUNode extends Item<ECLWatchTree> {
448
456
this . _wu . abort ( ) . then ( ( ) => this . _tree . refresh ( this ) ) ;
449
457
}
450
458
459
+ protect ( ) {
460
+ this . _wu . protect ( ) . then ( ( ) => this . _tree . refresh ( ) ) ;
461
+ }
462
+
463
+ unprotect ( ) {
464
+ this . _wu . unprotect ( ) . then ( ( ) => this . _tree . refresh ( ) ) ;
465
+ }
466
+
451
467
setState ( stateID : WUStateID ) {
452
468
const service = new WorkunitsService ( { baseUrl : this . _wu . BaseUrl } ) ;
453
469
return service . WUUpdate ( {
@@ -525,7 +541,8 @@ export class ECLWUNode extends Item<ECLWatchTree> {
525
541
}
526
542
527
543
contextValue ( ) : string {
528
- return this . _wu . isComplete ( ) ? "ECLWUNodeComplete" : "ECLWUNode" ;
544
+ const prot = this . _wu . Protected ? ",ECLWUNodeProtected" : ",ECLWUNodeUnprotected" ;
545
+ return this . _wu . isComplete ( ) ? `ECLWUNodeComplete${ prot } ` : `ECLWUNode${ prot } ` ;
529
546
}
530
547
}
531
548
0 commit comments