private ActionCallback initConfigurable(@NotNull final Configurable configurable) { final ActionCallback result = new ActionCallback(); final ConfigurableContent content = new Simple(configurable); if (!myConfigurable2Content.containsKey(configurable)) { if (configurable instanceof Place.Navigator) { ((Place.Navigator)configurable).setHistory(myHistory); } configurable.reset(); } UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { if (myDisposed) return; myConfigurable2Content.put(configurable, content); result.setDone(); } }); return result; }
@Override public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) { final Configurable config = (Configurable)place.getPath("configurable"); final String filter = (String)place.getPath("filter"); final ActionCallback result = new ActionCallback(); myFilter.update(filter, false, true).doWhenDone(new Runnable() { @Override public void run() { selectInTree(config).notifyWhenDone(result); } }); return result; }
@Override public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) { final Configurable config = (Configurable)place.getPath("configurable"); final String filter = (String)place.getPath("filter"); final ActionCallback result = new ActionCallback(); myFilter.refilterFor(filter, false, true).doWhenDone(new Runnable() { @Override public void run() { myTree.select(config).notifyWhenDone(result); } }); return result; }
public ActionCallback selectOrderEntry(@Nonnull final Module module, @Nullable final OrderEntry orderEntry) { Place p = new Place(); p.putPath(ProjectStructureConfigurable.CATEGORY, this); Runnable r = null; final MasterDetailsComponent.MyNode node = findModuleNode(module); if (node != null) { p.putPath(TREE_OBJECT, module); p.putPath(ModuleEditor.SELECTED_EDITOR_NAME, ClasspathEditor.NAME); r = new Runnable() { @Override public void run() { if (orderEntry != null) { ModuleEditor moduleEditor = ((ModuleConfigurable)node.getConfigurable()).getModuleEditor(); ModuleConfigurationEditor editor = moduleEditor.getEditor(ClasspathEditor.NAME); if (editor instanceof ClasspathEditor) { ((ClasspathEditor)editor).selectOrderEntry(orderEntry); } } } }; } final ActionCallback result = ProjectStructureConfigurable.getInstance(myProject).navigateTo(p, true); return r != null ? result.doWhenDone(r) : result; }
public ActionCallback select(@Nullable final Facet facetToSelect, final boolean requestFocus) { Place place = createModulesPlace(); if (facetToSelect != null) { place = place.putPath(ModuleStructureConfigurable.TREE_OBJECT, facetToSelect); } return navigateTo(place, requestFocus); }
public Place createArtifactPlace(Artifact artifact) { Place place = createPlaceFor(myArtifactsStructureConfigurable); if (artifact != null) { place.putPath(BaseStructureConfigurable.TREE_NAME, artifact.getName()); } return place; }
public ActionCallback select(@NotNull LibraryOrderEntry libraryOrderEntry, final boolean requestFocus) { final Library lib = libraryOrderEntry.getLibrary(); if (lib == null || lib.getTable() == null) { return selectOrderEntry(libraryOrderEntry.getOwnerModule(), libraryOrderEntry); } Place place = createPlaceFor(getConfigurableFor(lib)); place.putPath(BaseStructureConfigurable.TREE_NAME, libraryOrderEntry.getLibraryName()); return navigateTo(place, requestFocus); }
@Override public void queryPlace(@NotNull final Place place) { final ModuleEditor editor = getModuleEditor(); if (editor != null) { editor.queryPlace(place); } }
public ActionCallback selectOrderEntry(@NotNull final Module module, @Nullable final OrderEntry orderEntry) { for (final ModuleStructureExtension extension : ModuleStructureExtension.EP_NAME.getExtensions()) { final ActionCallback callback = extension.selectOrderEntry(module, orderEntry); if (callback != null) { return callback; } } Place p = new Place(); p.putPath(ProjectStructureConfigurable.CATEGORY, this); Runnable r = null; final MasterDetailsComponent.MyNode node = findModuleNode(module); if (node != null) { p.putPath(TREE_OBJECT, module); p.putPath(ModuleEditor.SELECTED_EDITOR_NAME, ClasspathEditor.NAME); r = new Runnable() { @Override public void run() { if (orderEntry != null) { ModuleEditor moduleEditor = ((ModuleConfigurable)node.getConfigurable()).getModuleEditor(); ModuleConfigurationEditor editor = moduleEditor.getEditor(ClasspathEditor.NAME); if (editor instanceof ClasspathEditor) { ((ClasspathEditor)editor).selectOrderEntry(orderEntry); } } } }; } final ActionCallback result = ProjectStructureConfigurable.getInstance(myProject).navigateTo(p, true); return r != null ? result.doWhenDone(r) : result; }
@Override public void queryPlace(@NotNull final Place place) { if (myCurrentConfigurable != null) { place.putPath(TREE_OBJECT, myCurrentConfigurable.getEditableObject()); Place.queryFurther(myCurrentConfigurable, place); } }
public void addPlace(Place place, @NotNull Presentation presentation) { myModel.addElement(place); myPlaces.add(place); myPlace2Presentation.put(place, presentation); revalidate(); repaint(); }
@Override public void queryPlace(@NotNull Place place) { ModuleConfigurationEditor singleEditor = getSingleEditor(); if (singleEditor != null) { place.putPath(SELECTED_EDITOR_NAME, singleEditor.getDisplayName()); } else { super.queryPlace(place); } }
@Override public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) { if (place != null) { selectEditor((String)place.getPath(SELECTED_EDITOR_NAME)); } return ActionCallback.DONE; }
@Override public void queryPlace(@NotNull final Place place) { final Configurable current = getContext().getCurrentConfigurable(); place.putPath("configurable", current); place.putPath("filter", myFilter.getFilterText()); if (current instanceof Place.Navigator) { ((Place.Navigator)current).queryPlace(place); } }
@Override public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) { if (place != null) { selectEditor((String)place.getPath(SELECTED_EDITOR_NAME)); } return new ActionCallback.Done(); }
private ActionCallback initConfigurable(@NotNull final Configurable configurable) { final ActionCallback result = new ActionCallback(); final ConfigurableContent content; if (configurable instanceof MasterDetails) { content = new Details((MasterDetails)configurable); } else { content = new Simple(configurable); } if (!myConfigurable2Content.containsKey(configurable)) { if (configurable instanceof Place.Navigator) { ((Place.Navigator)configurable).setHistory(myHistory); } configurable.reset(); } UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { if (myDisposed) return; myConfigurable2Content.put(configurable, content); result.setDone(); } }); return result; }
@Override public void queryPlace(@NotNull final Place place) { final Configurable current = getContext().getCurrentConfigurable(); place.putPath("configurable", current); place.putPath("filter", getFilterText()); if (current instanceof Place.Navigator) { ((Place.Navigator)current).queryPlace(place); } }
@Override public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) { final Configurable config = (Configurable)place.getPath("configurable"); final String filter = (String)place.getPath("filter"); final ActionCallback result = new ActionCallback(); myFilter.refilterFor(filter, false, true).doWhenDone(() -> myTree.select(config).notifyWhenDone(result)); return result; }
@Override public void queryPlace(@Nonnull final Place place) { final Configurable current = getContext().getCurrentConfigurable(); place.putPath("configurable", current); place.putPath("filter", getFilterText()); if (current instanceof Place.Navigator) { ((Place.Navigator)current).queryPlace(place); } }
public ActionCallback select(@Nonnull LibraryOrderEntry libraryOrderEntry, final boolean requestFocus) { final Library lib = libraryOrderEntry.getLibrary(); if (lib == null || lib.getTable() == null) { return selectOrderEntry(libraryOrderEntry.getOwnerModule(), libraryOrderEntry); } Place place = createPlaceFor(getConfigurableFor(lib)); place.putPath(BaseStructureConfigurable.TREE_NAME, libraryOrderEntry.getLibraryName()); return navigateTo(place, requestFocus); }
@Override public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) { if(myProjectStructureDialog == null) { return ActionCallback.REJECTED; } final Configurable toSelect = (Configurable)place.getPath(CATEGORY); if (mySelectedConfigurable != toSelect) { if (mySelectedConfigurable instanceof BaseStructureConfigurable) { ((BaseStructureConfigurable)mySelectedConfigurable).onStructureUnselected(); } removeSelected(); if (toSelect != null) { myProjectStructureDialog.select(toSelect); } setSelectedConfigurable(toSelect); if (toSelect instanceof MasterDetailsComponent) { final MasterDetailsComponent masterDetails = (MasterDetailsComponent)toSelect; masterDetails.setHistory(myHistory); } if (toSelect instanceof BaseStructureConfigurable) { ((BaseStructureConfigurable)toSelect).onStructureSelected(); } } final ActionCallback result = new ActionCallback(); Place.goFurther(toSelect, place, requestFocus).notifyWhenDone(result); if (!myHistory.isNavigatingNow() && mySelectedConfigurable != null) { myHistory.pushQueryPlace(); } return result; }
@Override public void queryPlace(@Nonnull final Place place) { final ModuleEditor editor = getModuleEditor(); if (editor != null) { editor.queryPlace(place); } }
@Override public void queryPlace(@Nonnull final Place place) { if (myCurrentConfigurable != null) { place.putPath(TREE_OBJECT, myCurrentConfigurable.getEditableObject()); Place.queryFurther(myCurrentConfigurable, place); } }
@Override public void queryPlace(@Nonnull Place place) { ModuleConfigurationEditor singleEditor = getSingleEditor(); if (singleEditor != null) { place.putPath(ModuleEditor.SELECTED_EDITOR_NAME, singleEditor.getDisplayName()); } else { super.queryPlace(place); } }
@Override public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) { if (place == null) return ActionCallback.DONE; myTabbedPane.setSelectedTitle((String)place.getPath(SDK_TAB)); return ActionCallback.DONE; }
@Override public void queryPlace(@NotNull final Place place) { place.putPath(SDK_TAB, myTabbedPane.getSelectedTitle()); }
@Override public void queryPlace(@NotNull final Place place) { place.putPath(CATEGORY, mySelectedConfigurable); Place.queryFurther(mySelectedConfigurable, place); }
public Place createProjectConfigurablePlace() { return createPlaceFor(myProjectConfig); }
public Place createModulesPlace() { return createPlaceFor(myModulesConfig); }
public Place createModulePlace(@NotNull Module module) { return createModulesPlace().putPath(ModuleStructureConfigurable.TREE_OBJECT, module); }