use of com.intellij.openapi.ui.NamedConfigurable in project intellij-community by JetBrains.
the class BaseStructureConfigurable method getSelectedElement.
@Nullable
public ProjectStructureElement getSelectedElement() {
final TreePath selectionPath = myTree.getSelectionPath();
if (selectionPath != null && selectionPath.getLastPathComponent() instanceof MyNode) {
MyNode node = (MyNode) selectionPath.getLastPathComponent();
final NamedConfigurable configurable = node.getConfigurable();
if (configurable instanceof ProjectStructureElementConfigurable) {
return ((ProjectStructureElementConfigurable) configurable).getProjectStructureElement();
}
}
return null;
}
use of com.intellij.openapi.ui.NamedConfigurable in project intellij-community by JetBrains.
the class JdkListConfigurable method apply.
@Override
public void apply() throws ConfigurationException {
boolean modifiedJdks = false;
for (int i = 0; i < myRoot.getChildCount(); i++) {
final NamedConfigurable configurable = ((MyNode) myRoot.getChildAt(i)).getConfigurable();
if (configurable.isModified()) {
configurable.apply();
modifiedJdks = true;
}
}
if (myJdksTreeModel.isModified() || modifiedJdks)
myJdksTreeModel.apply(this);
myJdksTreeModel.setProjectSdk(ProjectRootManager.getInstance(myProject).getProjectSdk());
}
use of com.intellij.openapi.ui.NamedConfigurable in project intellij-community by JetBrains.
the class ProjectJdksConfigurable method processRemovedItems.
@Override
protected void processRemovedItems() {
final Set<Sdk> jdks = new HashSet<>();
for (int i = 0; i < myRoot.getChildCount(); i++) {
final DefaultMutableTreeNode node = (DefaultMutableTreeNode) myRoot.getChildAt(i);
final NamedConfigurable namedConfigurable = (NamedConfigurable) node.getUserObject();
jdks.add(((JdkConfigurable) namedConfigurable).getEditableObject());
}
final HashMap<Sdk, Sdk> sdks = new HashMap<>(myProjectJdksModel.getProjectSdks());
for (Sdk sdk : sdks.values()) {
if (!jdks.contains(sdk)) {
myProjectJdksModel.removeSdk(sdk);
}
}
}
use of com.intellij.openapi.ui.NamedConfigurable in project android by JetBrains.
the class BasePerspectiveConfigurable method putNavigationPath.
public void putNavigationPath(@NotNull Place place, @NotNull String moduleName, @NotNull String dependency) {
place.putPath(getNavigationPathName(), moduleName);
PsModule module = findModule(moduleName);
assert module != null;
MyNode node = findNodeByObject(myRoot, module);
assert node != null;
NamedConfigurable configurable = node.getConfigurable();
assert configurable instanceof BaseNamedConfigurable;
BaseNamedConfigurable dependenciesConfigurable = (BaseNamedConfigurable) configurable;
dependenciesConfigurable.putNavigationPath(place, dependency);
}
use of com.intellij.openapi.ui.NamedConfigurable in project android by JetBrains.
the class BasePerspectiveConfigurable method queryPlace.
@Override
public void queryPlace(@NotNull Place place) {
NamedConfigurable selectedConfigurable = getSelectedConfigurable();
if (selectedConfigurable instanceof BaseNamedConfigurable) {
PsModule module = ((BaseNamedConfigurable) selectedConfigurable).getEditableObject();
String moduleName = module.getName();
place.putPath(getNavigationPathName(), moduleName);
queryFurther(selectedConfigurable, place);
return;
}
place.putPath(getNavigationPathName(), "");
}
Aggregations