use of com.intellij.openapi.roots.ui.configuration.projectRoot.JdkConfigurable in project intellij-community by JetBrains.
the class ProjectJdksConfigurable method createActions.
@Override
@Nullable
protected ArrayList<AnAction> createActions(final boolean fromPopup) {
if (myProjectJdksModel == null) {
return null;
}
final ArrayList<AnAction> actions = new ArrayList<>();
DefaultActionGroup group = new DefaultActionGroup(ProjectBundle.message("add.new.jdk.text"), true);
group.getTemplatePresentation().setIcon(IconUtil.getAddIcon());
myProjectJdksModel.createAddActions(group, myTree, projectJdk -> {
addNode(new MyNode(new JdkConfigurable(((ProjectJdkImpl) projectJdk), myProjectJdksModel, TREE_UPDATER, myHistory, myProject), false), myRoot);
selectNodeInTree(findNodeByObject(myRoot, projectJdk));
});
actions.add(new MyActionGroupWrapper(group));
actions.add(new MyDeleteAction(Conditions.<Object[]>alwaysTrue()));
return actions;
}
use of com.intellij.openapi.roots.ui.configuration.projectRoot.JdkConfigurable in project intellij-community by JetBrains.
the class ProjectJdksConfigurable method reset.
@Override
public void reset() {
super.reset();
myProjectJdksModel.reset(myProject);
myRoot.removeAllChildren();
final Map<Sdk, Sdk> sdks = myProjectJdksModel.getProjectSdks();
for (Sdk sdk : sdks.keySet()) {
final JdkConfigurable configurable = new JdkConfigurable((ProjectJdkImpl) sdks.get(sdk), myProjectJdksModel, TREE_UPDATER, myHistory, myProject);
addNode(new MyNode(configurable), myRoot);
}
//restore selection
selectJdk(myProjectJdksModel.getProjectSdk());
JBSplitter splitter = extractSplitter();
if (splitter != null) {
splitter.setAndLoadSplitterProportionKey("project.jdk.splitter");
}
}
Aggregations