Search in sources :

Example 1 with FeatureNameValidator

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

the class FeatureStartHandler method execute.

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

Aggregations

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