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()]);
}
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()]);
}
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());
}
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();
}
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();
}
Aggregations