| 442 | export class ContextKeyNotEqualsExpr implements IContextKeyExpression { |
| 443 | |
| 444 | public static create(key: string, value: any): ContextKeyExpression { |
| 445 | if (typeof value === 'boolean') { |
| 446 | if (value) { |
| 447 | return ContextKeyNotExpr.create(key); |
| 448 | } |
| 449 | return ContextKeyDefinedExpr.create(key); |
| 450 | } |
| 451 | const staticValue = STATIC_VALUES.get(key); |
| 452 | if (typeof staticValue === 'boolean') { |
| 453 | const falseValue = staticValue ? 'true' : 'false'; |
| 454 | return (value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE); |
| 455 | } |
| 456 | return new ContextKeyNotEqualsExpr(key, value); |
| 457 | } |
| 458 | |
| 459 | public readonly type = ContextKeyExprType.NotEquals; |
| 460 | |