Search in sources :

Example 1 with HotfixNameValidator

use of org.eclipse.egit.gitflow.ui.internal.validation.HotfixNameValidator in project egit by eclipse.

the class HotfixStartHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event);
    InputDialog inputDialog = new InputDialog(HandlerUtil.getActiveShell(event), UIText.HotfixStartHandler_provideHotfixName, UIText.HotfixStartHandler_pleaseProvideANameForTheNewHotfix, // $NON-NLS-1$
    "", new HotfixNameValidator(gfRepo));
    if (inputDialog.open() != Window.OK) {
        return null;
    }
    final String hotfixName = inputDialog.getValue();
    HotfixStartOperation hotfixStartOperation = new HotfixStartOperation(gfRepo, hotfixName);
    JobUtil.scheduleUserWorkspaceJob(hotfixStartOperation, UIText.HotfixStartHandler_startingNewHotfix, JobFamilies.GITFLOW_FAMILY);
    return null;
}
Also used : InputDialog(org.eclipse.jface.dialogs.InputDialog) HotfixStartOperation(org.eclipse.egit.gitflow.op.HotfixStartOperation) HotfixNameValidator(org.eclipse.egit.gitflow.ui.internal.validation.HotfixNameValidator) GitFlowRepository(org.eclipse.egit.gitflow.GitFlowRepository)

Aggregations

GitFlowRepository (org.eclipse.egit.gitflow.GitFlowRepository)1 HotfixStartOperation (org.eclipse.egit.gitflow.op.HotfixStartOperation)1 HotfixNameValidator (org.eclipse.egit.gitflow.ui.internal.validation.HotfixNameValidator)1 InputDialog (org.eclipse.jface.dialogs.InputDialog)1