Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Add notification manager API #2

Merged
merged 1 commit into from
May 7, 2018
Merged

Add notification manager API #2

merged 1 commit into from
May 7, 2018

Conversation

olexii4
Copy link

@olexii4 olexii4 commented Apr 23, 2018

Add notification manager API to the new plugin system.
Discussion about architecture and principles can be found here: eclipse-theia#1482
This API allows implementation of notifications to show an information message. Optionally provide an array of items which will be presented as clickable buttons and can be shown using the showInformationMessage,
showWarningMessage and showErrorMessage functions.

Simple example that show an information message:

theia.window.showInformationMessage('Information message');

Simple example that show an information message with buttons:

theia.window.showInformationMessage('Information message', 'Btn1', 'Btn2').then(result => {
    console.log("Click button", result);
});

eclipse-che/che#9525

selection_141
selection_148
selection_154
Both kind of notifications with buttons:
selection_136

Signed-off-by: Oleksii Orel oorel@redhat.com

};

export const MAIN_RPC_CONTEXT = {
HOSTED_PLUGIN_MANAGER_EXT: createProxyIdentifier<HostedPluginManagerExt>('HostedPluginManagerExt'),
COMMAND_REGISTRY_EXT: createProxyIdentifier<CommandRegistryExt>('CommandRegistryExt'),
QUICK_OPEN_EXT: createProxyIdentifier<QuickOpenExt>('QuickOpenExt')
QUICK_OPEN_EXT: createProxyIdentifier<QuickOpenExt>('QuickOpenExt'),
MESSAGE_REGISTRY_EXT: createProxyIdentifier('MessageRegistryExt')
Copy link

@evidolob evidolob Apr 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you add this MESSAGE_REGISTRY_EXT ? Is this used anywhere?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unnecessary, see comment below


export function createAPI(rpc: RPCProtocol): typeof theia {
const commandRegistryExt = rpc.set(MAIN_RPC_CONTEXT.COMMAND_REGISTRY_EXT, new CommandRegistryImpl(rpc));
const quickOpenExt = rpc.set(MAIN_RPC_CONTEXT.QUICK_OPEN_EXT, new QuickOpenExtImpl(rpc));
const messageRegistryExt = rpc.set(MAIN_RPC_CONTEXT.MESSAGE_REGISTRY_EXT, new MessageRegistryExt(rpc));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to do rpc.set, as your MessageRegistryExt is never called from Theia core part

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I just added a mechanism for possible future In the first realization. I'll remove.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

.dialogContent .theia-Notification .icon {
font-size: 20px;
padding: 5px 0;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a missing EOF

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@olexii4 olexii4 merged commit f918444 into master May 7, 2018
@olexii4 olexii4 deleted the CHE-9284 branch May 7, 2018 15:20
benoitf pushed a commit that referenced this pull request May 29, 2018
Signed-off-by: Oleksii Orel <oorel@redhat.com>
benoitf pushed a commit that referenced this pull request Jun 4, 2018
Signed-off-by: Oleksii Orel <oorel@redhat.com>
benoitf pushed a commit that referenced this pull request Jun 13, 2018
Signed-off-by: Oleksii Orel <oorel@redhat.com>
benoitf pushed a commit that referenced this pull request Jun 18, 2018
Signed-off-by: Oleksii Orel <oorel@redhat.com>
benoitf pushed a commit that referenced this pull request Jun 18, 2018
Signed-off-by: Oleksii Orel <oorel@redhat.com>
benoitf pushed a commit that referenced this pull request Jun 19, 2018
Signed-off-by: Oleksii Orel <oorel@redhat.com>
benoitf pushed a commit that referenced this pull request Jun 19, 2018
Signed-off-by: Oleksii Orel <oorel@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants