This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
forked from eclipse-che/che-theia
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose some methods from CheApiService to Che Plugin API
- Loading branch information
Showing
6 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
extensions/eclipse-che-theia-plugin-ext/src/browser/che-user-main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
**********************************************************************/ | ||
|
||
import { interfaces } from 'inversify'; | ||
import { CheApiService, CheUserMain } from '../common/che-protocol'; | ||
import { Preferences } from '@eclipse-che/plugin'; | ||
|
||
export class CheUserMainImpl implements CheUserMain { | ||
|
||
private readonly cheApiService: CheApiService; | ||
|
||
constructor(container: interfaces.Container) { | ||
this.cheApiService = container.get(CheApiService); | ||
} | ||
|
||
$getUserPreferences(filter?: string): Promise<Preferences> { | ||
return this.cheApiService.getUserPreferences(filter); | ||
} | ||
|
||
$updateUserPreferences(preferences: Preferences): Promise<Preferences> { | ||
return this.cheApiService.updateUserPreferences(preferences); | ||
} | ||
|
||
$replaceUserPreferences(preferences: Preferences): Promise<Preferences> { | ||
return this.cheApiService.replaceUserPreferences(preferences); | ||
} | ||
|
||
$deleteUserPreferences(list?: string[]): Promise<void> { | ||
return this.cheApiService.deleteUserPreferences(list); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
extensions/eclipse-che-theia-plugin-ext/src/plugin/che-user.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/********************************************************************* | ||
* Copyright (c) 2019 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
**********************************************************************/ | ||
|
||
import { RPCProtocol } from '@theia/plugin-ext/lib/api/rpc-protocol'; | ||
import { Preferences } from '@eclipse-che/plugin'; | ||
import { | ||
CheUser, | ||
CheUserMain, | ||
PLUGIN_RPC_CONTEXT, | ||
} from '../common/che-protocol'; | ||
|
||
export class CheUserImpl implements CheUser { | ||
|
||
private readonly userMain: CheUserMain; | ||
|
||
constructor(rpc: RPCProtocol) { | ||
this.userMain = rpc.getProxy(PLUGIN_RPC_CONTEXT.CHE_USER_MAIN); | ||
} | ||
|
||
getUserPreferences(filter?: string): Promise<Preferences> { | ||
return this.userMain.$getUserPreferences(filter); | ||
} | ||
|
||
updateUserPreferences(update: Preferences): Promise<Preferences> { | ||
return this.userMain.$updateUserPreferences(update); | ||
} | ||
|
||
replaceUserPreferences(preferences: Preferences): Promise<Preferences> { | ||
return this.userMain.$replaceUserPreferences(preferences); | ||
} | ||
|
||
deleteUserPreferences(list?: string[]): Promise<void> { | ||
return this.userMain.$deleteUserPreferences(list); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters