diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java index a35e4ad7e44f..d4d47895b2c7 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectStructureConfigurable.java @@ -519,9 +519,9 @@ public class ProjectStructureConfigurable extends BaseConfigurable implements Se @Nullable public Object getData(@NonNls final String dataId) { - if (KEY.getName().equals(dataId)) { + if (KEY.is(dataId)) { return ProjectStructureConfigurable.this; - } else if (History.KEY.getName().equals(dataId)) { + } else if (History.KEY.is(dataId)) { return getHistory(); } else { return null; diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java index e16206025cdc..c1c07dd69cc2 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java @@ -546,7 +546,7 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple @Nullable public Object getData(@NonNls String dataId) { - if (DataKeys.MODULE_CONTEXT_ARRAY.getName().equals(dataId)){ + if (DataKeys.MODULE_CONTEXT_ARRAY.is(dataId)){ final TreePath[] paths = myTree.getSelectionPaths(); if (paths != null) { ArrayList modules = new ArrayList(); @@ -562,7 +562,7 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple return !modules.isEmpty() ? modules.toArray(new Module[modules.size()]) : null; } } - if (DataKeys.MODULE_CONTEXT.getName().equals(dataId)){ + if (DataKeys.MODULE_CONTEXT.is(dataId)){ return getSelectedModule(); } if (DataConstantsEx.MODIFIABLE_MODULE_MODEL.equals(dataId)){ diff --git a/platform/lang-api/src/com/intellij/execution/ui/RunContentDescriptor.java b/platform/lang-api/src/com/intellij/execution/ui/RunContentDescriptor.java index 52a6176dc1cb..1ae6900a9356 100644 --- a/platform/lang-api/src/com/intellij/execution/ui/RunContentDescriptor.java +++ b/platform/lang-api/src/com/intellij/execution/ui/RunContentDescriptor.java @@ -52,7 +52,7 @@ public class RunContentDescriptor { myComponent.putClientProperty(DataManager.CLIENT_PROPERTY_DATA_PROVIDER, new DataProvider() { public Object getData(@NonNls final String dataId) { - if (RunContentManager.RUN_CONTENT_DESCRIPTOR.getName().equals(dataId)) { + if (RunContentManager.RUN_CONTENT_DESCRIPTOR.is(dataId)) { return RunContentDescriptor.this; } return null; diff --git a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridCellImpl.java b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridCellImpl.java index 77089d104736..8991ebba2615 100644 --- a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridCellImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridCellImpl.java @@ -75,13 +75,13 @@ public class GridCellImpl implements GridCell, Disposable { myTabs = new JBTabsImpl(myContext.getProject(), myContext.getActionManager(), myContext.getFocusManager(), container).setDataProvider(new DataProvider() { @Nullable public Object getData(@NonNls final String dataId) { - if (ViewContext.CONTENT_KEY.getName().equals(dataId)) { + if (ViewContext.CONTENT_KEY.is(dataId)) { TabInfo target = myTabs.getTargetInfo(); if (target != null) { return new Content[]{getContentFor(target)}; } } - else if (ViewContext.CONTEXT_KEY.getName().equals(dataId)) { + else if (ViewContext.CONTEXT_KEY.is(dataId)) { return myContext; } @@ -250,10 +250,10 @@ public class GridCellImpl implements GridCell, Disposable { @Nullable public Object getData(@NonNls final String dataId) { - if (ViewContext.CONTENT_KEY.getName().equals(dataId)) { + if (ViewContext.CONTENT_KEY.is(dataId)) { return new Content[]{myContent}; } - else if (ViewContext.CONTEXT_KEY.getName().equals(dataId)) { + else if (ViewContext.CONTEXT_KEY.is(dataId)) { return myContext; } return null; diff --git a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridImpl.java b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridImpl.java index fb2bc768630f..5fcbaf9cd669 100644 --- a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/GridImpl.java @@ -387,9 +387,9 @@ public class GridImpl extends Wrapper implements Grid, Disposable, CellTransform @Nullable public Object getData(@NonNls final String dataId) { - if (ViewContext.CONTEXT_KEY.getName().equals(dataId)) { + if (ViewContext.CONTEXT_KEY.is(dataId)) { return myViewContext; - } else if (ViewContext.CONTENT_KEY.getName().equals(dataId)) { + } else if (ViewContext.CONTENT_KEY.is(dataId)) { List contents = getContents(); return contents.toArray(new Content[contents.size()]); } diff --git a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java index ad66e54f6c09..7b5ff3e65b38 100644 --- a/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java +++ b/platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java @@ -144,13 +144,13 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac myTabs = new JBTabsImpl(myProject, myActionManager, myFocusManager, this) .setDataProvider(new DataProvider() { public Object getData(@NonNls final String dataId) { - if (ViewContext.CONTENT_KEY.getName().equals(dataId)) { + if (ViewContext.CONTENT_KEY.is(dataId)) { TabInfo info = myTabs.getTargetInfo(); if (info != null) { return getGridFor(info).getData(dataId); } } - else if (ViewContext.CONTEXT_KEY.getName().equals(dataId)) { + else if (ViewContext.CONTEXT_KEY.is(dataId)) { return RunnerContentUi.this; } return null; @@ -720,7 +720,7 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac @Nullable public Object getData(@NonNls final String dataId) { - if (KEY.getName().equals(dataId)) { + if (KEY.is(dataId)) { return RunnerContentUi.this; } else { diff --git a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java index 884b6c418f9e..e4ae69b75d21 100644 --- a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java +++ b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java @@ -641,7 +641,7 @@ public class ShowUsagesAction extends AnAction { } public Object getData(@NonNls String dataId) { - if (LangDataKeys.PSI_ELEMENT.getName().equals(dataId)) { + if (LangDataKeys.PSI_ELEMENT.is(dataId)) { final int[] selected = getSelectedRows(); if (selected.length == 1) { final Object at = getValueAt(selected[0], 0); diff --git a/platform/lang-impl/src/com/intellij/ide/util/FileStructureDialog.java b/platform/lang-impl/src/com/intellij/ide/util/FileStructureDialog.java index 650c7cc05763..a202dc7125fe 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/FileStructureDialog.java +++ b/platform/lang-impl/src/com/intellij/ide/util/FileStructureDialog.java @@ -341,7 +341,7 @@ public class FileStructureDialog extends DialogWrapper { return selectedElement instanceof Navigatable ? selectedElement : myNavigatable; } - if (OpenFileDescriptor.NAVIGATE_IN_EDITOR.getName().equals(dataId)) return myEditor; + if (OpenFileDescriptor.NAVIGATE_IN_EDITOR.is(dataId)) return myEditor; return getDataImpl(dataId); } diff --git a/platform/lang-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorPsiDataProvider.java b/platform/lang-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorPsiDataProvider.java index f1f52896eb9b..3f741c3cbd85 100644 --- a/platform/lang-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorPsiDataProvider.java +++ b/platform/lang-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorPsiDataProvider.java @@ -77,7 +77,7 @@ public class TextEditorPsiDataProvider implements EditorDataProvider { if (dataId.equals(DataConstants.PSI_FILE)) { return getPsiFile(e, file); } - if (LangDataKeys.IDE_VIEW.getName().equals(dataId)) { + if (LangDataKeys.IDE_VIEW.is(dataId)) { final PsiFile psiFile = PsiManager.getInstance(e.getProject()).findFile(file); final PsiDirectory psiDirectory = psiFile != null ? psiFile.getParent() : null; if (psiDirectory != null && psiDirectory.isPhysical()) { diff --git a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java index 747f8e8e9f1e..604942f9e1e1 100644 --- a/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java +++ b/platform/platform-api/src/com/intellij/ui/tabs/impl/JBTabsImpl.java @@ -2581,7 +2581,7 @@ public class JBTabsImpl extends JComponent if (value != null) return value; } - return NAVIGATION_ACTIONS_KEY.getName().equals(dataId) ? this : null; + return NAVIGATION_ACTIONS_KEY.is(dataId) ? this : null; } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java index a4780f156292..c06cd00ccc3b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileChooser/ex/FileChooserDialogImpl.java @@ -369,10 +369,10 @@ public class FileChooserDialogImpl extends DialogWrapper implements FileChooserD public Object getData(String dataId) { if (DataConstants.VIRTUAL_FILE_ARRAY.equals(dataId)) { return getSelectedFiles(); - } else if (KEY.getName().equals(dataId)) { + } else if (KEY.is(dataId)) { return FileChooserDialogImpl.this; } - else if (FileSystemTree.DATA_KEY.getName().equals(dataId)) { + else if (FileSystemTree.DATA_KEY.is(dataId)) { return myFileSystemTree; } return myChooserDescriptor.getUserData(dataId); diff --git a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java index 6e3f5e13076c..0677ad79cd58 100644 --- a/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java +++ b/platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditor.java @@ -674,7 +674,7 @@ public class OptionsEditor extends JPanel implements DataProvider, Place.Navigat if (dataId.equals(KEY.getName())) { return this; } - return History.KEY.getName().equals(dataId) ? myHistory : null; + return History.KEY.is(dataId) ? myHistory : null; } public JTree getPreferredFocusedComponent() { diff --git a/platform/platform-impl/src/com/intellij/openapi/ui/impl/DialogWrapperPeerImpl.java b/platform/platform-impl/src/com/intellij/openapi/ui/impl/DialogWrapperPeerImpl.java index fcbfc179b3b6..cf4137b05dd1 100644 --- a/platform/platform-impl/src/com/intellij/openapi/ui/impl/DialogWrapperPeerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/ui/impl/DialogWrapperPeerImpl.java @@ -906,7 +906,7 @@ public class DialogWrapperPeerImpl extends DialogWrapperPeer implements FocusTra public Object getData(@NonNls String dataId) { final DialogWrapper wrapper = myDialogWrapper.get(); - return PlatformDataKeys.UI_DISPOSABLE.getName().equals(dataId) ? wrapper.getDisposable() : null; + return PlatformDataKeys.UI_DISPOSABLE.is(dataId) ? wrapper.getDisposable() : null; } } diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerTestTreeView.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerTestTreeView.java index f600d13868e0..9f2e9391e1a1 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerTestTreeView.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerTestTreeView.java @@ -68,7 +68,7 @@ public class SMTRunnerTestTreeView extends TestTreeView { @Override public Object getData(final String dataId) { - if (dataId.equals(SM_TEST_RUNNER_VIEW.getName())) { + if (SM_TEST_RUNNER_VIEW.is(dataId)) { return this; } return super.getData(dataId); diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/statistics/StatisticsPanel.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/statistics/StatisticsPanel.java index c8c253a90b93..bd0af3597493 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/statistics/StatisticsPanel.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/statistics/StatisticsPanel.java @@ -158,7 +158,7 @@ public class StatisticsPanel implements DataProvider { } public Object getData(@NonNls final String dataId) { - if (SM_TEST_RUNNER_STATISTICS.getName().equals(dataId)) { + if (SM_TEST_RUNNER_STATISTICS.is(dataId)) { return this; } return TestsUIUtil.getData(getSelectedItem(), dataId, myFrameworkRunningModel); diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/HeavyIdeaTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/HeavyIdeaTestFixtureImpl.java index 7a2faa7362a4..51889a5e3a52 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/HeavyIdeaTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/HeavyIdeaTestFixtureImpl.java @@ -189,7 +189,7 @@ class HeavyIdeaTestFixtureImpl extends BaseFixture implements HeavyIdeaTestFixtu if (dataId.equals(DataConstants.PROJECT)) { return myProject; } - else if (dataId.equals(DataConstants.EDITOR) || dataId.equals(OpenFileDescriptor.NAVIGATE_IN_EDITOR.getName())) { + else if (dataId.equals(DataConstants.EDITOR) || OpenFileDescriptor.NAVIGATE_IN_EDITOR.is(dataId)) { return FileEditorManager.getInstance(myProject).getSelectedTextEditor(); } else { diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightIdeaTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightIdeaTestFixtureImpl.java index 38a310ad592a..e4bfd9df3d66 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightIdeaTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightIdeaTestFixtureImpl.java @@ -55,7 +55,7 @@ class LightIdeaTestFixtureImpl extends BaseFixture implements LightIdeaTestFixtu if (dataId.equals(DataConstants.PROJECT)) { return getProject(); } - else if (dataId.equals(DataConstants.EDITOR) || dataId.equals(OpenFileDescriptor.NAVIGATE_IN_EDITOR.getName())) { + else if (dataId.equals(DataConstants.EDITOR) || OpenFileDescriptor.NAVIGATE_IN_EDITOR.is(dataId)) { return FileEditorManager.getInstance(getProject()).getSelectedTextEditor(); } else { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RepositoryChangesBrowser.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RepositoryChangesBrowser.java index 08433ff3f03f..dc2b0cff74a4 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RepositoryChangesBrowser.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RepositoryChangesBrowser.java @@ -82,10 +82,10 @@ public class RepositoryChangesBrowser extends ChangesBrowser implements DataProv return myUseCase; } - else if (VcsDataKeys.SELECTED_CHANGES.getName().equals(dataId)) { + else if (VcsDataKeys.SELECTED_CHANGES.is(dataId)) { final List list = myViewer.getSelectedChanges(); return list.toArray(new Change [list.size()]); - } else if (VcsDataKeys.CHANGE_LEAD_SELECTION.getName().equals(dataId)) { + } else if (VcsDataKeys.CHANGE_LEAD_SELECTION.is(dataId)) { final Change highestSelection = myViewer.getHighestLeadSelection(); return (highestSelection == null) ? new Change[]{} : new Change[] {highestSelection}; } else { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangeListViewerDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangeListViewerDialog.java index fe970812ebe0..cbb9d20fa872 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangeListViewerDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangeListViewerDialog.java @@ -107,7 +107,7 @@ public class ChangeListViewerDialog extends DialogWrapper implements DataProvide } public Object getData(@NonNls final String dataId) { - if (VcsDataKeys.CHANGES.getName().equals(dataId)) { + if (VcsDataKeys.CHANGES.is(dataId)) { return myChanges; } return null; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java index 47c3cf325f03..35fe17fa2f14 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java @@ -1107,7 +1107,7 @@ public class FileHistoryPanelImpl selected, String dataId) { if (selected != null) { - if (dataId.equals(Form.DATA_KEY.getName())) { + if (Form.DATA_KEY.is(dataId)) { List
result = new ArrayList(); for(AbstractTreeNode node: selected) { if (node.getValue() instanceof Form) { diff --git a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/HighlightingOutputConsole.java b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/HighlightingOutputConsole.java index 5d15eb12d453..1ca85c94c48b 100644 --- a/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/HighlightingOutputConsole.java +++ b/plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/HighlightingOutputConsole.java @@ -93,7 +93,7 @@ public class HighlightingOutputConsole extends AdditionalTabComponent implements @Nullable public Object getData(@NonNls String dataId) { - if (dataId.equals(LangDataKeys.EDITOR.getName())) { + if (LangDataKeys.EDITOR.is(dataId)) { return getEditor(); } return null;