mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote branch 'origin/master'
This commit is contained in:
@@ -2265,7 +2265,7 @@ public class CompileDriver {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void showNotSpecifiedError(@NonNls final String resourceId, List<String> modules, String tabNameToSelect) {
|
||||
private void showNotSpecifiedError(@NonNls final String resourceId, List<String> modules, String editorNameToSelect) {
|
||||
String nameToSelect = null;
|
||||
final StringBuilder names = StringBuilderSpinAllocator.alloc();
|
||||
final String message;
|
||||
@@ -2296,7 +2296,7 @@ public class CompileDriver {
|
||||
}
|
||||
|
||||
Messages.showMessageDialog(myProject, message, CommonBundle.getErrorTitle(), Messages.getErrorIcon());
|
||||
showConfigurationDialog(nameToSelect, tabNameToSelect);
|
||||
showConfigurationDialog(nameToSelect, editorNameToSelect);
|
||||
}
|
||||
|
||||
private boolean validateOutputAndSourcePathsIntersection() {
|
||||
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package com.intellij.openapi.roots.ui.configuration;
|
||||
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleConfigurationEditor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ui.navigation.Place;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @author ksafonov
|
||||
*/
|
||||
public abstract class HeaderHidingTabbedModuleEditor extends TabbedModuleEditor {
|
||||
|
||||
public HeaderHidingTabbedModuleEditor(Project project, ModulesProvider modulesProvider, @NotNull Module module) {
|
||||
super(project, modulesProvider, module);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JComponent createCenterPanel() {
|
||||
ModuleConfigurationEditor singleEditor = getSingleEditor();
|
||||
if (singleEditor != null) {
|
||||
final JComponent component = singleEditor.createComponent();
|
||||
singleEditor.reset();
|
||||
return component;
|
||||
}
|
||||
else {
|
||||
return super.createCenterPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ModuleConfigurationEditor getSingleEditor() {
|
||||
return myEditors.size() == 1 ? myEditors.get(0) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleConfigurationEditor getSelectedEditor() {
|
||||
ModuleConfigurationEditor singleEditor = getSingleEditor();
|
||||
return singleEditor != null ? singleEditor : super.getSelectedEditor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectEditor(String displayName) {
|
||||
if (displayName != null) {
|
||||
ModuleConfigurationEditor singleEditor = getSingleEditor();
|
||||
if (singleEditor != null) {
|
||||
assert singleEditor.getDisplayName().equals(displayName);
|
||||
}
|
||||
else {
|
||||
super.selectEditor(displayName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void restoreSelectedEditor() {
|
||||
ModuleConfigurationEditor singleEditor = getSingleEditor();
|
||||
if (singleEditor == null) {
|
||||
super.restoreSelectedEditor();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleConfigurationEditor getEditor(@NotNull String displayName) {
|
||||
ModuleConfigurationEditor singleEditor = getSingleEditor();
|
||||
if (singleEditor != null) {
|
||||
assert singleEditor.getDisplayName().equals(displayName);
|
||||
return singleEditor;
|
||||
}
|
||||
else {
|
||||
return super.getEditor(displayName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposeCenterPanel() {
|
||||
if (getSingleEditor() == null) {
|
||||
super.disposeCenterPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void queryPlace(@NotNull Place place) {
|
||||
ModuleConfigurationEditor singleEditor = getSingleEditor();
|
||||
if (singleEditor != null) {
|
||||
place.putPath(SELECTED_EDITOR_NAME, singleEditor.getDisplayName());
|
||||
}
|
||||
else {
|
||||
super.queryPlace(place);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -122,8 +122,8 @@ public class IdeaProjectSettingsService extends ProjectSettingsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showModuleConfigurationDialog(String moduleToSelect, String tabNameToSelect, boolean showModuleWizard) {
|
||||
ModulesConfigurator.showDialog(myProject, moduleToSelect, tabNameToSelect, showModuleWizard);
|
||||
public void showModuleConfigurationDialog(String moduleToSelect, String editorNameToSelect, boolean showModuleWizard) {
|
||||
ModulesConfigurator.showDialog(myProject, moduleToSelect, editorNameToSelect, showModuleWizard);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,8 +37,6 @@ import com.intellij.openapi.roots.impl.libraries.LibraryEx;
|
||||
import com.intellij.openapi.roots.impl.libraries.LibraryTableBase;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.roots.libraries.LibraryTable;
|
||||
import com.intellij.openapi.util.ActionCallback;
|
||||
import com.intellij.ui.TabbedPaneWrapper;
|
||||
import com.intellij.ui.navigation.History;
|
||||
import com.intellij.ui.navigation.Place;
|
||||
import com.intellij.util.EventDispatcher;
|
||||
@@ -48,7 +46,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import java.awt.*;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -65,26 +62,23 @@ import java.util.List;
|
||||
@SuppressWarnings({"AssignmentToStaticFieldFromInstanceMethod"})
|
||||
public abstract class ModuleEditor implements Place.Navigator, Disposable {
|
||||
private static final ExtensionPointName<ModuleConfigurableEP> MODULE_CONFIGURABLES = ExtensionPointName.create("com.intellij.moduleConfigurable");
|
||||
public static final String SELECTED_EDITOR_NAME = "selectedEditor";
|
||||
|
||||
public static final String MODULE_TAB = "moduleTab";
|
||||
private final Project myProject;
|
||||
private JPanel myGenericSettingsPanel;
|
||||
private ModifiableRootModel myModifiableRootModel; // important: in order to correctly update OrderEntries UI use corresponding proxy for the model
|
||||
|
||||
private static String ourSelectedTabName;
|
||||
|
||||
private TabbedPaneWrapper myTabbedPane;
|
||||
private final ModulesProvider myModulesProvider;
|
||||
private String myName;
|
||||
private final Module myModule;
|
||||
|
||||
private final List<ModuleConfigurationEditor> myEditors = new ArrayList<ModuleConfigurationEditor>();
|
||||
protected final List<ModuleConfigurationEditor> myEditors = new ArrayList<ModuleConfigurationEditor>();
|
||||
private ModifiableRootModel myModifiableRootModelProxy;
|
||||
|
||||
private final EventDispatcher<ChangeListener> myEventDispatcher = EventDispatcher.create(ChangeListener.class);
|
||||
@NonNls private static final String METHOD_COMMIT = "commit";
|
||||
|
||||
private History myHistory;
|
||||
protected History myHistory;
|
||||
|
||||
public ModuleEditor(Project project, ModulesProvider modulesProvider,
|
||||
@NotNull Module module) {
|
||||
@@ -94,7 +88,7 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
|
||||
myName = module.getName();
|
||||
}
|
||||
|
||||
public void init(final String selectedTab, History history) {
|
||||
public void init(History history) {
|
||||
myHistory = history;
|
||||
|
||||
for (ModuleConfigurationEditor each : myEditors) {
|
||||
@@ -103,11 +97,25 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
setSelectedTabName(selectedTab);
|
||||
restoreSelectedEditor();
|
||||
}
|
||||
|
||||
public abstract ProjectFacetsConfigurator getFacetsConfigurator();
|
||||
|
||||
protected abstract JComponent createCenterPanel();
|
||||
|
||||
@Nullable
|
||||
public abstract ModuleConfigurationEditor getSelectedEditor();
|
||||
|
||||
public abstract void selectEditor(String displayName);
|
||||
|
||||
protected abstract void restoreSelectedEditor();
|
||||
|
||||
@Nullable
|
||||
public abstract ModuleConfigurationEditor getEditor(@NotNull String displayName);
|
||||
|
||||
protected abstract void disposeCenterPanel();
|
||||
|
||||
public interface ChangeListener extends EventListener {
|
||||
void moduleStateChanged(ModifiableRootModel moduleRootModel);
|
||||
}
|
||||
@@ -225,52 +233,11 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
|
||||
|
||||
myGenericSettingsPanel.add(northPanel, BorderLayout.NORTH);
|
||||
|
||||
myTabbedPane = new TabbedPaneWrapper(this);
|
||||
|
||||
for (ModuleConfigurationEditor editor : myEditors) {
|
||||
myTabbedPane.addTab(editor.getDisplayName(), editor.getIcon(), editor.createComponent(), null);
|
||||
editor.reset();
|
||||
}
|
||||
setSelectedTabName(ourSelectedTabName);
|
||||
|
||||
myGenericSettingsPanel.add(myTabbedPane.getComponent(), BorderLayout.CENTER);
|
||||
myTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
ourSelectedTabName = getSelectedTabName();
|
||||
if (myHistory != null) {
|
||||
myHistory.pushQueryPlace();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
final JComponent component = createCenterPanel();
|
||||
myGenericSettingsPanel.add(component, BorderLayout.CENTER);
|
||||
return myGenericSettingsPanel;
|
||||
}
|
||||
|
||||
public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) {
|
||||
myTabbedPane.setSelectedTitle((String)place.getPath(MODULE_TAB));
|
||||
return new ActionCallback.Done();
|
||||
}
|
||||
|
||||
public void queryPlace(@NotNull final Place place) {
|
||||
place.putPath(MODULE_TAB, ourSelectedTabName);
|
||||
}
|
||||
|
||||
public static String getSelectedTab(){
|
||||
return ourSelectedTabName;
|
||||
}
|
||||
|
||||
private int getEditorTabIndex(final String editorName) {
|
||||
if (myTabbedPane != null && editorName != null) {
|
||||
final int tabCount = myTabbedPane.getTabCount();
|
||||
for (int idx = 0; idx < tabCount; idx++) {
|
||||
if (editorName.equals(myTabbedPane.getTitleAt(idx))) {
|
||||
return idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public JPanel getPanel() {
|
||||
if (myGenericSettingsPanel == null) {
|
||||
myGenericSettingsPanel = createPanel();
|
||||
@@ -310,10 +277,7 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
|
||||
|
||||
myEditors.clear();
|
||||
|
||||
if (myTabbedPane != null) {
|
||||
ourSelectedTabName = getSelectedTabName();
|
||||
myTabbedPane = null;
|
||||
}
|
||||
disposeCenterPanel();
|
||||
|
||||
if (myModifiableRootModel != null) {
|
||||
myModifiableRootModel.dispose();
|
||||
@@ -354,31 +318,6 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getSelectedTabName() {
|
||||
return myTabbedPane == null || myTabbedPane.getSelectedIndex() == -1 ? null : myTabbedPane.getTitleAt(myTabbedPane.getSelectedIndex());
|
||||
}
|
||||
|
||||
public void setSelectedTabName(@Nullable String name) {
|
||||
if (name != null) {
|
||||
getPanel();
|
||||
final int editorTabIndex = getEditorTabIndex(name);
|
||||
if (editorTabIndex >= 0 && editorTabIndex < myTabbedPane.getTabCount()) {
|
||||
myTabbedPane.setSelectedIndex(editorTabIndex);
|
||||
ourSelectedTabName = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ModuleConfigurationEditor getEditor(@NotNull String tabName) {
|
||||
int index = getEditorTabIndex(tabName);
|
||||
if (0 <= index && index < myEditors.size()) {
|
||||
return myEditors.get(index);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private class ModifiableRootModelInvocationHandler implements InvocationHandler {
|
||||
private final ModifiableRootModel myDelegateModel;
|
||||
@NonNls private final Set<String> myCheckedNames = new HashSet<String>(
|
||||
@@ -578,15 +517,11 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
|
||||
|
||||
@Nullable
|
||||
public String getHelpTopic() {
|
||||
if (myTabbedPane == null || myEditors.isEmpty()) {
|
||||
if (myEditors.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
final int selectedIdx = myTabbedPane.getSelectedIndex();
|
||||
if (selectedIdx == -1) {
|
||||
return null;
|
||||
}
|
||||
final ModuleConfigurationEditor moduleElementsEditor = myEditors.get(selectedIdx);
|
||||
return moduleElementsEditor.getHelpTopic();
|
||||
final ModuleConfigurationEditor selectedEditor = getSelectedEditor();
|
||||
return selectedEditor != null ? selectedEditor.getHelpTopic() : null;
|
||||
}
|
||||
|
||||
public void setModuleName(final String name) {
|
||||
|
||||
+3
-3
@@ -162,7 +162,7 @@ public class ModulesConfigurator implements ModulesProvider, ModuleEditor.Change
|
||||
}
|
||||
|
||||
private ModuleEditor doCreateModuleEditor(final Module module) {
|
||||
final ModuleEditor moduleEditor = new ModuleEditor(myProject, this, module) {
|
||||
final ModuleEditor moduleEditor = new HeaderHidingTabbedModuleEditor(myProject, this, module) {
|
||||
@Override
|
||||
public ProjectFacetsConfigurator getFacetsConfigurator() {
|
||||
return myFacetsConfigurator;
|
||||
@@ -548,13 +548,13 @@ public class ModulesConfigurator implements ModulesProvider, ModuleEditor.Change
|
||||
|
||||
public static boolean showDialog(Project project,
|
||||
@Nullable final String moduleToSelect,
|
||||
final String tabNameToSelect,
|
||||
@Nullable final String editorNameToSelect,
|
||||
final boolean showModuleWizard) {
|
||||
final ProjectStructureConfigurable config = ProjectStructureConfigurable.getInstance(project);
|
||||
return ShowSettingsUtil.getInstance().editConfigurable(project, config, new Runnable() {
|
||||
public void run() {
|
||||
final ModuleStructureConfigurable modulesConfig = config.getModulesConfig();
|
||||
config.select(moduleToSelect, tabNameToSelect, true).doWhenDone(new Runnable() {
|
||||
config.select(moduleToSelect, editorNameToSelect, true).doWhenDone(new Runnable() {
|
||||
public void run() {
|
||||
modulesConfig.setStartModuleWizard(showModuleWizard);
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
|
||||
+3
-3
@@ -370,12 +370,12 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se
|
||||
return navigateTo(place, requestFocus);
|
||||
}
|
||||
|
||||
public ActionCallback select(@Nullable final String moduleToSelect, String tab, final boolean requestFocus) {
|
||||
public ActionCallback select(@Nullable final String moduleToSelect, @Nullable String editorNameToSelect, final boolean requestFocus) {
|
||||
Place place = createPlaceFor(myModulesConfig);
|
||||
if (moduleToSelect != null) {
|
||||
final Module module = ModuleManager.getInstance(myProject).findModuleByName(moduleToSelect);
|
||||
assert module != null;
|
||||
place = place.putPath(ModuleStructureConfigurable.TREE_OBJECT, module).putPath(ModuleEditor.MODULE_TAB, tab);
|
||||
place = place.putPath(ModuleStructureConfigurable.TREE_OBJECT, module).putPath(ModuleEditor.SELECTED_EDITOR_NAME, editorNameToSelect);
|
||||
}
|
||||
return navigateTo(place, requestFocus);
|
||||
}
|
||||
@@ -439,7 +439,7 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se
|
||||
if (node != null) {
|
||||
ModuleConfigurable moduleConfigurable = (ModuleConfigurable)node.getConfigurable();
|
||||
ModuleEditor moduleEditor = moduleConfigurable.getModuleEditor();
|
||||
moduleEditor.setSelectedTabName(ClasspathEditor.NAME);
|
||||
moduleEditor.selectEditor(ClasspathEditor.NAME);
|
||||
if (orderEntry != null) {
|
||||
ModuleConfigurationEditor editor = moduleEditor.getEditor(ClasspathEditor.NAME);
|
||||
if (editor instanceof ClasspathEditor) {
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.intellij.openapi.roots.ui.configuration;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleConfigurationEditor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.ActionCallback;
|
||||
import com.intellij.ui.TabbedPaneWrapper;
|
||||
import com.intellij.ui.navigation.Place;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
|
||||
/**
|
||||
* @author ksafonov
|
||||
*/
|
||||
public abstract class TabbedModuleEditor extends ModuleEditor {
|
||||
|
||||
private static final String SELECTED_EDITOR_KEY = TabbedModuleEditor.class.getName() + ".selectedEditor";
|
||||
|
||||
private TabbedPaneWrapper myTabbedPane;
|
||||
|
||||
public TabbedModuleEditor(Project project, ModulesProvider modulesProvider, @NotNull Module module) {
|
||||
super(project, modulesProvider, module);
|
||||
}
|
||||
|
||||
private static String getSavedSelectedEditor() {
|
||||
return PropertiesComponent.getInstance().getValue(SELECTED_EDITOR_KEY);
|
||||
}
|
||||
|
||||
private void saveSelectedEditor() {
|
||||
final String selectedTabName = getSelectedTabName();
|
||||
if (selectedTabName != null) {
|
||||
// already disposed
|
||||
PropertiesComponent.getInstance().setValue(SELECTED_EDITOR_KEY, selectedTabName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JComponent createCenterPanel() {
|
||||
myTabbedPane = new TabbedPaneWrapper(this);
|
||||
|
||||
for (ModuleConfigurationEditor editor : myEditors) {
|
||||
myTabbedPane.addTab(editor.getDisplayName(), editor.getIcon(), editor.createComponent(), null);
|
||||
editor.reset();
|
||||
}
|
||||
restoreSelectedEditor();
|
||||
|
||||
myTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
saveSelectedEditor();
|
||||
if (myHistory != null) {
|
||||
myHistory.pushQueryPlace();
|
||||
}
|
||||
}
|
||||
});
|
||||
return myTabbedPane.getComponent();
|
||||
}
|
||||
|
||||
protected void restoreSelectedEditor() {
|
||||
selectEditor(getSavedSelectedEditor());
|
||||
}
|
||||
|
||||
public ActionCallback navigateTo(@Nullable final Place place, final boolean requestFocus) {
|
||||
if (place != null) {
|
||||
selectEditor((String)place.getPath(SELECTED_EDITOR_NAME));
|
||||
}
|
||||
return new ActionCallback.Done();
|
||||
}
|
||||
|
||||
public void queryPlace(@NotNull final Place place) {
|
||||
place.putPath(SELECTED_EDITOR_NAME, getSavedSelectedEditor());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getSelectedTabName() {
|
||||
return myTabbedPane == null || myTabbedPane.getSelectedIndex() == -1 ? null : myTabbedPane.getTitleAt(myTabbedPane.getSelectedIndex());
|
||||
}
|
||||
|
||||
public void selectEditor(@Nullable String name) {
|
||||
if (name != null) {
|
||||
getPanel();
|
||||
final int editorTabIndex = getEditorTabIndex(name);
|
||||
if (editorTabIndex >= 0 && editorTabIndex < myTabbedPane.getTabCount()) {
|
||||
myTabbedPane.setSelectedIndex(editorTabIndex);
|
||||
saveSelectedEditor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getEditorTabIndex(final String editorName) {
|
||||
if (myTabbedPane != null && editorName != null) {
|
||||
final int tabCount = myTabbedPane.getTabCount();
|
||||
for (int idx = 0; idx < tabCount; idx++) {
|
||||
if (editorName.equals(myTabbedPane.getTitleAt(idx))) {
|
||||
return idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ModuleConfigurationEditor getEditor(@NotNull String displayName) {
|
||||
int index = getEditorTabIndex(displayName);
|
||||
if (0 <= index && index < myEditors.size()) {
|
||||
return myEditors.get(index);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleConfigurationEditor getSelectedEditor() {
|
||||
if (myTabbedPane == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String title = myTabbedPane.getSelectedTitle();
|
||||
if (title == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return getEditor(title);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposeCenterPanel() {
|
||||
if (myTabbedPane != null) {
|
||||
saveSelectedEditor();
|
||||
myTabbedPane = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-11
@@ -178,8 +178,10 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
|
||||
protected void updateSelection(@Nullable final NamedConfigurable configurable) {
|
||||
FacetStructureConfigurable.getInstance(myProject).disposeMultipleSettingsEditor();
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
final String selectedTab = ModuleEditor.getSelectedTab();
|
||||
updateSelection(configurable, selectedTab);
|
||||
super.updateSelection(configurable);
|
||||
if (configurable != null) {
|
||||
updateModuleEditorSelection(configurable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,19 +193,12 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
|
||||
return FacetStructureConfigurable.getInstance(myProject).updateMultiSelection(selectedConfigurables, getDetailsComponent());
|
||||
}
|
||||
|
||||
private void updateSelection(final NamedConfigurable configurable, final String selectedTab) {
|
||||
super.updateSelection(configurable);
|
||||
if (configurable != null) {
|
||||
updateTabSelection(configurable, selectedTab);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTabSelection(final NamedConfigurable configurable, final String selectedTab) {
|
||||
private void updateModuleEditorSelection(final NamedConfigurable configurable) {
|
||||
if (configurable instanceof ModuleConfigurable){
|
||||
final ModuleConfigurable moduleConfigurable = (ModuleConfigurable)configurable;
|
||||
final ModuleEditor editor = moduleConfigurable.getModuleEditor();
|
||||
if (editor != null) { //already deleted
|
||||
editor.init(selectedTab, myHistory);
|
||||
editor.init(myHistory);
|
||||
}
|
||||
}
|
||||
if (configurable instanceof FacetConfigurable) {
|
||||
|
||||
+7
-6
@@ -21,14 +21,13 @@ import com.intellij.ide.projectView.ProjectViewNodeDecorator;
|
||||
import com.intellij.ide.projectView.ViewSettings;
|
||||
import com.intellij.ide.projectView.impl.nodes.PackageElement;
|
||||
import com.intellij.ide.util.treeView.AbstractTreeNode;
|
||||
import com.intellij.navigation.PsiElementNavigationItem;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.colors.CodeInsightColors;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vcs.FileStatusManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
@@ -38,7 +37,8 @@ import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
public abstract class BaseSmartPointerPsiNode <Type extends SmartPsiElementPointer> extends ProjectViewNode<Type> {
|
||||
public abstract class BaseSmartPointerPsiNode <Type extends SmartPsiElementPointer> extends ProjectViewNode<Type> implements
|
||||
PsiElementNavigationItem {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.ide.projectView.impl.nodes.BasePsiNode");
|
||||
|
||||
protected BaseSmartPointerPsiNode(Project project, Type value, ViewSettings viewSettings) {
|
||||
@@ -61,13 +61,14 @@ public abstract class BaseSmartPointerPsiNode <Type extends SmartPsiElementPoint
|
||||
return parentValue instanceof PsiDirectory || parentValue instanceof PackageElement;
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
@Override
|
||||
public PsiElement getTargetElement() {
|
||||
VirtualFile file = getVirtualFileForValue();
|
||||
if (file == null) {
|
||||
return FileStatus.NOT_CHANGED;
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return FileStatusManager.getInstance(getProject()).getStatus(file);
|
||||
return file.isDirectory() ? PsiManager.getInstance(getProject()).findDirectory(file) : PsiManager.getInstance(getProject()).findFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.usages.impl.rules;
|
||||
|
||||
import com.intellij.navigation.NavigationItemFileStatus;
|
||||
import com.intellij.openapi.actionSystem.DataKey;
|
||||
import com.intellij.openapi.actionSystem.DataSink;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
@@ -132,7 +133,7 @@ public class ClassGroupingRule implements UsageGroupingRule {
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return isValid() ? getPsiClass().getFileStatus() : null;
|
||||
return isValid() ? NavigationItemFileStatus.get(getPsiClass()) : null;
|
||||
}
|
||||
|
||||
private PsiClass getPsiClass() {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.usages.impl.rules;
|
||||
|
||||
import com.intellij.navigation.NavigationItemFileStatus;
|
||||
import com.intellij.openapi.actionSystem.DataKey;
|
||||
import com.intellij.openapi.actionSystem.DataSink;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
@@ -120,7 +121,7 @@ public class MethodGroupingRule implements UsageGroupingRule {
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return isValid() ? getMethod().getFileStatus() : null;
|
||||
return isValid() ? NavigationItemFileStatus.get(getMethod()) : null;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.navigation;
|
||||
|
||||
import com.intellij.ide.util.treeView.AbstractTreeNode;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vcs.FileStatusManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class NavigationItemFileStatus {
|
||||
private NavigationItemFileStatus() {
|
||||
}
|
||||
|
||||
public static FileStatus get(NavigationItem item) {
|
||||
if (item instanceof PsiElement) {
|
||||
return getPsiElementFileStatus((PsiElement)item);
|
||||
}
|
||||
if (item instanceof AbstractTreeNode) {
|
||||
return ((AbstractTreeNode) item).getFileStatus();
|
||||
}
|
||||
if (item instanceof PsiElementNavigationItem) {
|
||||
PsiElement target = ((PsiElementNavigationItem) item).getTargetElement();
|
||||
return getPsiElementFileStatus(target);
|
||||
}
|
||||
return FileStatus.NOT_CHANGED;
|
||||
}
|
||||
|
||||
private static FileStatus getPsiElementFileStatus(PsiElement psiElement) {
|
||||
if (!psiElement.isPhysical()) return FileStatus.NOT_CHANGED;
|
||||
PsiFile contFile = psiElement.getContainingFile();
|
||||
if (contFile == null) return FileStatus.NOT_CHANGED;
|
||||
VirtualFile vFile = contFile.getVirtualFile();
|
||||
return vFile != null ? FileStatusManager.getInstance(psiElement.getProject()).getStatus(vFile) : FileStatus.NOT_CHANGED;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.navigation;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public interface PsiElementNavigationItem extends NavigationItem {
|
||||
@Nullable
|
||||
PsiElement getTargetElement();
|
||||
}
|
||||
@@ -23,8 +23,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiBundle;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.search.scope.packageSet.NamedScope;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -32,7 +30,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class GlobalSearchScope extends SearchScope implements ProjectAwareFileFilter {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.psi.search.GlobalSearchScope");
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -72,7 +72,7 @@ public class LocalSearchScope extends SearchScope {
|
||||
localScope.add(element);
|
||||
}
|
||||
}
|
||||
myScope = PsiUtilBase.toPsiElementArray(localScope);
|
||||
myScope = PsiUtilCore.toPsiElementArray(localScope);
|
||||
}
|
||||
|
||||
public boolean isIgnoreInjectedPsi() {
|
||||
@@ -132,7 +132,7 @@ public class LocalSearchScope extends SearchScope {
|
||||
}
|
||||
}
|
||||
}
|
||||
return new LocalSearchScope(PsiUtilBase.toPsiElementArray(result), null, scope1.myIgnoreInjectedPsi || scope2.myIgnoreInjectedPsi);
|
||||
return new LocalSearchScope(PsiUtilCore.toPsiElementArray(result), null, scope1.myIgnoreInjectedPsi || scope2.myIgnoreInjectedPsi);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -197,7 +197,7 @@ public class LocalSearchScope extends SearchScope {
|
||||
result.add(elements2[i]);
|
||||
}
|
||||
}
|
||||
return new LocalSearchScope(PsiUtilBase.toPsiElementArray(result));
|
||||
return new LocalSearchScope(PsiUtilCore.toPsiElementArray(result));
|
||||
}
|
||||
|
||||
private static PsiElement scopeElementsUnion(PsiElement element1, PsiElement element2) {
|
||||
|
||||
@@ -19,101 +19,17 @@
|
||||
*/
|
||||
package com.intellij.psi.search;
|
||||
|
||||
import com.intellij.injected.editor.VirtualFileWindow;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiBundle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class ProjectScopeBuilder {
|
||||
private Project myProject;
|
||||
|
||||
public ProjectScopeBuilder(Project project) {
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
public GlobalSearchScope buildLibrariesScope() {
|
||||
return new ProjectAndLibrariesScope(myProject) {
|
||||
@Override
|
||||
public boolean contains(VirtualFile file) {
|
||||
return myProjectFileIndex.isInLibrarySource(file) || myProjectFileIndex.isInLibraryClasses(file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSearchInModuleContent(@NotNull Module aModule) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public abstract class ProjectScopeBuilder {
|
||||
public static ProjectScopeBuilder getInstance(Project project) {
|
||||
return ServiceManager.getService(project, ProjectScopeBuilder.class);
|
||||
}
|
||||
|
||||
public GlobalSearchScope buildAllScope() {
|
||||
final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(myProject);
|
||||
return projectRootManager == null ? new EverythingGlobalScope(myProject) : new ProjectAndLibrariesScope(myProject);
|
||||
}
|
||||
public abstract GlobalSearchScope buildLibrariesScope();
|
||||
|
||||
public GlobalSearchScope buildProjectScope() {
|
||||
final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(myProject);
|
||||
if (projectRootManager == null) {
|
||||
return new EverythingGlobalScope(myProject) {
|
||||
public boolean isSearchInLibraries() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
else {
|
||||
return new GlobalSearchScope(myProject) {
|
||||
private final ProjectFileIndex myFileIndex = projectRootManager.getFileIndex();
|
||||
public abstract GlobalSearchScope buildAllScope();
|
||||
|
||||
public boolean contains(VirtualFile file) {
|
||||
if (file instanceof VirtualFileWindow) return true;
|
||||
|
||||
if (myFileIndex.isInLibraryClasses(file) && !myFileIndex.isInSourceContent(file)) return false;
|
||||
|
||||
return myFileIndex.isInContent(file);
|
||||
}
|
||||
|
||||
public int compare(VirtualFile file1, VirtualFile file2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean isSearchInModuleContent(@NotNull Module aModule) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isSearchInLibraries() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return PsiBundle.message("psi.search.scope.project");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope uniteWith(@NotNull GlobalSearchScope scope) {
|
||||
if (scope == this || !scope.isSearchInLibraries() || !scope.isSearchOutsideRootModel()) return this;
|
||||
return super.uniteWith(scope);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GlobalSearchScope intersectWith(@NotNull GlobalSearchScope scope) {
|
||||
if (scope == this) return this;
|
||||
if (!scope.isSearchInLibraries()) return scope;
|
||||
return super.intersectWith(scope);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
public abstract GlobalSearchScope buildProjectScope();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ package com.intellij.psi.search;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.PsiElementFilter;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -50,7 +50,7 @@ public interface PsiElementProcessor<T extends PsiElement> {
|
||||
}
|
||||
|
||||
public PsiElement[] toArray() {
|
||||
return PsiUtilBase.toPsiElementArray(myCollection);
|
||||
return PsiUtilCore.toPsiElementArray(myCollection);
|
||||
}
|
||||
|
||||
public Collection<T> getCollection() {
|
||||
|
||||
@@ -877,7 +877,7 @@ public class PsiTreeUtil {
|
||||
}
|
||||
}
|
||||
|
||||
return PsiUtilBase.toPsiElementArray(filteredElements);
|
||||
return PsiUtilCore.toPsiElementArray(filteredElements);
|
||||
}
|
||||
|
||||
public static boolean treeWalkUp(@NotNull final PsiScopeProcessor processor,
|
||||
|
||||
@@ -51,7 +51,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
import java.util.Collection;
|
||||
|
||||
public class PsiUtilBase {
|
||||
public class PsiUtilBase extends PsiUtilCore {
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
public static final PsiElement NULL_PSI_ELEMENT = new PsiElement() {
|
||||
@NotNull
|
||||
@@ -622,12 +622,6 @@ public class PsiUtilBase {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static PsiElement[] toPsiElementArray(@NotNull Collection<? extends PsiElement> collection) {
|
||||
if (collection.isEmpty()) return PsiElement.EMPTY_ARRAY;
|
||||
return collection.toArray(new PsiElement[collection.size()]);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static PsiFile[] toPsiFileArray(@NotNull Collection<? extends PsiFile> collection) {
|
||||
if (collection.isEmpty()) return PsiFile.EMPTY_ARRAY;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.util;
|
||||
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class PsiUtilCore {
|
||||
@NotNull
|
||||
public static PsiElement[] toPsiElementArray(@NotNull Collection<? extends PsiElement> collection) {
|
||||
if (collection.isEmpty()) return PsiElement.EMPTY_ARRAY;
|
||||
return collection.toArray(new PsiElement[collection.size()]);
|
||||
}
|
||||
}
|
||||
@@ -215,10 +215,6 @@ public abstract class PsiElementBase extends ElementBase implements NavigatableP
|
||||
return descriptor != null && descriptor.canNavigateToSource();
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return SharedImplUtil.getFileStatus(this);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected <T> T[] findChildrenByClass(Class<T> aClass) {
|
||||
List<T> result = new ArrayList<T>();
|
||||
|
||||
+5
-4
@@ -19,6 +19,7 @@ package com.intellij.find.findUsages;
|
||||
import com.intellij.codeInsight.highlighting.HighlightUsagesHandler;
|
||||
import com.intellij.find.FindManager;
|
||||
import com.intellij.find.impl.FindManagerImpl;
|
||||
import com.intellij.navigation.PsiElementNavigationItem;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.openapi.actionSystem.DataKey;
|
||||
@@ -27,7 +28,6 @@ import com.intellij.openapi.actionSystem.TypeSafeDataProvider;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.fileEditor.FileEditor;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
@@ -51,7 +51,7 @@ import java.util.Collection;
|
||||
/**
|
||||
* @author max
|
||||
*/
|
||||
public class PsiElement2UsageTargetAdapter implements PsiElementUsageTarget, TypeSafeDataProvider {
|
||||
public class PsiElement2UsageTargetAdapter implements PsiElementUsageTarget, TypeSafeDataProvider, PsiElementNavigationItem {
|
||||
private final SmartPsiElementPointer myPointer;
|
||||
private final MyItemPresentation myPresentation;
|
||||
|
||||
@@ -90,8 +90,9 @@ public class PsiElement2UsageTargetAdapter implements PsiElementUsageTarget, Typ
|
||||
return (NavigationItem)getElement();
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return isValid() ? getNavigationItem().getFileStatus() : FileStatus.NOT_CHANGED;
|
||||
@Override
|
||||
public PsiElement getTargetElement() {
|
||||
return getElement();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
@@ -707,10 +707,6 @@ public class FindInProjectUtil {
|
||||
return myItemPresentation;
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return FileStatus.NOT_CHANGED;
|
||||
}
|
||||
|
||||
public void navigate(boolean requestFocus) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.ide.util.treeView.NodeRenderer;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.navigation.NavigationItemFileStatus;
|
||||
import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager;
|
||||
@@ -143,7 +144,7 @@ public class NavigationItemListCellRenderer extends OpaquePanel implements ListC
|
||||
}
|
||||
}
|
||||
|
||||
FileStatus status = element.getFileStatus();
|
||||
FileStatus status = NavigationItemFileStatus.get(element);
|
||||
if (status != FileStatus.NOT_CHANGED) {
|
||||
color = status.getColor();
|
||||
}
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ public class ProjectSettingsService {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void showModuleConfigurationDialog(@Nullable String moduleToSelect, @Nullable String tabNameToSelect, boolean showModuleWizard) {
|
||||
public void showModuleConfigurationDialog(@Nullable String moduleToSelect, @Nullable String editorNameToSelect, boolean showModuleWizard) {
|
||||
}
|
||||
|
||||
public Sdk chooseAndSetSdk() {
|
||||
|
||||
+2
-1
@@ -250,7 +250,8 @@ public class ProjectSdksModel implements SdkModel {
|
||||
doAdd((ProjectJdkImpl) sdk, null);
|
||||
}
|
||||
|
||||
private void doAdd(ProjectJdkImpl newSdk, @Nullable Consumer<Sdk> updateTree) {
|
||||
public void doAdd(ProjectJdkImpl newSdk, @Nullable Consumer<Sdk> updateTree) {
|
||||
myModified = true;
|
||||
myProjectSdks.put(newSdk, newSdk);
|
||||
if (updateTree != null) {
|
||||
updateTree.consume(newSdk);
|
||||
|
||||
@@ -148,10 +148,6 @@ public abstract class PsiElementBase extends ElementBase implements PsiElement {
|
||||
return null;
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return FileStatus.NOT_CHANGED;
|
||||
}
|
||||
|
||||
public boolean isEquivalentTo(final PsiElement another) {
|
||||
return this == another;
|
||||
}
|
||||
|
||||
@@ -557,10 +557,6 @@ public class PsiDirectoryImpl extends PsiElementBase implements PsiDirectory, Qu
|
||||
ProjectViewSelectInTarget.select(getProject(), this, ProjectViewPane.ID, null, getVirtualFile(), requestFocus);
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return myFile != null ? FileStatusManager.getInstance(getProject()).getStatus(myFile) : FileStatus.NOT_CHANGED;
|
||||
}
|
||||
|
||||
protected Icon getElementIcon(final int flags) {
|
||||
return PlatformIcons.DIRECTORY_CLOSED_ICON;
|
||||
}
|
||||
|
||||
@@ -24,13 +24,11 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.*;
|
||||
import com.intellij.psi.impl.file.PsiFileImplUtil;
|
||||
import com.intellij.psi.impl.source.resolve.FileContextUtil;
|
||||
import com.intellij.psi.impl.source.tree.SharedImplUtil;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
@@ -215,10 +213,6 @@ public abstract class LightPsiFileImpl extends PsiElementBase implements PsiFile
|
||||
return ((PsiManagerEx) getManager()).getFileManager().getUseScope(this);
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return SharedImplUtil.getFileStatus(this);
|
||||
}
|
||||
|
||||
public void navigate(boolean requestFocus) {
|
||||
EditSourceUtil.getDescriptor(this).navigate(requestFocus);
|
||||
}
|
||||
|
||||
@@ -862,10 +862,6 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF
|
||||
return canNavigate();
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return SharedImplUtil.getFileStatus(this);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Project getProject() {
|
||||
final PsiManager manager = getManager();
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.CheckUtil;
|
||||
import com.intellij.psi.impl.SharedPsiElementImplUtil;
|
||||
@@ -241,10 +240,6 @@ public abstract class CompositePsiElement extends CompositeElement implements Ps
|
||||
return canNavigate();
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return SharedImplUtil.getFileStatus(this);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Project getProject() {
|
||||
final PsiManager manager = getManager();
|
||||
|
||||
@@ -269,10 +269,6 @@ public class LazyParseablePsiElement extends LazyParseableElement implements Psi
|
||||
return canNavigate();
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return SharedImplUtil.getFileStatus(this);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Project getProject() {
|
||||
final PsiManager manager = getManager();
|
||||
|
||||
@@ -268,10 +268,6 @@ public class LeafPsiElement extends LeafElement implements PsiElement, Navigatio
|
||||
return canNavigate();
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return SharedImplUtil.getFileStatus(this);
|
||||
}
|
||||
|
||||
public boolean isEquivalentTo(final PsiElement another) {
|
||||
return this == another;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi.search;
|
||||
|
||||
import com.intellij.injected.editor.VirtualFileWindow;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectFileIndex;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiBundle;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class ProjectScopeBuilderImpl extends ProjectScopeBuilder {
|
||||
private Project myProject;
|
||||
|
||||
public ProjectScopeBuilderImpl(Project project) {
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope buildLibrariesScope() {
|
||||
return new ProjectAndLibrariesScope(myProject) {
|
||||
@Override
|
||||
public boolean contains(VirtualFile file) {
|
||||
return myProjectFileIndex.isInLibrarySource(file) || myProjectFileIndex.isInLibraryClasses(file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSearchInModuleContent(@NotNull Module aModule) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope buildAllScope() {
|
||||
final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(myProject);
|
||||
return projectRootManager == null ? new EverythingGlobalScope(myProject) : new ProjectAndLibrariesScope(myProject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope buildProjectScope() {
|
||||
final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(myProject);
|
||||
if (projectRootManager == null) {
|
||||
return new EverythingGlobalScope(myProject) {
|
||||
public boolean isSearchInLibraries() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
else {
|
||||
return new GlobalSearchScope(myProject) {
|
||||
private final ProjectFileIndex myFileIndex = projectRootManager.getFileIndex();
|
||||
|
||||
public boolean contains(VirtualFile file) {
|
||||
if (file instanceof VirtualFileWindow) return true;
|
||||
|
||||
if (myFileIndex.isInLibraryClasses(file) && !myFileIndex.isInSourceContent(file)) return false;
|
||||
|
||||
return myFileIndex.isInContent(file);
|
||||
}
|
||||
|
||||
public int compare(VirtualFile file1, VirtualFile file2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean isSearchInModuleContent(@NotNull Module aModule) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isSearchInLibraries() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return PsiBundle.message("psi.search.scope.project");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope uniteWith(@NotNull GlobalSearchScope scope) {
|
||||
if (scope == this || !scope.isSearchInLibraries() || !scope.isSearchOutsideRootModel()) return this;
|
||||
return super.uniteWith(scope);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public GlobalSearchScope intersectWith(@NotNull GlobalSearchScope scope) {
|
||||
if (scope == this) return this;
|
||||
if (!scope.isSearchInLibraries()) return scope;
|
||||
return super.intersectWith(scope);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.navigation;
|
||||
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.pom.Navigatable;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -25,5 +24,4 @@ public interface NavigationItem extends Navigatable {
|
||||
String getName();
|
||||
@Nullable
|
||||
ItemPresentation getPresentation();
|
||||
FileStatus getFileStatus();
|
||||
}
|
||||
@@ -15,10 +15,6 @@
|
||||
*/
|
||||
package com.intellij.pom;
|
||||
|
||||
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
|
||||
public interface Navigatable {
|
||||
/**
|
||||
* Open editor and select/navigate to the object there if possible.
|
||||
@@ -38,29 +34,4 @@ public interface Navigatable {
|
||||
* Source means some kind of editor
|
||||
*/
|
||||
boolean canNavigateToSource();
|
||||
|
||||
/**
|
||||
* Very often both methods <code>canNavigate</code> and <code>canNavigateToSource</code>
|
||||
* return <code>true</code>. This adapter class lets focus on navigation
|
||||
* routine only.
|
||||
*
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
abstract class Adapter implements Navigatable {
|
||||
public boolean canNavigate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean canNavigateToSource() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void navigate(Project project, VirtualFile file, boolean requestFocus) {
|
||||
navigate(project, file, 0, requestFocus);
|
||||
}
|
||||
|
||||
public static void navigate(Project project, VirtualFile file, int offset, boolean requestFocus) {
|
||||
new OpenFileDescriptor(project, file, offset).navigate(requestFocus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.pom;
|
||||
|
||||
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
|
||||
/**
|
||||
* Very often both methods <code>canNavigate</code> and <code>canNavigateToSource</code>
|
||||
* return <code>true</code>. This adapter class lets focus on navigation
|
||||
* routine only.
|
||||
*
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public abstract class NavigatableAdapter implements Navigatable {
|
||||
public boolean canNavigate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean canNavigateToSource() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void navigate(Project project, VirtualFile file, boolean requestFocus) {
|
||||
navigate(project, file, 0, requestFocus);
|
||||
}
|
||||
|
||||
public static void navigate(Project project, VirtualFile file, int offset, boolean requestFocus) {
|
||||
new OpenFileDescriptor(project, file, offset).navigate(requestFocus);
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ import com.intellij.openapi.editor.markup.RangeHighlighter;
|
||||
import com.intellij.openapi.editor.markup.TextAttributes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.pom.Navigatable;
|
||||
import com.intellij.pom.NavigatableAdapter;
|
||||
import com.intellij.util.BeforeAfter;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.SmartList;
|
||||
@@ -319,7 +319,7 @@ public class EditorHyperlinkSupport {
|
||||
int newIndex = ranges.isEmpty() ? -1 : i == ranges.size() ? 0 : (i + delta + ranges.size()) % ranges.size();
|
||||
final RangeHighlighter next = newIndex < ranges.size() && newIndex >= 0 ? ranges.get(newIndex) : null;
|
||||
if (next == null) return null;
|
||||
return new OccurenceNavigator.OccurenceInfo(new Navigatable.Adapter() {
|
||||
return new OccurenceNavigator.OccurenceInfo(new NavigatableAdapter() {
|
||||
public void navigate(final boolean requestFocus) {
|
||||
action.consume(next);
|
||||
linkFollowed(editor, ranges, next);
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
serviceImplementation="com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable"/>
|
||||
|
||||
<projectService serviceInterface="com.intellij.psi.search.ProjectScopeBuilder"
|
||||
serviceImplementation="com.intellij.psi.search.ProjectScopeBuilder"/>
|
||||
serviceImplementation="com.intellij.psi.search.ProjectScopeBuilderImpl"/>
|
||||
|
||||
<projectService serviceInterface="com.intellij.facet.ProjectWideFacetListenersRegistry"
|
||||
serviceImplementation="com.intellij.facet.impl.ProjectWideFacetListenersRegistryImpl"/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.intellij.usages;
|
||||
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.navigation.NavigationItemFileStatus;
|
||||
import com.intellij.openapi.actionSystem.DataKey;
|
||||
import com.intellij.openapi.actionSystem.DataSink;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
@@ -10,7 +11,6 @@ import com.intellij.psi.PsiNamedElement;
|
||||
import com.intellij.psi.SmartPointerManager;
|
||||
import com.intellij.psi.SmartPsiElementPointer;
|
||||
import com.intellij.usageView.UsageInfo;
|
||||
import com.intellij.usages.impl.rules.FileGroupingRule;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -50,7 +50,7 @@ public class PsiNamedElementUsageGroupBase<T extends PsiNamedElement & Navigatio
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return isValid() ? getElement().getFileStatus() : null;
|
||||
return isValid() ? NavigationItemFileStatus.get(getElement()) : null;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
|
||||
+2
-1
@@ -48,6 +48,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.ToolWindow;
|
||||
import com.intellij.openapi.wm.ToolWindowManager;
|
||||
import com.intellij.pom.Navigatable;
|
||||
import com.intellij.pom.NavigatableAdapter;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.ui.content.ContentFactory;
|
||||
@@ -318,7 +319,7 @@ public class ShelvedChangesViewManager implements ProjectComponent {
|
||||
}
|
||||
for (final ShelvedChange shelvedChange : shelvedChanges) {
|
||||
if (shelvedChange.getBeforePath() != null && ! FileStatus.ADDED.equals(shelvedChange.getFileStatus())) {
|
||||
final Navigatable.Adapter navigatable = new Navigatable.Adapter() {
|
||||
final NavigatableAdapter navigatable = new NavigatableAdapter() {
|
||||
@Override
|
||||
public void navigate(boolean requestFocus) {
|
||||
final VirtualFile vf = shelvedChange.getBeforeVFUnderProject(myProject);
|
||||
|
||||
+7
-6
@@ -19,12 +19,12 @@ package org.jetbrains.android.dom.wrappers;
|
||||
import com.intellij.lang.FileASTNode;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.PsiElementNavigationItem;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.scope.PsiScopeProcessor;
|
||||
@@ -45,7 +45,7 @@ import javax.swing.*;
|
||||
* Time: 10:06:22 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class FileResourceElementWrapper implements PsiFile, ResourceElementWrapper {
|
||||
public class FileResourceElementWrapper implements PsiFile, ResourceElementWrapper, PsiElementNavigationItem {
|
||||
private final PsiFile myWrappee;
|
||||
private final PsiDirectory myResourceDir;
|
||||
|
||||
@@ -377,10 +377,6 @@ public class FileResourceElementWrapper implements PsiFile, ResourceElementWrapp
|
||||
};
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return myWrappee.getFileStatus();
|
||||
}
|
||||
|
||||
public void navigate(boolean requestFocus) {
|
||||
myWrappee.navigate(requestFocus);
|
||||
}
|
||||
@@ -396,4 +392,9 @@ public class FileResourceElementWrapper implements PsiFile, ResourceElementWrapp
|
||||
public void checkSetName(String name) throws IncorrectOperationException {
|
||||
myWrappee.checkSetName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiElement getTargetElement() {
|
||||
return myWrappee;
|
||||
}
|
||||
}
|
||||
|
||||
+10
-9
@@ -18,28 +18,28 @@ package org.jetbrains.android.dom.wrappers;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.navigation.PsiElementNavigationItem;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.meta.PsiMetaOwner;
|
||||
import com.intellij.psi.scope.PsiScopeProcessor;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.PsiElementProcessor;
|
||||
import com.intellij.psi.search.SearchScope;
|
||||
import com.intellij.psi.xml.XmlAttributeValue;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
import com.intellij.psi.xml.XmlAttributeValue;
|
||||
import com.intellij.psi.xml.XmlTag;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.xml.DomElement;
|
||||
import com.intellij.util.xml.DomManager;
|
||||
import org.jetbrains.android.util.AndroidResourceUtil;
|
||||
import org.jetbrains.android.dom.resources.ResourceElement;
|
||||
import org.jetbrains.android.util.AndroidResourceUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -53,7 +53,7 @@ import javax.swing.*;
|
||||
* Time: 7:08:02 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class ValueResourceElementWrapper implements XmlAttributeValue, ResourceElementWrapper, PsiNamedElement {
|
||||
public class ValueResourceElementWrapper implements XmlAttributeValue, ResourceElementWrapper, PsiNamedElement, PsiElementNavigationItem {
|
||||
private final XmlAttributeValue myWrappee;
|
||||
private final PsiDirectory myResourceDir;
|
||||
|
||||
@@ -381,10 +381,6 @@ public class ValueResourceElementWrapper implements XmlAttributeValue, ResourceE
|
||||
};
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return ((NavigationItem)myWrappee).getFileStatus();
|
||||
}
|
||||
|
||||
public void navigate(boolean requestFocus) {
|
||||
((NavigationItem)myWrappee).navigate(requestFocus);
|
||||
}
|
||||
@@ -408,4 +404,9 @@ public class ValueResourceElementWrapper implements XmlAttributeValue, ResourceE
|
||||
public boolean processElements(PsiElementProcessor processor, PsiElement place) {
|
||||
return myWrappee.processElements(processor, place);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiElement getTargetElement() {
|
||||
return getWrappee();
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -1,11 +1,14 @@
|
||||
package org.jetbrains.plugins.groovy.extensions;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.util.xmlb.annotations.AbstractCollection;
|
||||
import com.intellij.util.xmlb.annotations.Attribute;
|
||||
import com.intellij.util.xmlb.annotations.Property;
|
||||
import com.intellij.util.xmlb.annotations.Tag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrCall;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -41,6 +44,9 @@ public class GroovyMethodDescriptor {
|
||||
@Attribute("namedArgs")
|
||||
public String namedArgs;
|
||||
|
||||
@Attribute("namedArgsProvider")
|
||||
public String namedArgsProvider;
|
||||
|
||||
@Attribute("namedArgsShowFirst")
|
||||
public Boolean isNamedArgsShowFirst;
|
||||
|
||||
@@ -91,6 +97,8 @@ public class GroovyMethodDescriptor {
|
||||
return null;
|
||||
}
|
||||
|
||||
assert namedArgsProvider == null;
|
||||
|
||||
Map<String, GroovyNamedArgumentProvider.ArgumentDescriptor> res =
|
||||
new HashMap<String, GroovyNamedArgumentProvider.ArgumentDescriptor>();
|
||||
|
||||
@@ -148,4 +156,7 @@ public class GroovyMethodDescriptor {
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
public interface NamedArgumentProvider {
|
||||
void collectNamedArguments(Map<String, GroovyNamedArgumentProvider.ArgumentDescriptor> res, @NotNull GrCall callExpression, @NotNull PsiMethod method);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.intellij.psi.PsiParameter;
|
||||
import com.intellij.psi.PsiParameterList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrCall;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.TypesUtil;
|
||||
|
||||
import java.util.*;
|
||||
@@ -23,6 +24,9 @@ public class GroovyMethodInfo {
|
||||
|
||||
private Map<String, GroovyNamedArgumentProvider.ArgumentDescriptor> myNamedArguments;
|
||||
|
||||
private GroovyMethodDescriptor.NamedArgumentProvider myNamedArgProviderInstance;
|
||||
private String myNamedArgProviderClassName;
|
||||
|
||||
public static Map<String, Map<String, List<GroovyMethodInfo>>> getMethodMap() {
|
||||
Map<String, Map<String, List<GroovyMethodInfo>>> res = MAP;
|
||||
|
||||
@@ -97,9 +101,14 @@ public class GroovyMethodInfo {
|
||||
|
||||
Map<String, GroovyNamedArgumentProvider.ArgumentDescriptor> namedArgumentsMap = method.getArgumentsMap();
|
||||
if (namedArgumentsMap != null) {
|
||||
assert info.myNamedArguments == null;
|
||||
assert !info.isProvideNamedArguments();
|
||||
info.myNamedArguments = namedArgumentsMap;
|
||||
}
|
||||
|
||||
if (method.namedArgsProvider != null) {
|
||||
assert !info.isProvideNamedArguments();
|
||||
info.myNamedArgProviderClassName = method.namedArgsProvider;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -107,9 +116,26 @@ public class GroovyMethodInfo {
|
||||
return myReturnType;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Map<String, GroovyNamedArgumentProvider.ArgumentDescriptor> getNamedArguments() {
|
||||
return myNamedArguments;
|
||||
public void addNamedArguments(Map<String, GroovyNamedArgumentProvider.ArgumentDescriptor> res, @NotNull GrCall call, @NotNull PsiMethod method) {
|
||||
if (myNamedArguments != null) {
|
||||
res.putAll(myNamedArguments);
|
||||
}
|
||||
else if (myNamedArgProviderClassName != null) {
|
||||
if (myNamedArgProviderInstance == null) {
|
||||
try {
|
||||
myNamedArgProviderInstance = (GroovyMethodDescriptor.NamedArgumentProvider)Class.forName(myNamedArgProviderClassName).newInstance();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
myNamedArgProviderInstance.collectNamedArguments(res, call, method);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isProvideNamedArguments() {
|
||||
return myNamedArguments != null || myNamedArgProviderClassName != null;
|
||||
}
|
||||
|
||||
public boolean isApplicable(@NotNull PsiMethod method) {
|
||||
|
||||
+5
-6
@@ -90,7 +90,7 @@ public abstract class GroovyNamedArgumentProvider {
|
||||
|
||||
if (!method.isConstructor() && !canBeMap(parameters[0])) continue;
|
||||
|
||||
collectVariantsFromSimpleDescriptors(namedArguments, method);
|
||||
collectVariantsFromSimpleDescriptors(namedArguments, call, method);
|
||||
}
|
||||
|
||||
for (GroovyNamedArgumentProvider namedArgumentProvider : EP_NAME.getExtensions()) {
|
||||
@@ -102,11 +102,10 @@ public abstract class GroovyNamedArgumentProvider {
|
||||
return namedArguments;
|
||||
}
|
||||
|
||||
private static void collectVariantsFromSimpleDescriptors(Map<String, ArgumentDescriptor> res, PsiMethod method) {
|
||||
private static void collectVariantsFromSimpleDescriptors(Map<String, ArgumentDescriptor> res, @NotNull GrCall call, @NotNull PsiMethod method) {
|
||||
for (GroovyMethodInfo methodInfo : GroovyMethodInfo.getInfos(method)) {
|
||||
Map<String, ArgumentDescriptor> namedArguments = methodInfo.getNamedArguments();
|
||||
if (namedArguments != null && methodInfo.isApplicable(method)) {
|
||||
res.putAll(namedArguments);
|
||||
if (methodInfo.isProvideNamedArguments() && methodInfo.isApplicable(method)) {
|
||||
methodInfo.addNamedArguments(res, call, method);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -253,7 +252,7 @@ public abstract class GroovyNamedArgumentProvider {
|
||||
}
|
||||
}
|
||||
|
||||
protected static class TypeCondition extends ArgumentDescriptor {
|
||||
public static class TypeCondition extends ArgumentDescriptor {
|
||||
private final PsiType myType;
|
||||
|
||||
public TypeCondition(PsiType type, PsiElement navigationElement) {
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@ package org.jetbrains.plugins.groovy.lang.psi.impl.synthetic;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.light.LightIdentifier;
|
||||
import com.intellij.psi.impl.light.LightVariableBase;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -25,7 +24,7 @@ public class GrImplicitVariableImpl extends LightVariableBase implements GrImpli
|
||||
|
||||
@Override
|
||||
protected PsiModifierList createModifierList() {
|
||||
return new GrLightModifierList(this, ArrayUtil.EMPTY_STRING_ARRAY);
|
||||
return new GrLightModifierList(this);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
+12
-10
@@ -78,7 +78,7 @@ public class GrLightMethodBuilder extends LightElement implements GrMethod {
|
||||
super(manager, GroovyFileType.GROOVY_LANGUAGE);
|
||||
myName = name;
|
||||
myParameterList = parameterList;
|
||||
myModifierList = modifierList == null ? new GrLightModifierList(this, ArrayUtil.EMPTY_STRING_ARRAY) : modifierList;
|
||||
myModifierList = modifierList == null ? new GrLightModifierList(this) : modifierList;
|
||||
}
|
||||
|
||||
public void setNamedParametersArray(@NotNull String[] namedParametersArray) {
|
||||
@@ -159,21 +159,23 @@ public class GrLightMethodBuilder extends LightElement implements GrMethod {
|
||||
return myNamedParametersArray;
|
||||
}
|
||||
|
||||
public GrLightMethodBuilder addModifiers(String... modifiers) {
|
||||
for (String modifier : modifiers) {
|
||||
addModifier(modifier);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public GrLightMethodBuilder addModifier(String modifier) {
|
||||
((GrLightModifierList)myModifierList).addModifier(modifier);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GrLightMethodBuilder addModifier(int modifier) {
|
||||
((GrLightModifierList)myModifierList).addModifier(modifier);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GrLightMethodBuilder setModifiers(String[] modifiers) {
|
||||
((GrLightModifierList)myModifierList).clearModifiers();
|
||||
addModifiers(modifiers);
|
||||
((GrLightModifierList)myModifierList).setModifiers(modifiers);
|
||||
return this;
|
||||
}
|
||||
|
||||
public GrLightMethodBuilder setModifiers(int modifiers) {
|
||||
((GrLightModifierList)myModifierList).setModifiers(modifiers);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
+19
-17
@@ -17,28 +17,23 @@ package org.jetbrains.plugins.groovy.lang.psi.impl.synthetic;
|
||||
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.light.LightElement;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifierFlags;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifierList;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.annotation.GrAnnotation;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.auxiliary.modifiers.GrModifierListImpl;
|
||||
|
||||
public class GrLightModifierList extends LightElement implements GrModifierList {
|
||||
|
||||
public static final String[] PUBLIC_STATIC = {PsiModifier.PUBLIC, PsiModifier.STATIC};
|
||||
public static final String[] PRIVATE_STATIC_FINAL = {PsiModifier.PRIVATE, PsiModifier.STATIC, PsiModifier.FINAL};
|
||||
public static final String[] PRIVATE = {PsiModifier.PRIVATE};
|
||||
|
||||
private String[] myModifiers;
|
||||
private int myModifiers;
|
||||
|
||||
private final PsiElement myParent;
|
||||
|
||||
public GrLightModifierList(@NotNull PsiElement parent, @NotNull String[] modifiers) {
|
||||
public GrLightModifierList(@NotNull PsiElement parent) {
|
||||
super(parent.getManager(), parent.getLanguage());
|
||||
myModifiers = modifiers;
|
||||
myParent = parent;
|
||||
}
|
||||
|
||||
@@ -48,15 +43,25 @@ public class GrLightModifierList extends LightElement implements GrModifierList
|
||||
}
|
||||
|
||||
public void addModifier(String modifier) {
|
||||
myModifiers = ArrayUtil.append(myModifiers, modifier, ArrayUtil.STRING_ARRAY_FACTORY);
|
||||
int code = GrModifierListImpl.NAME_TO_MODIFIER_FLAG_MAP.get(modifier);
|
||||
assert code != 0;
|
||||
myModifiers |= code;
|
||||
}
|
||||
|
||||
public void setModifiers(String[] modifiers) {
|
||||
public void addModifier(int modifier) {
|
||||
myModifiers |= modifier;
|
||||
}
|
||||
|
||||
public void setModifiers(int modifiers) {
|
||||
myModifiers = modifiers;
|
||||
}
|
||||
|
||||
public void clearModifiers() {
|
||||
myModifiers = ArrayUtil.EMPTY_STRING_ARRAY;
|
||||
public void setModifiers(String[] modifiers) {
|
||||
myModifiers = 0;
|
||||
|
||||
for (String modifier : modifiers) {
|
||||
addModifier(modifier);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasModifierProperty(@NotNull String name){
|
||||
@@ -64,7 +69,7 @@ public class GrLightModifierList extends LightElement implements GrModifierList
|
||||
}
|
||||
|
||||
public boolean hasExplicitModifier(@NotNull String name) {
|
||||
return ArrayUtil.contains(name, myModifiers);
|
||||
return (myModifiers & GrModifierListImpl.NAME_TO_MODIFIER_FLAG_MAP.get(name)) != 0;
|
||||
}
|
||||
|
||||
public void setModifierProperty(@NotNull String name, boolean value) throws IncorrectOperationException{
|
||||
@@ -114,10 +119,7 @@ public class GrLightModifierList extends LightElement implements GrModifierList
|
||||
|
||||
@Override
|
||||
public boolean hasExplicitVisibilityModifiers() {
|
||||
for (String modifier : myModifiers) {
|
||||
if (modifier.equals(PsiModifier.PRIVATE) || modifier.equals(PsiModifier.PUBLIC) || modifier.equals(PsiModifier.PROTECTED)) return true;
|
||||
}
|
||||
return false;
|
||||
return (myModifiers & (GrModifierFlags.PUBLIC_MASK | GrModifierFlags.PRIVATE_MASK | GrModifierFlags.PROTECTED_MASK)) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-3
@@ -17,7 +17,6 @@ package org.jetbrains.plugins.groovy.lang.psi.impl.synthetic;
|
||||
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.light.LightVariableBuilder;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -41,7 +40,7 @@ public class GrLightParameter extends LightVariableBuilder<GrLightParameter> imp
|
||||
public GrLightParameter(@Nullable String name, @NotNull PsiType type, @NotNull PsiElement scope) {
|
||||
super(scope.getManager(), name, type, GroovyFileType.GROOVY_LANGUAGE);
|
||||
myScope = scope;
|
||||
myModifierList = new GrLightModifierList(this, ArrayUtil.EMPTY_STRING_ARRAY);
|
||||
myModifierList = new GrLightModifierList(this);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -128,7 +127,9 @@ public class GrLightParameter extends LightVariableBuilder<GrLightParameter> imp
|
||||
|
||||
@Override
|
||||
public GrLightParameter setModifiers(String... modifiers) {
|
||||
myModifierList = new GrLightModifierList(getContext(), modifiers);
|
||||
GrLightModifierList modifiersList = new GrLightModifierList(getContext());
|
||||
modifiersList.setModifiers(modifiers);
|
||||
myModifierList = modifiersList;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.intellij.openapi.roots.OrderEnumerator;
|
||||
import com.intellij.openapi.roots.OrderRootType;
|
||||
import com.intellij.openapi.roots.libraries.Library;
|
||||
import com.intellij.openapi.roots.libraries.LibraryKind;
|
||||
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor;
|
||||
import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Key;
|
||||
@@ -120,7 +121,7 @@ public abstract class MvcFramework {
|
||||
"Error", Messages.getErrorIcon()) == 1) {
|
||||
return;
|
||||
}
|
||||
ProjectSettingsService.getInstance(module.getProject()).showModuleConfigurationDialog(module.getName(), "Dependencies", false);
|
||||
ProjectSettingsService.getInstance(module.getProject()).showModuleConfigurationDialog(module.getName(), ClasspathEditor.NAME, false);
|
||||
}
|
||||
module.putUserData(CREATE_APP_STRUCTURE, null);
|
||||
final int result = Messages.showYesNoCancelDialog(module.getProject(),
|
||||
|
||||
+3
-2
@@ -19,6 +19,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.pom.Navigatable;
|
||||
import com.intellij.pom.NavigatableAdapter;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.xml.XmlDocument;
|
||||
@@ -47,7 +48,7 @@ public class MavenNavigationUtil {
|
||||
public static Navigatable createNavigatableForPom(final Project project, final VirtualFile file) {
|
||||
if (file == null || !file.isValid()) return null;
|
||||
final PsiFile result = PsiManager.getInstance(project).findFile(file);
|
||||
return result == null ? null : new Navigatable.Adapter() {
|
||||
return result == null ? null : new NavigatableAdapter() {
|
||||
public void navigate(boolean requestFocus) {
|
||||
int offset = 0;
|
||||
if (result instanceof XmlFile) {
|
||||
@@ -69,7 +70,7 @@ public class MavenNavigationUtil {
|
||||
|
||||
@Nullable
|
||||
public static Navigatable createNavigatableForDependency(final Project project, final VirtualFile file, final MavenArtifact artifact) {
|
||||
return new Navigatable.Adapter() {
|
||||
return new NavigatableAdapter() {
|
||||
public void navigate(boolean requestFocus) {
|
||||
final PsiFile pom = PsiManager.getInstance(project).findFile(file);
|
||||
if (pom instanceof XmlFile) {
|
||||
|
||||
@@ -23,11 +23,12 @@ import com.intellij.ide.projectView.impl.nodes.BasePsiNode;
|
||||
import com.intellij.ide.projectView.impl.nodes.ClassTreeNode;
|
||||
import com.intellij.ide.projectView.impl.nodes.PsiFileNode;
|
||||
import com.intellij.ide.util.treeView.AbstractTreeNode;
|
||||
import com.intellij.navigation.NavigationItemFileStatus;
|
||||
import com.intellij.openapi.fileTypes.StdFileTypes;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -96,7 +97,7 @@ public class FormNode extends ProjectViewNode<Form>{
|
||||
for(BasePsiNode<? extends PsiElement> child: myChildren) {
|
||||
final PsiElement value = child.getValue();
|
||||
if (value == null || !value.isValid()) continue;
|
||||
final FileStatus fileStatus = child.getFileStatus();
|
||||
final FileStatus fileStatus = NavigationItemFileStatus.get(child);
|
||||
if (fileStatus != FileStatus.NOT_CHANGED) {
|
||||
return fileStatus;
|
||||
}
|
||||
|
||||
+4
-4
@@ -19,10 +19,10 @@ import com.intellij.lang.ASTNode;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.navigation.PsiElementNavigationItem;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -46,7 +46,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
abstract class XsltElementImpl extends LightElement implements Iconable, NavigationItem, XsltElement, ItemPresentation {
|
||||
abstract class XsltElementImpl extends LightElement implements Iconable, PsiElementNavigationItem, XsltElement, ItemPresentation {
|
||||
|
||||
protected final @NotNull XmlTag myElement;
|
||||
protected final XsltElementFactory myElementFactory;
|
||||
@@ -100,8 +100,8 @@ abstract class XsltElementImpl extends LightElement implements Iconable, Navigat
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileStatus getFileStatus() {
|
||||
return myElement instanceof NavigationItem ? ((NavigationItem)myElement).getFileStatus() : FileStatus.UNKNOWN;
|
||||
public PsiElement getTargetElement() {
|
||||
return myElement;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -456,10 +456,6 @@ public class XPathEvalAction extends XPathAction {
|
||||
return myItemPresentation;
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return FileStatus.NOT_CHANGED;
|
||||
}
|
||||
|
||||
public void navigate(boolean requestFocus) {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.intellij.plugins.relaxNG.model.resolve;
|
||||
|
||||
import com.intellij.ide.highlighter.XmlFileType;
|
||||
import com.intellij.navigation.PsiElementNavigationItem;
|
||||
import com.intellij.navigation.ItemPresentation;
|
||||
import com.intellij.navigation.NavigationItem;
|
||||
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
@@ -194,7 +195,7 @@ public class RelaxSymbolIndex extends ScalarIndexExtension<String> {
|
||||
}
|
||||
}
|
||||
|
||||
private static class MyNavigationItem implements NavigationItem, ItemPresentation {
|
||||
private static class MyNavigationItem implements PsiElementNavigationItem, ItemPresentation {
|
||||
private final NavigationItem myItem;
|
||||
private final ItemPresentation myPresentation;
|
||||
|
||||
@@ -234,8 +235,9 @@ public class RelaxSymbolIndex extends ScalarIndexExtension<String> {
|
||||
return myPresentation != null ? this : null;
|
||||
}
|
||||
|
||||
public FileStatus getFileStatus() {
|
||||
return myItem.getFileStatus();
|
||||
@Override
|
||||
public PsiElement getTargetElement() {
|
||||
return (PsiElement) myItem;
|
||||
}
|
||||
|
||||
public void navigate(boolean requestFocus) {
|
||||
|
||||
Reference in New Issue
Block a user