use of com.intellij.openapi.projectRoots.impl.PerlSdkTable in project Perl5-IDEA by Camelcade.
the class Perl5SdkConfigurable method renameSdk.
private void renameSdk(AnActionEvent e) {
Sdk selectedSdk = getSelectedSdk();
if (selectedSdk == null) {
return;
}
PerlSdkTable perlSdkTable = PerlSdkTable.getInstance();
Messages.showInputDialog(myPanel.getSdkComboBox(), PerlBundle.message("perl.rename.sdk.text"), PerlBundle.message("perl.rename.sdk.title"), PerlIcons.PERL_LANGUAGE_ICON, selectedSdk.getName(), new InputValidator() {
@Override
public boolean checkInput(String inputString) {
if (StringUtil.isEmpty(inputString)) {
return false;
}
Sdk perlSdk = perlSdkTable.findJdk(inputString);
return perlSdk == null || perlSdk.equals(selectedSdk);
}
@Override
public boolean canClose(String inputString) {
if (StringUtil.equals(selectedSdk.getName(), inputString)) {
return true;
}
SdkModificator modificator = selectedSdk.getSdkModificator();
modificator.setName(inputString);
assert modificator instanceof Sdk;
perlSdkTable.updateJdk(selectedSdk, (Sdk) modificator);
myPanel.getSdkComboBox().repaint();
return true;
}
});
}
Aggregations