Search in sources :

Example 1 with NotificationManager

use of org.eclipse.che.ide.api.notification.NotificationManager in project che by eclipse.

the class GitCheckoutStatusNotificationOperation method apply.

@Override
public void apply(String endpointId, GitCheckoutEventDto dto) {
    final Type type = dto.getType();
    final String name = dto.getName();
    switch(type) {
        case BRANCH:
            {
                Log.debug(getClass(), "Received git branch checkout event: " + name);
                final NotificationManager notificationManager = notificationManagerProvider.get();
                if (notificationManager != null) {
                    notificationManager.notify("Git operation", "Branch '" + name + "' is checked out", SUCCESS, EMERGE_MODE);
                }
                break;
            }
        case REVISION:
            {
                Log.debug(getClass(), "Received git revision checkout event: " + name);
                final NotificationManager notificationManager = notificationManagerProvider.get();
                if (notificationManager != null) {
                    notificationManager.notify("Git operation", "Revision '" + name + "' is checked out", SUCCESS, EMERGE_MODE);
                }
                break;
            }
    }
}
Also used : Type(org.eclipse.che.api.project.shared.dto.event.GitCheckoutEventDto.Type) NotificationManager(org.eclipse.che.ide.api.notification.NotificationManager)

Example 2 with NotificationManager

use of org.eclipse.che.ide.api.notification.NotificationManager in project che by eclipse.

the class JavaCompilerPreferencePresenterTest method propertiesShouldBeDisplayedFailed.

@Test
public void propertiesShouldBeDisplayedFailed() throws OperationException {
    PromiseError promiseError = mock(PromiseError.class);
    NotificationManager notificationManager = mock(NotificationManager.class);
    when(notificationManagerProvider.get()).thenReturn(notificationManager);
    presenter.onWsAgentStarted(wsAgentStateEvent);
    presenter.go(container);
    verify(mapPromise).catchError(errorOperationCaptor.capture());
    errorOperationCaptor.getValue().apply(promiseError);
    verify(preferencesManager).loadPreferences();
    verify(notificationManager).notify(anyString(), eq(FAIL), eq(FLOAT_MODE));
}
Also used : PromiseError(org.eclipse.che.api.promises.client.PromiseError) NotificationManager(org.eclipse.che.ide.api.notification.NotificationManager) Test(org.junit.Test)

Aggregations

NotificationManager (org.eclipse.che.ide.api.notification.NotificationManager)2 Type (org.eclipse.che.api.project.shared.dto.event.GitCheckoutEventDto.Type)1 PromiseError (org.eclipse.che.api.promises.client.PromiseError)1 Test (org.junit.Test)1