enable native mac file open dialogs in some cases by default

This commit is contained in:
Alexey Pegov
2010-10-18 20:37:21 +04:00
parent c313fcf7ed
commit 112d1cde58
8 changed files with 66 additions and 45 deletions
@@ -82,7 +82,7 @@ public class ProjectJdkForModuleStep extends ModuleWizardStep {
final JdkListConfigurable jdkConfig = JdkListConfigurable.getInstance(project);
final ProjectSdksModel projectJdksModel = projectConfig.getProjectJdksModel();
final boolean[] successfullyAdded = new boolean[1];
projectJdksModel.doAdd(type, myPanel, new Consumer<Sdk>() {
projectJdksModel.doAdd(type, new Consumer<Sdk>() {
public void consume(final Sdk jdk) {
successfullyAdded[0] = jdkConfig.addJdkNode(jdk, false);
myJdkChooser.updateList(jdk, type);
@@ -36,6 +36,7 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.TabbedPaneWrapper;
import com.intellij.ui.navigation.History;
import com.intellij.ui.navigation.Place;
import com.intellij.util.Consumer;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -274,8 +275,13 @@ public class SdkEditor implements Configurable, Place.Navigator {
private void doSelectHomePath(){
final SdkType sdkType = mySdk.getSdkType();
final String homePath = SdkConfigurationUtil.selectSdkHome(myHomeComponent, sdkType);
doSetHomePath(homePath, sdkType);
SdkConfigurationUtil.selectSdkHome(sdkType, new Consumer<String>() {
@Override
public void consume(final String path) {
doSetHomePath(path, sdkType);
}
});
}
private void doSetHomePath(final String homePath, final SdkType sdkType) {