Search in sources :

Example 1 with Type

use of org.eclipse.che.api.project.shared.dto.event.GitCheckoutEventDto.Type 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)

Aggregations

Type (org.eclipse.che.api.project.shared.dto.event.GitCheckoutEventDto.Type)1 NotificationManager (org.eclipse.che.ide.api.notification.NotificationManager)1