Search in sources :

Example 6 with VcsDescriptor

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

the class AllVcses method getAll.

public VcsDescriptor[] getAll() {
    final List<VcsDescriptor> result = new ArrayList<>(myExtensions.size());
    for (VcsEP vcsEP : myExtensions.values()) {
        result.add(vcsEP.createDescriptor());
    }
    Collections.sort(result);
    return result.toArray(new VcsDescriptor[result.size()]);
}
Also used : VcsEP(com.intellij.openapi.vcs.impl.VcsEP) VcsDescriptor(com.intellij.openapi.vcs.impl.VcsDescriptor)

Example 7 with VcsDescriptor

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

the class VcsManagerConfigurable method buildConfigurables.

@Override
protected Configurable[] buildConfigurables() {
    myGeneralPanel = new VcsGeneralConfigurationConfigurable(myProject, this);
    List<Configurable> result = new ArrayList<>();
    result.add(myGeneralPanel);
    result.add(new VcsBackgroundOperationsConfigurable(myProject));
    if (!myProject.isDefault()) {
        result.add(new IgnoredSettingsPanel(myProject));
    }
    /*if (!myProject.isDefault()) {
      result.add(new CacheSettingsPanel(myProject));
    }*/
    result.add(new IssueNavigationConfigurationPanel(myProject));
    if (!myProject.isDefault()) {
        result.add(new ChangelistConflictConfigurable(ChangeListManagerImpl.getInstanceImpl(myProject)));
    }
    result.add(new ShelfProjectConfigurable(myProject));
    for (VcsConfigurableProvider provider : VcsConfigurableProvider.EP_NAME.getExtensions()) {
        final Configurable configurable = provider.getConfigurable(myProject);
        if (configurable != null) {
            result.add(configurable);
        }
    }
    VcsDescriptor[] vcses = ProjectLevelVcsManager.getInstance(myProject).getAllVcss();
    for (VcsDescriptor vcs : vcses) {
        result.add(createVcsConfigurableWrapper(vcs));
    }
    return result.toArray(new Configurable[result.size()]);
}
Also used : VcsConfigurableProvider(com.intellij.openapi.vcs.VcsConfigurableProvider) ArrayList(java.util.ArrayList) Configurable(com.intellij.openapi.options.Configurable) SearchableConfigurable(com.intellij.openapi.options.SearchableConfigurable) ChangelistConflictConfigurable(com.intellij.openapi.vcs.changes.conflicts.ChangelistConflictConfigurable) IgnoredSettingsPanel(com.intellij.openapi.vcs.changes.ui.IgnoredSettingsPanel) ChangelistConflictConfigurable(com.intellij.openapi.vcs.changes.conflicts.ChangelistConflictConfigurable) VcsDescriptor(com.intellij.openapi.vcs.impl.VcsDescriptor)

Example 8 with VcsDescriptor

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

the class VcsMappingConfigurationDialog method getMapping.

@NotNull
public VcsDirectoryMapping getMapping() {
    VcsDescriptor wrapper = (VcsDescriptor) myVCSComboBox.getSelectedItem();
    String vcs = wrapper == null || wrapper.isNone() ? "" : wrapper.getName();
    String directory = myProjectRadioButton.isSelected() ? "" : FileUtil.toSystemIndependentName(myDirectoryTextField.getText());
    return new VcsDirectoryMapping(directory, vcs, myMappingCopy.getRootSettings());
}
Also used : VcsDescriptor(com.intellij.openapi.vcs.impl.VcsDescriptor) NotNull(org.jetbrains.annotations.NotNull)

Example 9 with VcsDescriptor

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

the class VcsMappingConfigurationDialog method updateVcsConfigurable.

private void updateVcsConfigurable() {
    if (myVcsConfigurable != null) {
        myVcsConfigurablePlaceholder.remove(myVcsConfigurableComponent);
        myVcsConfigurable.disposeUIResources();
        myVcsConfigurable = null;
    }
    VcsDescriptor wrapper = (VcsDescriptor) myVCSComboBox.getSelectedItem();
    if (wrapper != null && (!wrapper.isNone())) {
        final AbstractVcs vcs = myVcsManager.findVcsByName(wrapper.getName());
        if (vcs != null) {
            UnnamedConfigurable configurable = vcs.getRootConfigurable(myMappingCopy);
            if (configurable != null) {
                myVcsConfigurable = configurable;
                myVcsConfigurableComponent = myVcsConfigurable.createComponent();
                myVcsConfigurablePlaceholder.add(myVcsConfigurableComponent, BorderLayout.CENTER);
            }
        }
    }
    pack();
}
Also used : UnnamedConfigurable(com.intellij.openapi.options.UnnamedConfigurable) VcsDescriptor(com.intellij.openapi.vcs.impl.VcsDescriptor)

Example 10 with VcsDescriptor

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

the class GitOptionsTopHitProvider method getOptions.

@NotNull
@Override
public Collection<OptionDescription> getOptions(@Nullable Project project) {
    if (project != null) {
        for (VcsDescriptor descriptor : ProjectLevelVcsManager.getInstance(project).getAllVcss()) {
            if ("Git".equals(descriptor.getDisplayName())) {
                final GitVcsSettings settings = GitVcsSettings.getInstance(project);
                ArrayList<BooleanOptionDescription> options = new ArrayList<>();
                options.add(option(project, "Git: Commit automatically on cherry-pick", "isAutoCommitOnCherryPick", "setAutoCommitOnCherryPick"));
                options.add(option(project, "Git: Auto-update if push of the current branch was rejected", "autoUpdateIfPushRejected", "setAutoUpdateIfPushRejected"));
                GitRepositoryManager manager = GitRepositoryManager.getInstance(project);
                if (manager != null && manager.moreThanOneRoot()) {
                    options.add(new BooleanOptionDescription("Git: Control repositories synchronously", "vcs.Git") {

                        @Override
                        public boolean isOptionEnabled() {
                            return settings.getSyncSetting() == DvcsSyncSettings.Value.SYNC;
                        }

                        @Override
                        public void setOptionState(boolean enabled) {
                            settings.setSyncSetting(enabled ? DvcsSyncSettings.Value.SYNC : DvcsSyncSettings.Value.DONT_SYNC);
                        }
                    });
                }
                options.add(option(project, "Git: Warn if CRLF line separators are about to be committed", "warnAboutCrlf", "setWarnAboutCrlf"));
                options.add(option(project, "Git: Warn when committing in detached HEAD or during rebase", "warnAboutDetachedHead", "setWarnAboutDetachedHead"));
                options.add(option(project, "Git: Allow force push", "isForcePushAllowed", "setForcePushAllowed"));
                return Collections.unmodifiableCollection(options);
            }
        }
    }
    return Collections.emptyList();
}
Also used : BooleanOptionDescription(com.intellij.ide.ui.search.BooleanOptionDescription) ArrayList(java.util.ArrayList) GitRepositoryManager(git4idea.repo.GitRepositoryManager) VcsDescriptor(com.intellij.openapi.vcs.impl.VcsDescriptor) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

VcsDescriptor (com.intellij.openapi.vcs.impl.VcsDescriptor)10 UnnamedConfigurable (com.intellij.openapi.options.UnnamedConfigurable)3 ArrayList (java.util.ArrayList)2 NotNull (org.jetbrains.annotations.NotNull)2 BooleanOptionDescription (com.intellij.ide.ui.search.BooleanOptionDescription)1 Configurable (com.intellij.openapi.options.Configurable)1 ConfigurationException (com.intellij.openapi.options.ConfigurationException)1 SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)1 VcsConfigurableProvider (com.intellij.openapi.vcs.VcsConfigurableProvider)1 ChangelistConflictConfigurable (com.intellij.openapi.vcs.changes.conflicts.ChangelistConflictConfigurable)1 IgnoredSettingsPanel (com.intellij.openapi.vcs.changes.ui.IgnoredSettingsPanel)1 VcsEP (com.intellij.openapi.vcs.impl.VcsEP)1 GitRepositoryManager (git4idea.repo.GitRepositoryManager)1 ListSelectionEvent (javax.swing.event.ListSelectionEvent)1 ListSelectionListener (javax.swing.event.ListSelectionListener)1