Search in sources :

Example 1 with CheckoutProvider

use of com.intellij.openapi.vcs.CheckoutProvider in project intellij-community by JetBrains.

the class CheckoutActionGroup method computeChildren.

@NotNull
@Override
protected AnAction[] computeChildren(@NotNull ActionManager manager) {
    CheckoutProvider[] providers = CheckoutProvider.EXTENSION_POINT_NAME.getExtensions();
    if (providers.length == 0) {
        return EMPTY_ARRAY;
    }
    Arrays.sort(providers, new CheckoutProvider.CheckoutProviderComparator());
    AnAction[] children = new AnAction[providers.length];
    for (int i = 0; i < providers.length; i++) {
        CheckoutProvider provider = providers[i];
        children[i] = createAction(provider);
    }
    return children;
}
Also used : CheckoutProvider(com.intellij.openapi.vcs.CheckoutProvider) AnAction(com.intellij.openapi.actionSystem.AnAction) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with CheckoutProvider

use of com.intellij.openapi.vcs.CheckoutProvider in project intellij-community by JetBrains.

the class GetFromVcsAction method fillActions.

protected void fillActions(DefaultActionGroup group) {
    final CheckoutProvider[] providers = Extensions.getExtensions(CheckoutProvider.EXTENSION_POINT_NAME);
    Arrays.sort(providers, new CheckoutProvider.CheckoutProviderComparator());
    for (CheckoutProvider provider : providers) {
        group.add(new CheckoutAction(provider));
    }
}
Also used : CheckoutProvider(com.intellij.openapi.vcs.CheckoutProvider) CheckoutAction(com.intellij.openapi.vcs.checkout.CheckoutAction)

Example 3 with CheckoutProvider

use of com.intellij.openapi.vcs.CheckoutProvider in project intellij-community by JetBrains.

the class JBProtocolCheckoutCommand method perform.

@Override
public void perform(String vcsId, Map<String, String> parameters) {
    String repository = parameters.get(REPOSITORY_NAME_KEY);
    if (StringUtil.isEmpty(repository)) {
        return;
    }
    for (CheckoutProvider provider : CheckoutProvider.EXTENSION_POINT_NAME.getExtensions()) {
        if (provider instanceof CheckoutProviderEx) {
            CheckoutProviderEx providerEx = (CheckoutProviderEx) provider;
            if (providerEx.getVcsId().equals(vcsId)) {
                Project project = ProjectManager.getInstance().getDefaultProject();
                CheckoutProvider.Listener listener = ProjectLevelVcsManager.getInstance(project).getCompositeCheckoutListener();
                AppIcon.getInstance().requestAttention(null, true);
                providerEx.doCheckout(project, listener, repository);
                break;
            }
        }
    }
}
Also used : CheckoutProvider(com.intellij.openapi.vcs.CheckoutProvider) Project(com.intellij.openapi.project.Project) CheckoutProviderEx(com.intellij.openapi.vcs.CheckoutProviderEx)

Aggregations

CheckoutProvider (com.intellij.openapi.vcs.CheckoutProvider)3 AnAction (com.intellij.openapi.actionSystem.AnAction)1 Project (com.intellij.openapi.project.Project)1 CheckoutProviderEx (com.intellij.openapi.vcs.CheckoutProviderEx)1 CheckoutAction (com.intellij.openapi.vcs.checkout.CheckoutAction)1 NotNull (org.jetbrains.annotations.NotNull)1