use of com.intellij.openapi.ui.NamedConfigurable in project intellij-community by JetBrains.
the class BaseStructureConfigurable method navigateTo.
@Override
public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) {
if (place == null)
return ActionCallback.DONE;
final Object object = place.getPath(TREE_OBJECT);
final String byName = (String) place.getPath(TREE_NAME);
if (object == null && byName == null)
return ActionCallback.DONE;
final MyNode node = object == null ? null : findNodeByObject(myRoot, object);
final MyNode nodeByName = byName == null ? null : findNodeByName(myRoot, byName);
if (node == null && nodeByName == null)
return ActionCallback.DONE;
final NamedConfigurable config;
if (node != null) {
config = node.getConfigurable();
} else {
config = nodeByName.getConfigurable();
}
final ActionCallback result = new ActionCallback().doWhenDone(() -> myAutoScrollEnabled = true);
myAutoScrollEnabled = false;
myAutoScrollHandler.cancelAllRequests();
final MyNode nodeToSelect = node != null ? node : nodeByName;
selectNodeInTree(nodeToSelect, requestFocus).doWhenDone(() -> {
setSelectedNode(nodeToSelect);
Place.goFurther(config, place, requestFocus).notifyWhenDone(result);
});
return result;
}
use of com.intellij.openapi.ui.NamedConfigurable in project intellij-community by JetBrains.
the class FacetEditorFacadeImpl method findFacetNode.
@Nullable
private static MasterDetailsComponent.MyNode findFacetNode(final Facet facet, final MasterDetailsComponent.MyNode moduleNode) {
for (int i = 0; i < moduleNode.getChildCount(); i++) {
final TreeNode node = moduleNode.getChildAt(i);
if (node instanceof MasterDetailsComponent.MyNode) {
final MasterDetailsComponent.MyNode configNode = (MasterDetailsComponent.MyNode) node;
final NamedConfigurable config = configNode.getConfigurable();
if (config instanceof FacetConfigurable) {
final Facet existingFacet = ((FacetConfigurable) config).getEditableObject();
if (existingFacet != null && existingFacet.equals(facet)) {
return configNode;
}
}
}
}
return null;
}
use of com.intellij.openapi.ui.NamedConfigurable in project intellij-community by JetBrains.
the class FacetStructureConfigurable method getHelpTopic.
@Override
public String getHelpTopic() {
final Component component = PlatformDataKeys.CONTEXT_COMPONENT.getData(DataManager.getInstance().getDataContext());
if (myTree.equals(component)) {
final NamedConfigurable selectedConfigurable = getSelectedConfigurable();
if (selectedConfigurable instanceof FacetTypeConfigurable) {
final FacetType facetType = ((FacetTypeConfigurable) selectedConfigurable).getEditableObject();
final String topic = facetType.getHelpTopic();
if (topic != null) {
return topic;
}
}
}
if (myCurrentMultipleSettingsEditor != null) {
final String topic = myCurrentMultipleSettingsEditor.getHelpTopic();
if (topic != null) {
return topic;
}
}
String topic = super.getHelpTopic();
if (topic != null) {
return topic;
}
return "reference.settingsdialog.project.structure.facet";
}
use of com.intellij.openapi.ui.NamedConfigurable in project intellij-community by JetBrains.
the class ProjectJdksConfigurable method apply.
@Override
public void apply() throws ConfigurationException {
final Ref<ConfigurationException> exceptionRef = Ref.create();
try {
super.apply();
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 (myProjectJdksModel.isModified() || modifiedJdks) {
myProjectJdksModel.apply(this);
}
myProjectJdksModel.setProjectSdk(getSelectedJdk());
} catch (ConfigurationException e) {
exceptionRef.set(e);
}
if (!exceptionRef.isNull()) {
throw exceptionRef.get();
}
}
use of com.intellij.openapi.ui.NamedConfigurable in project android by JetBrains.
the class BasePerspectiveConfigurable method navigateTo.
@Override
public ActionCallback navigateTo(@Nullable Place place, boolean requestFocus) {
if (place != null) {
Object path = place.getPath(getNavigationPathName());
if (path instanceof String) {
String moduleName = (String) path;
if (!isEmpty(moduleName)) {
ActionCallback callback = new ActionCallback();
getContext().setSelectedModule(moduleName, this);
selectModule(moduleName);
NamedConfigurable selectedConfigurable = getSelectedConfigurable();
if (selectedConfigurable != null) {
goFurther(selectedConfigurable, place, requestFocus).notifyWhenDone(callback);
return callback;
}
}
}
}
return ActionCallback.DONE;
}
Aggregations