use of com.intellij.openapi.options.UnnamedConfigurable in project intellij-community by JetBrains.
the class VcsConfigurationsDialog method updateConfiguration.
private void updateConfiguration() {
int selectedIndex = myVcses.getSelectionModel().getMinSelectionIndex();
final VcsDescriptor currentVcs;
currentVcs = selectedIndex >= 0 ? (VcsDescriptor) (myVcses.getModel()).getElementAt(selectedIndex) : null;
String currentName = currentVcs == null ? NONE : currentVcs.getName();
if (currentVcs != null) {
final UnnamedConfigurable unnamedConfigurable = myVcsNameToConfigurableMap.get(currentName);
unnamedConfigurable.createComponent();
unnamedConfigurable.reset();
}
final CardLayout cardLayout = (CardLayout) myVcsConfigurationPanel.getLayout();
cardLayout.show(myVcsConfigurationPanel, currentName);
}
use of com.intellij.openapi.options.UnnamedConfigurable in project intellij-community by JetBrains.
the class VcsConfigurationsDialog method doOKAction.
protected void doOKAction() {
for (String vcsName : myVcsNameToConfigurableMap.keySet()) {
UnnamedConfigurable configurable = myVcsNameToConfigurableMap.get(vcsName);
if (configurable != null && configurable.isModified()) {
try {
configurable.apply();
} catch (ConfigurationException e) {
Messages.showErrorDialog(VcsBundle.message("message.text.unable.to.save.settings", e.getMessage()), VcsBundle.message("message.title.unable.to.save.settings"));
}
}
}
final JComboBox vcsesToUpdate = myVcsesToUpdate;
if (vcsesToUpdate != null) {
final VcsDescriptor wrapper = (VcsDescriptor) myVcses.getSelectedValue();
vcsesToUpdate.setSelectedItem(wrapper);
final ComboBoxModel model = vcsesToUpdate.getModel();
for (int i = 0; i < model.getSize(); i++) {
final Object vcsWrapper = model.getElementAt(i);
if (vcsWrapper instanceof VcsDescriptor) {
final VcsDescriptor defaultVcsWrapper = (VcsDescriptor) vcsWrapper;
if (defaultVcsWrapper.equals(wrapper)) {
vcsesToUpdate.setSelectedIndex(i);
break;
}
}
}
}
super.doOKAction();
}
use of com.intellij.openapi.options.UnnamedConfigurable 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();
}
Aggregations