mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix yellow code producing by CommonDataKeys
This commit is contained in:
@@ -427,7 +427,7 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
|
||||
return selectedFiles.length > 0 ? PsiManager.getInstance(thumbnailView.getProject()).findFile(selectedFiles[0]) : null;
|
||||
} else if (LangDataKeys.PSI_ELEMENT_ARRAY.is(dataId)) {
|
||||
return getSelectedElements();
|
||||
} else if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
} else if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
VirtualFile[] selectedFiles = getSelectedFiles();
|
||||
return new ThumbnailNavigatable(selectedFiles.length > 0 ? selectedFiles[0] : null);
|
||||
} else if (PlatformDataKeys.COPY_PROVIDER.is(dataId)) {
|
||||
@@ -438,7 +438,7 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
|
||||
return copyPasteSupport.getPasteProvider();
|
||||
} else if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) {
|
||||
return deleteProvider;
|
||||
} else if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
} else if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
VirtualFile[] selectedFiles = getSelectedFiles();
|
||||
Set<Navigatable> navigatables = new HashSet<Navigatable>(selectedFiles.length);
|
||||
for (VirtualFile selectedFile : selectedFiles) {
|
||||
|
||||
@@ -526,7 +526,7 @@ public class CyclicDependenciesPanel extends JPanel implements Disposable, DataP
|
||||
private static class MyTree extends Tree implements DataProvider {
|
||||
public Object getData(String dataId) {
|
||||
PackageDependenciesNode node = getSelectedNode();
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
return node;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -305,10 +305,10 @@ public abstract class SlicePanel extends JPanel implements TypeSafeDataProvider,
|
||||
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
if (key == PlatformDataKeys.NAVIGATABLE_ARRAY) {
|
||||
if (key == CommonDataKeys.NAVIGATABLE_ARRAY) {
|
||||
List<Navigatable> navigatables = getNavigatables();
|
||||
if (!navigatables.isEmpty()) {
|
||||
sink.put(PlatformDataKeys.NAVIGATABLE_ARRAY, navigatables.toArray(new Navigatable[navigatables.size()]));
|
||||
sink.put(CommonDataKeys.NAVIGATABLE_ARRAY, navigatables.toArray(new Navigatable[navigatables.size()]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,14 +653,14 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
}
|
||||
}
|
||||
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
return getSelectedNavigatable(problem, psiElement);
|
||||
}
|
||||
else if (CommonDataKeys.PSI_ELEMENT.is(dataId)) {
|
||||
return psiElement.isValid() ? psiElement : null;
|
||||
}
|
||||
}
|
||||
else if (selectedNode instanceof ProblemDescriptionNode && PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
else if (selectedNode instanceof ProblemDescriptionNode && CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
return getSelectedNavigatable(((ProblemDescriptionNode)selectedNode).getDescriptor());
|
||||
}
|
||||
|
||||
|
||||
@@ -818,7 +818,7 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
|
||||
|
||||
@Override
|
||||
public Object getData(final String dataId) {
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (myEditor == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public abstract class SelectInContextImpl implements SelectInContext {
|
||||
}
|
||||
|
||||
if (selectInContext == null) {
|
||||
Navigatable descriptor = PlatformDataKeys.NAVIGATABLE.getData(dataContext);
|
||||
Navigatable descriptor = CommonDataKeys.NAVIGATABLE.getData(dataContext);
|
||||
if (descriptor instanceof OpenFileDescriptor) {
|
||||
final VirtualFile file = ((OpenFileDescriptor)descriptor).getFile();
|
||||
if (file.isValid()) {
|
||||
|
||||
@@ -454,7 +454,7 @@ public class CommanderPanel extends JPanel {
|
||||
final Object element = parentNode != null ? parentNode.getValue() : null;
|
||||
return element instanceof PsiElement && ((PsiElement)element).isValid() ? element : null;
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
return getNavigatables();
|
||||
}
|
||||
if (PlatformDataKeys.COPY_PROVIDER.is(dataId)) {
|
||||
|
||||
+2
-2
@@ -405,11 +405,11 @@ public class FavoritesTreeViewPanel extends JPanel implements DataProvider, Dock
|
||||
if (CommonDataKeys.PROJECT.is(dataId)) {
|
||||
return myProject;
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final FavoritesTreeNodeDescriptor[] selectedNodeDescriptors = FavoritesTreeUtil.getSelectedNodeDescriptors(myTree);
|
||||
return selectedNodeDescriptors.length == 1 ? selectedNodeDescriptors[0].getElement() : null;
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
final List<Navigatable> selectedElements = getSelectedElements(Navigatable.class);
|
||||
return selectedElements.isEmpty() ? null : selectedElements.toArray(new Navigatable[selectedElements.size()]);
|
||||
}
|
||||
|
||||
@@ -217,14 +217,14 @@ public abstract class HierarchyBrowserBase extends SimpleToolWindowPanel impleme
|
||||
if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) {
|
||||
return null;
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final DefaultMutableTreeNode selectedNode = getSelectedNode();
|
||||
if (selectedNode == null) return null;
|
||||
final HierarchyNodeDescriptor descriptor = getDescriptor(selectedNode);
|
||||
if (descriptor == null) return null;
|
||||
return getNavigatable(descriptor);
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
return getNavigatables();
|
||||
}
|
||||
if (PlatformDataKeys.TREE_EXPANDER.is(dataId)) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.intellij.psi.PsiElement;
|
||||
public class NavigatableRule implements GetDataRule {
|
||||
@Override
|
||||
public Object getData(DataProvider dataProvider) {
|
||||
final Navigatable navigatable = PlatformDataKeys.NAVIGATABLE.getData(dataProvider);
|
||||
final Navigatable navigatable = CommonDataKeys.NAVIGATABLE.getData(dataProvider);
|
||||
if (navigatable != null && navigatable instanceof OpenFileDescriptor) {
|
||||
final OpenFileDescriptor openFileDescriptor = (OpenFileDescriptor)navigatable;
|
||||
|
||||
|
||||
@@ -647,7 +647,7 @@ public class NavBarPanel extends JPanel implements DataProvider, PopupOwner, Dis
|
||||
return !files.isEmpty() ? VfsUtilCore.toVirtualFileArray(files) : null;
|
||||
}
|
||||
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
final List<Navigatable> elements = getSelectedElements(Navigatable.class);
|
||||
return elements == null || elements.isEmpty() ? null : elements.toArray(new Navigatable[elements.size()]);
|
||||
}
|
||||
|
||||
+2
-1
@@ -32,6 +32,7 @@ import com.intellij.ide.projectView.impl.nodes.ModuleGroupNode;
|
||||
import com.intellij.ide.util.treeView.*;
|
||||
import com.intellij.injected.editor.VirtualFileWindow;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup;
|
||||
@@ -265,7 +266,7 @@ public abstract class AbstractProjectViewPane implements DataProvider, Disposabl
|
||||
|
||||
@Override
|
||||
public Object getData(String dataId) {
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
TreePath[] paths = getSelectionPaths();
|
||||
if (paths == null) return null;
|
||||
final ArrayList<Navigatable> navigatables = new ArrayList<Navigatable>();
|
||||
|
||||
+2
-2
@@ -689,7 +689,7 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre
|
||||
if (myAbstractTreeBuilder == null) return;
|
||||
myAutoscrollFeedback = true;
|
||||
|
||||
Navigatable editSourceDescriptor = PlatformDataKeys.NAVIGATABLE.getData(DataManager.getInstance().getDataContext(getTree()));
|
||||
Navigatable editSourceDescriptor = CommonDataKeys.NAVIGATABLE.getData(DataManager.getInstance().getDataContext(getTree()));
|
||||
if (myFileEditor != null && editSourceDescriptor != null && editSourceDescriptor.canNavigateToSource()) {
|
||||
editSourceDescriptor.navigate(false);
|
||||
}
|
||||
@@ -777,7 +777,7 @@ public class StructureViewComponent extends SimpleToolWindowPanel implements Tre
|
||||
if (PlatformDataKeys.PASTE_PROVIDER.is(dataId)) {
|
||||
return myCopyPasteDelegator.getPasteProvider();
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
Object[] selectedElements = getSelectedTreeElements();
|
||||
if (selectedElements == null || selectedElements.length == 0) return null;
|
||||
if (selectedElements[0] instanceof Navigatable) {
|
||||
|
||||
@@ -344,7 +344,7 @@ abstract class TodoPanel extends SimpleToolWindowPanel implements OccurenceNavig
|
||||
|
||||
@Override
|
||||
public Object getData(String dataId) {
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
TreePath path = myTree.getSelectionPath();
|
||||
if (path == null) {
|
||||
return null;
|
||||
|
||||
@@ -417,7 +417,7 @@ public class FileStructureDialog extends DialogWrapper {
|
||||
|
||||
if (selectedElement instanceof TreeElement) selectedElement = ((StructureViewTreeElement)selectedElement).getValue();
|
||||
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
return selectedElement instanceof Navigatable ? selectedElement : myNavigatable;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.intellij.lang.LanguageFormatting;
|
||||
import com.intellij.lang.LanguageUtil;
|
||||
import com.intellij.lang.injection.InjectedLanguageManager;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.application.AccessToken;
|
||||
@@ -822,7 +823,7 @@ public class PsiViewerDialog extends DialogWrapper implements DataProvider, Disp
|
||||
|
||||
@Override
|
||||
public Object getData(@NonNls String dataId) {
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
String fqn = null;
|
||||
if (myPsiTree.hasFocus()) {
|
||||
final TreePath path = myPsiTree.getSelectionPath();
|
||||
|
||||
+1
-1
@@ -527,7 +527,7 @@ public class ModulesDependenciesPanel extends JPanel implements ModuleRootListen
|
||||
if (PlatformDataKeys.HELP_ID.is(dataId)) {
|
||||
return ourHelpID;
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final TreePath selectionPath = myTree.getLeadSelectionPath();
|
||||
if (selectionPath != null && selectionPath.getLastPathComponent() instanceof DefaultMutableTreeNode){
|
||||
DefaultMutableTreeNode node = (DefaultMutableTreeNode)selectionPath.getLastPathComponent();
|
||||
|
||||
@@ -777,7 +777,7 @@ public class DependenciesPanel extends JPanel implements Disposable, DataProvide
|
||||
@Override
|
||||
public Object getData(String dataId) {
|
||||
PackageDependenciesNode node = getSelectedNode();
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
return node;
|
||||
}
|
||||
if (CommonDataKeys.PSI_ELEMENT.is(dataId) && node != null) {
|
||||
|
||||
@@ -128,14 +128,14 @@ public interface DataConstants {
|
||||
*
|
||||
* @deprecated use {@link com.intellij.openapi.actionSystem.PlatformDataKeys#NAVIGATABLE} instead
|
||||
*/
|
||||
String NAVIGATABLE = PlatformDataKeys.NAVIGATABLE.getName();
|
||||
String NAVIGATABLE = CommonDataKeys.NAVIGATABLE.getName();
|
||||
|
||||
/**
|
||||
* Returns an array of {@link com.intellij.pom.Navigatable}
|
||||
*
|
||||
* @deprecated use {@link com.intellij.openapi.actionSystem.PlatformDataKeys#NAVIGATABLE_ARRAY} instead
|
||||
*/
|
||||
String NAVIGATABLE_ARRAY = PlatformDataKeys.NAVIGATABLE_ARRAY.getName();
|
||||
String NAVIGATABLE_ARRAY = CommonDataKeys.NAVIGATABLE_ARRAY.getName();
|
||||
|
||||
/**
|
||||
* Returns {@link com.intellij.ide.ExporterToTextFile}
|
||||
|
||||
@@ -198,7 +198,7 @@ public abstract class AutoScrollToSourceHandler {
|
||||
//IDEA-84881 Don't autoscroll to very large files
|
||||
if (vFile.getLength() > PersistentFSConstants.getMaxIntellisenseFileSize()) return;
|
||||
}
|
||||
Navigatable[] navigatables = PlatformDataKeys.NAVIGATABLE_ARRAY.getData(context);
|
||||
Navigatable[] navigatables = CommonDataKeys.NAVIGATABLE_ARRAY.getData(context);
|
||||
if (navigatables != null) {
|
||||
if (navigatables.length > 1) {
|
||||
return;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.util;
|
||||
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
@@ -27,11 +28,11 @@ public class OpenSourceUtil {
|
||||
}
|
||||
|
||||
public static void openSourcesFrom(DataContext context, boolean requestFocus) {
|
||||
navigate(requestFocus, PlatformDataKeys.NAVIGATABLE_ARRAY.getData(context));
|
||||
navigate(requestFocus, CommonDataKeys.NAVIGATABLE_ARRAY.getData(context));
|
||||
}
|
||||
|
||||
public static void openSourcesFrom(DataProvider context, boolean requestFocus) {
|
||||
navigate(requestFocus, PlatformDataKeys.NAVIGATABLE_ARRAY.getData(context));
|
||||
navigate(requestFocus, CommonDataKeys.NAVIGATABLE_ARRAY.getData(context));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -86,6 +86,6 @@ public abstract class BaseNavigateToSourceAction extends AnAction implements Dum
|
||||
|
||||
@Nullable
|
||||
protected Navigatable[] getNavigatables(final DataContext dataContext) {
|
||||
return PlatformDataKeys.NAVIGATABLE_ARRAY.getData(dataContext);
|
||||
return CommonDataKeys.NAVIGATABLE_ARRAY.getData(dataContext);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -206,7 +206,7 @@ public class NewErrorTreeViewPanel extends JPanel implements DataProvider, Occur
|
||||
if (PlatformDataKeys.COPY_PROVIDER.is(dataId)) {
|
||||
return this;
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final NavigatableMessageElement selectedMessageElement = getSelectedMessageElement();
|
||||
return selectedMessageElement != null ? selectedMessageElement.getNavigatable() : null;
|
||||
}
|
||||
@@ -379,7 +379,7 @@ public class NewErrorTreeViewPanel extends JPanel implements DataProvider, Occur
|
||||
return;
|
||||
}
|
||||
DefaultActionGroup group = new DefaultActionGroup();
|
||||
if (getData(PlatformDataKeys.NAVIGATABLE.getName()) != null) {
|
||||
if (getData(CommonDataKeys.NAVIGATABLE.getName()) != null) {
|
||||
group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE));
|
||||
}
|
||||
group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_COPY));
|
||||
|
||||
@@ -280,7 +280,7 @@ public class DataManagerImpl extends DataManager implements ApplicationComponent
|
||||
myDataConstantToRuleMap.put(PlatformDataKeys.PASTE_PROVIDER.getName(), new PasteProviderRule());
|
||||
myDataConstantToRuleMap.put(PlatformDataKeys.FILE_TEXT.getName(), new FileTextRule());
|
||||
myDataConstantToRuleMap.put(PlatformDataKeys.FILE_EDITOR.getName(), new FileEditorRule());
|
||||
myDataConstantToRuleMap.put(PlatformDataKeys.NAVIGATABLE_ARRAY.getName(), new NavigatableArrayRule());
|
||||
myDataConstantToRuleMap.put(CommonDataKeys.NAVIGATABLE_ARRAY.getName(), new NavigatableArrayRule());
|
||||
myDataConstantToRuleMap.put(PlatformDataKeys.EDITOR_EVEN_IF_INACTIVE.getName(), new InactiveEditorRule());
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -15,13 +15,14 @@
|
||||
*/
|
||||
package com.intellij.ide.impl.dataRules;
|
||||
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.pom.Navigatable;
|
||||
|
||||
public class NavigatableArrayRule implements GetDataRule {
|
||||
public Object getData(DataProvider dataProvider) {
|
||||
final Navigatable element = PlatformDataKeys.NAVIGATABLE.getData(dataProvider);
|
||||
final Navigatable element = CommonDataKeys.NAVIGATABLE.getData(dataProvider);
|
||||
if (element == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -868,7 +868,7 @@ public class DiffPanelImpl implements DiffPanelEx, ContentChangeListener, TwoSid
|
||||
if (FocusDiffSide.DATA_KEY.is(dataId)) {
|
||||
return myDiffPanel.myCurrentSide == null ? null : myFocusDiffSide;
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final DiffSideView currentSide = myDiffPanel.myCurrentSide;
|
||||
if (currentSide != null) {
|
||||
return new DiffNavigatable(currentSide);
|
||||
|
||||
@@ -78,7 +78,7 @@ public class FilesystemToolwindow {
|
||||
|
||||
@Nullable
|
||||
public Object getData(@NonNls final String dataId) {
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final VirtualFile file = myFsTree.getSelectedFile();
|
||||
if (file != null) {
|
||||
return new OpenFileDescriptor(myProject, file);
|
||||
|
||||
@@ -54,8 +54,8 @@ public class TestsUIUtil {
|
||||
final Project project = properties.getProject();
|
||||
if (testProxy == null) return null;
|
||||
if (AbstractTestProxy.DATA_KEY.is(dataId)) return testProxy;
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) return getOpenFileDescriptor(testProxy, model);
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) return getOpenFileDescriptor(testProxy, model);
|
||||
if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
final Navigatable openFileDescriptor = getOpenFileDescriptor(testProxy, model);
|
||||
return openFileDescriptor != null ? new Navigatable[]{openFileDescriptor} : null;
|
||||
}
|
||||
|
||||
@@ -1436,8 +1436,8 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
|
||||
sink.put(USAGE_VIEW_KEY, UsageViewImpl.this);
|
||||
}
|
||||
|
||||
else if (key == PlatformDataKeys.NAVIGATABLE_ARRAY) {
|
||||
sink.put(PlatformDataKeys.NAVIGATABLE_ARRAY, getNavigatablesForNodes(getSelectedNodes()));
|
||||
else if (key == CommonDataKeys.NAVIGATABLE_ARRAY) {
|
||||
sink.put(CommonDataKeys.NAVIGATABLE_ARRAY, getNavigatablesForNodes(getSelectedNodes()));
|
||||
}
|
||||
|
||||
else if (key == PlatformDataKeys.EXPORTER_TO_TEXT_FILE) {
|
||||
|
||||
+2
-2
@@ -384,10 +384,10 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP
|
||||
sink.put(VcsDataKeys.CHANGE_LISTS, lists.toArray(new CommittedChangeList[lists.size()]));
|
||||
}
|
||||
}
|
||||
else if (key.equals(PlatformDataKeys.NAVIGATABLE_ARRAY)) {
|
||||
else if (key.equals(CommonDataKeys.NAVIGATABLE_ARRAY)) {
|
||||
final Collection<Change> changes = collectChanges(getSelectedChangeLists(), false);
|
||||
Navigatable[] result = ChangesUtil.getNavigatableArray(myProject, ChangesUtil.getFilesFromChanges(changes));
|
||||
sink.put(PlatformDataKeys.NAVIGATABLE_ARRAY, result);
|
||||
sink.put(CommonDataKeys.NAVIGATABLE_ARRAY, result);
|
||||
}
|
||||
else if (key.equals(PlatformDataKeys.HELP_ID)) {
|
||||
sink.put(PlatformDataKeys.HELP_ID, myHelpId);
|
||||
|
||||
+2
-2
@@ -340,7 +340,7 @@ public class ShelvedChangesViewManager implements ProjectComponent {
|
||||
}
|
||||
else if (key == PlatformDataKeys.DELETE_ELEMENT_PROVIDER) {
|
||||
sink.put(PlatformDataKeys.DELETE_ELEMENT_PROVIDER, myDeleteProvider);
|
||||
} else if (PlatformDataKeys.NAVIGATABLE_ARRAY.equals(key)) {
|
||||
} else if (CommonDataKeys.NAVIGATABLE_ARRAY.equals(key)) {
|
||||
List<ShelvedChange> shelvedChanges = new ArrayList<ShelvedChange>(TreeUtil.collectSelectedObjectsOfType(this, ShelvedChange.class));
|
||||
final ArrayDeque<Navigatable> navigatables = new ArrayDeque<Navigatable>();
|
||||
final List<ShelvedChangeList> changeLists = TreeUtil.collectSelectedObjectsOfType(this, ShelvedChangeList.class);
|
||||
@@ -362,7 +362,7 @@ public class ShelvedChangesViewManager implements ProjectComponent {
|
||||
}
|
||||
}
|
||||
|
||||
sink.put(PlatformDataKeys.NAVIGATABLE_ARRAY, navigatables.toArray(new Navigatable[navigatables.size()]));
|
||||
sink.put(CommonDataKeys.NAVIGATABLE_ARRAY, navigatables.toArray(new Navigatable[navigatables.size()]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -180,8 +180,8 @@ public class ChangesBrowser extends JPanel implements TypeSafeDataProvider {
|
||||
} else if (key == CommonDataKeys.VIRTUAL_FILE_ARRAY) {
|
||||
sink.put(CommonDataKeys.VIRTUAL_FILE_ARRAY, getSelectedFiles());
|
||||
}
|
||||
else if (key == PlatformDataKeys.NAVIGATABLE_ARRAY) {
|
||||
sink.put(PlatformDataKeys.NAVIGATABLE_ARRAY, ChangesUtil.getNavigatableArray(myProject, getSelectedFiles()));
|
||||
else if (key == CommonDataKeys.NAVIGATABLE_ARRAY) {
|
||||
sink.put(CommonDataKeys.NAVIGATABLE_ARRAY, ChangesUtil.getNavigatableArray(myProject, getSelectedFiles()));
|
||||
} else if (VcsDataKeys.IO_FILE_ARRAY.equals(key)) {
|
||||
sink.put(VcsDataKeys.IO_FILE_ARRAY, getSelectedIoFiles());
|
||||
}
|
||||
|
||||
@@ -189,14 +189,14 @@ public class ChangesListView extends Tree implements TypeSafeDataProvider, Advan
|
||||
else if (key == CommonDataKeys.VIRTUAL_FILE_ARRAY) {
|
||||
sink.put(CommonDataKeys.VIRTUAL_FILE_ARRAY, getSelectedFiles());
|
||||
}
|
||||
else if (key == PlatformDataKeys.NAVIGATABLE) {
|
||||
else if (key == CommonDataKeys.NAVIGATABLE) {
|
||||
final VirtualFile[] files = getSelectedFiles();
|
||||
if (files.length == 1 && !files [0].isDirectory()) {
|
||||
sink.put(PlatformDataKeys.NAVIGATABLE, new OpenFileDescriptor(myProject, files[0], 0));
|
||||
sink.put(CommonDataKeys.NAVIGATABLE, new OpenFileDescriptor(myProject, files[0], 0));
|
||||
}
|
||||
}
|
||||
else if (key == PlatformDataKeys.NAVIGATABLE_ARRAY) {
|
||||
sink.put(PlatformDataKeys.NAVIGATABLE_ARRAY, ChangesUtil.getNavigatableArray(myProject, getSelectedFiles()));
|
||||
else if (key == CommonDataKeys.NAVIGATABLE_ARRAY) {
|
||||
sink.put(CommonDataKeys.NAVIGATABLE_ARRAY, ChangesUtil.getNavigatableArray(myProject, getSelectedFiles()));
|
||||
}
|
||||
else if (key == PlatformDataKeys.DELETE_ELEMENT_PROVIDER) {
|
||||
final TreePath[] paths = getSelectionPaths();
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ import com.intellij.icons.AllIcons;
|
||||
import com.intellij.idea.ActionsBundle;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.pom.Navigatable;
|
||||
@@ -37,7 +38,7 @@ public class EditSourceInCommitAction extends AnAction {
|
||||
}
|
||||
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
final Navigatable[] navigatableArray = e.getData(PlatformDataKeys.NAVIGATABLE_ARRAY);
|
||||
final Navigatable[] navigatableArray = e.getData(CommonDataKeys.NAVIGATABLE_ARRAY);
|
||||
if (navigatableArray != null && navigatableArray.length > 0) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
|
||||
@@ -1192,7 +1192,7 @@ public class FileHistoryPanelImpl extends PanelWithActionsAndCloseButton {
|
||||
|
||||
public Object getData(String dataId) {
|
||||
VcsFileRevision firstSelectedRevision = getFirstSelectedRevision();
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
List selectedItems = getSelection();
|
||||
if (selectedItems.size() != 1) return null;
|
||||
if (!myHistorySession.isContentAvailable(firstSelectedRevision)) {
|
||||
|
||||
@@ -238,7 +238,7 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton implements Di
|
||||
if (myTreeBrowser != null && myTreeBrowser.isVisible()) {
|
||||
return null;
|
||||
}
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (mySelectedFile == null || !mySelectedFile.isValid()) return null;
|
||||
return new OpenFileDescriptor(myProject, mySelectedFile);
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ public final class TreeView implements AntOutputView, OccurenceNavigator {
|
||||
final TreePath path = myTree.getLeadSelectionPath();
|
||||
if (path == null) return;
|
||||
if (!(path.getLastPathComponent()instanceof MessageNode)) return;
|
||||
if (getData(PlatformDataKeys.NAVIGATABLE_ARRAY.getName()) == null) return;
|
||||
if (getData(CommonDataKeys.NAVIGATABLE_ARRAY.getName()) == null) return;
|
||||
DefaultActionGroup group = new DefaultActionGroup();
|
||||
group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE));
|
||||
ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.ANT_MESSAGES_POPUP, group);
|
||||
@@ -382,7 +382,7 @@ public final class TreeView implements AntOutputView, OccurenceNavigator {
|
||||
|
||||
@Nullable
|
||||
public Object getData(String dataId) {
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
MessageNode item = getSelectedItem();
|
||||
if (item == null) return null;
|
||||
if (isValid(item.getFile())) {
|
||||
|
||||
@@ -421,7 +421,7 @@ public class AntExplorer extends SimpleToolWindowPanel implements DataProvider,
|
||||
|
||||
@Nullable
|
||||
public Object getData(@NonNls String dataId) {
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final AntBuildFile buildFile = getCurrentBuildFile();
|
||||
if (buildFile == null) {
|
||||
return null;
|
||||
|
||||
@@ -102,14 +102,14 @@ public class BrowserPanel extends JPanel implements DataProvider, CvsTabbedWindo
|
||||
}
|
||||
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
final Navigatable[] navigatableArray = e.getData(PlatformDataKeys.NAVIGATABLE_ARRAY);
|
||||
final Navigatable[] navigatableArray = e.getData(CommonDataKeys.NAVIGATABLE_ARRAY);
|
||||
if (navigatableArray != null && navigatableArray.length > 0) {
|
||||
OpenSourceUtil.navigate(navigatableArray);
|
||||
}
|
||||
}
|
||||
|
||||
public void update(final AnActionEvent e) {
|
||||
final Navigatable[] navigatableArray = e.getData(PlatformDataKeys.NAVIGATABLE_ARRAY);
|
||||
final Navigatable[] navigatableArray = e.getData(CommonDataKeys.NAVIGATABLE_ARRAY);
|
||||
e.getPresentation().setEnabled(navigatableArray != null && navigatableArray.length > 0);
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class BrowserPanel extends JPanel implements DataProvider, CvsTabbedWindo
|
||||
}
|
||||
|
||||
public Object getData(String dataId) {
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
VirtualFile cvsVirtualFile = getCvsVirtualFile();
|
||||
if (cvsVirtualFile == null || !cvsVirtualFile.isValid()) return null;
|
||||
return new OpenFileDescriptor(myProject, cvsVirtualFile);
|
||||
|
||||
+2
-2
@@ -137,7 +137,7 @@ public class EditorsPanel extends JPanel implements TypeSafeDataProvider {
|
||||
if (key.equals(CommonDataKeys.PROJECT)) {
|
||||
sink.put(CommonDataKeys.PROJECT, myProject);
|
||||
}
|
||||
else if (key.equals(PlatformDataKeys.NAVIGATABLE)) {
|
||||
else if (key.equals(CommonDataKeys.NAVIGATABLE)) {
|
||||
final EditorInfo editorInfo = myTable.getSelectedObject();
|
||||
if (editorInfo == null) {
|
||||
return;
|
||||
@@ -150,7 +150,7 @@ public class EditorsPanel extends JPanel implements TypeSafeDataProvider {
|
||||
final File file = new File(editorInfo.getPath(), filePath);
|
||||
final VirtualFile vf = LocalFileSystem.getInstance().findFileByIoFile(file);
|
||||
if (vf != null) {
|
||||
sink.put(PlatformDataKeys.NAVIGATABLE, new OpenFileDescriptor(myProject, vf));
|
||||
sink.put(CommonDataKeys.NAVIGATABLE, new OpenFileDescriptor(myProject, vf));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ public class MavenProjectsNavigatorPanel extends SimpleToolWindowPanel implement
|
||||
if (CommonDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) return extractVirtualFiles();
|
||||
|
||||
if (Location.DATA_KEY.is(dataId)) return extractLocation();
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) return extractNavigatables();
|
||||
if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) return extractNavigatables();
|
||||
|
||||
if (MavenDataKeys.MAVEN_GOALS.is(dataId)) return extractGoals(true);
|
||||
if (MavenDataKeys.RUN_CONFIGURATION.is(dataId)) return extractRunSettings();
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ public class IntersectingLocalChangesPanel {
|
||||
}
|
||||
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.equals(key)) {
|
||||
if (CommonDataKeys.NAVIGATABLE_ARRAY.equals(key)) {
|
||||
final TreePath[] treePaths = myJTree.getSelectionModel().getSelectionPaths();
|
||||
final List<Navigatable> navigatables = new ArrayList<Navigatable>(treePaths.length);
|
||||
for (TreePath treePath : treePaths) {
|
||||
|
||||
@@ -262,7 +262,7 @@ public class RepositoryBrowserComponent extends JPanel implements Disposable, Da
|
||||
|
||||
@Nullable
|
||||
public Object getData(@NonNls String dataId) {
|
||||
if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final Project project = myVCS.getProject();
|
||||
if (project == null || project.isDefault()) {
|
||||
return null;
|
||||
|
||||
@@ -258,7 +258,7 @@ public final class ComponentTree extends Tree implements DataProvider {
|
||||
return myFormEditor;
|
||||
}
|
||||
|
||||
if (!PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if (!CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ public final class GlassLayer extends JComponent implements DataProvider, PopupO
|
||||
* binding of currently selected component (if any)
|
||||
*/
|
||||
public Object getData(final String dataId) {
|
||||
if(PlatformDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
if(CommonDataKeys.NAVIGATABLE.is(dataId)) {
|
||||
final ComponentTree componentTree = UIDesignerToolWindowManager.getInstance(myEditor.getProject()).getComponentTree();
|
||||
if (componentTree != null) {
|
||||
return componentTree.getData(dataId);
|
||||
|
||||
@@ -46,12 +46,12 @@ public class StructureTree extends Tree implements TypeSafeDataProvider {
|
||||
}
|
||||
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
if (key.equals(PlatformDataKeys.NAVIGATABLE)) {
|
||||
if (key.equals(CommonDataKeys.NAVIGATABLE)) {
|
||||
final TreePath selection = getSelectionPath();
|
||||
if (selection != null) {
|
||||
final Object o = selection.getLastPathComponent();
|
||||
if (o instanceof Navigatable) {
|
||||
sink.put(PlatformDataKeys.NAVIGATABLE, (Navigatable)o);
|
||||
sink.put(CommonDataKeys.NAVIGATABLE, (Navigatable)o);
|
||||
}
|
||||
}
|
||||
} else if (key.equals(CopyValueAction.SELECTED_NODE)) {
|
||||
|
||||
@@ -190,7 +190,7 @@ public class DomModelTreeView extends Wrapper implements DataProvider, Disposabl
|
||||
if (simpleNode instanceof AbstractDomElementNode) {
|
||||
final DomElement domElement = ((AbstractDomElementNode)simpleNode).getDomElement();
|
||||
if (domElement != null && domElement.isValid()) {
|
||||
if (PlatformDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
|
||||
final XmlElement tag = domElement.getXmlElement();
|
||||
if (tag instanceof Navigatable) {
|
||||
return new Navigatable[] { (Navigatable)tag };
|
||||
|
||||
Reference in New Issue
Block a user