diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java index 3ce012705c0f..b7cd8af73084 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -17,14 +17,14 @@ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.CodeInsightUtilCore; import com.intellij.codeInsight.ExpectedTypeInfo; -import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx; import com.intellij.codeInsight.daemon.QuickFixBundle; +import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx; import com.intellij.codeInsight.daemon.impl.HighlightInfo; import com.intellij.codeInsight.template.Template; import com.intellij.codeInsight.template.TemplateBuilderImpl; import com.intellij.codeInsight.template.TemplateEditingAdapter; import com.intellij.lang.annotation.HighlightSeverity; -import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; @@ -259,7 +259,7 @@ public class CreateMethodFromUsageFix extends CreateFromUsageBaseFix { startTemplate(newEditor, template, project, new TemplateEditingAdapter() { @Override public void templateFinished(Template template, boolean brokenOff) { - ApplicationManager.getApplication().runWriteAction(new Runnable() { + WriteCommandAction.runWriteCommandAction(project, new Runnable() { @Override public void run() { PsiDocumentManager.getInstance(project).commitDocument(newEditor.getDocument()); diff --git a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java index 2aa495c42694..b52da3c571b6 100644 --- a/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java +++ b/java/java-impl/src/com/intellij/openapi/projectRoots/impl/JavaSdkImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -415,19 +415,6 @@ public class JavaSdkImpl extends JavaSdk { return versionString; } - @Override - @NotNull - public String getComponentName() { - return getName(); - } - - @Override - public void initComponent() { } - - @Override - public void disposeComponent() { - } - @Override public int compareTo(@NotNull String versionString, @NotNull String versionNumber) { return getVersionNumber(versionString).compareTo(versionNumber); diff --git a/java/java-tests/testSrc/com/intellij/execution/impl/RunConfigurableTest.java b/java/java-tests/testSrc/com/intellij/execution/impl/RunConfigurableTest.java index 0591489afc9c..6d1b6b1dc9b1 100644 --- a/java/java-tests/testSrc/com/intellij/execution/impl/RunConfigurableTest.java +++ b/java/java-tests/testSrc/com/intellij/execution/impl/RunConfigurableTest.java @@ -1,3 +1,18 @@ +/* + * Copyright 2000-2014 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.execution.impl; import com.intellij.execution.application.ApplicationConfigurationType; @@ -179,7 +194,6 @@ public class RunConfigurableTest extends LightIdeaTestCase { RunManagerImpl runManager = new RunManagerImpl(getProject(), PropertiesComponent.getInstance()); runManager.initializeConfigurationTypes(new ConfigurationType[]{ApplicationConfigurationType.getInstance(), JUnitConfigurationType.getInstance(), UnknownConfigurationType.INSTANCE}); - runManager.initComponent(); runManager.readExternal(element); return runManager; } diff --git a/java/openapi/src/com/intellij/openapi/projectRoots/JavaSdk.java b/java/openapi/src/com/intellij/openapi/projectRoots/JavaSdk.java index 51ae01f5c1b9..8221324356f5 100644 --- a/java/openapi/src/com/intellij/openapi/projectRoots/JavaSdk.java +++ b/java/openapi/src/com/intellij/openapi/projectRoots/JavaSdk.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -16,7 +16,6 @@ package com.intellij.openapi.projectRoots; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.projectRoots.impl.SdkVersionUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -24,7 +23,7 @@ import org.jetbrains.annotations.Nullable; import java.io.File; -public abstract class JavaSdk extends SdkType implements JavaSdkType, ApplicationComponent { +public abstract class JavaSdk extends SdkType implements JavaSdkType { public JavaSdk(@NotNull @NonNls String name) { super(name); } diff --git a/platform/analysis-api/src/com/intellij/problems/WolfTheProblemSolver.java b/platform/analysis-api/src/com/intellij/problems/WolfTheProblemSolver.java index d57e62ed9339..c4580e082fb4 100644 --- a/platform/analysis-api/src/com/intellij/problems/WolfTheProblemSolver.java +++ b/platform/analysis-api/src/com/intellij/problems/WolfTheProblemSolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -17,7 +17,6 @@ package com.intellij.problems; import com.intellij.openapi.Disposable; -import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.extensions.ExtensionPointName; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; @@ -31,7 +30,7 @@ import java.util.List; /** * @author cdr */ -public abstract class WolfTheProblemSolver implements ProjectComponent { +public abstract class WolfTheProblemSolver { public static final ExtensionPointName> FILTER_EP_NAME = ExtensionPointName.create("com.intellij.problemFileHighlightFilter"); public static WolfTheProblemSolver getInstance(Project project) { diff --git a/platform/core-api/src/com/intellij/openapi/vfs/ex/http/HttpFileSystem.java b/platform/core-api/src/com/intellij/openapi/vfs/ex/http/HttpFileSystem.java index 9f8982fc2901..9ab4fd341e87 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/ex/http/HttpFileSystem.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/ex/http/HttpFileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -16,14 +16,13 @@ package com.intellij.openapi.vfs.ex.http; import com.intellij.openapi.Disposable; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.vfs.DeprecatedVirtualFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.util.io.URLUtil; import org.jetbrains.annotations.NotNull; -public abstract class HttpFileSystem extends DeprecatedVirtualFileSystem implements ApplicationComponent { +public abstract class HttpFileSystem extends DeprecatedVirtualFileSystem { @Deprecated @SuppressWarnings("UnusedDeclaration") /** diff --git a/platform/core-impl/src/com/intellij/psi/impl/PsiDocumentManagerBase.java b/platform/core-impl/src/com/intellij/psi/impl/PsiDocumentManagerBase.java index 364c9d783799..c580f65ebfc2 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/PsiDocumentManagerBase.java +++ b/platform/core-impl/src/com/intellij/psi/impl/PsiDocumentManagerBase.java @@ -20,7 +20,6 @@ import com.intellij.injected.editor.DocumentWindow; import com.intellij.lang.injection.InjectedLanguageManager; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.event.DocumentEvent; @@ -56,7 +55,7 @@ import org.jetbrains.annotations.TestOnly; import javax.swing.*; import java.util.*; -public abstract class PsiDocumentManagerBase extends PsiDocumentManager implements ProjectComponent, DocumentListener { +public abstract class PsiDocumentManagerBase extends PsiDocumentManager implements DocumentListener { protected static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.PsiDocumentManagerImpl"); private static final Key HARD_REF_TO_PSI = new Key("HARD_REFERENCE_TO_PSI"); private static final Key> ACTION_AFTER_COMMIT = Key.create("ACTION_AFTER_COMMIT"); @@ -86,28 +85,6 @@ public abstract class PsiDocumentManagerBase extends PsiDocumentManager implemen myPsiManager.addPsiTreeChangeListener(mySynchronizer); } - @Override - public void projectOpened() { - } - - @Override - public void projectClosed() { - } - - @Override - @NotNull - public String getComponentName() { - return "PsiDocumentManager"; - } - - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - @Override @Nullable public PsiFile getPsiFile(@NotNull Document document) { diff --git a/platform/editor-ui-api/src/com/intellij/openapi/editor/EditorFactory.java b/platform/editor-ui-api/src/com/intellij/openapi/editor/EditorFactory.java index de3fc9beb902..730ff5f54996 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/editor/EditorFactory.java +++ b/platform/editor-ui-api/src/com/intellij/openapi/editor/EditorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -18,7 +18,6 @@ package com.intellij.openapi.editor; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.editor.event.EditorEventMulticaster; import com.intellij.openapi.editor.event.EditorFactoryListener; import com.intellij.openapi.fileTypes.FileType; @@ -30,7 +29,7 @@ import org.jetbrains.annotations.Nullable; /** * Provides services for creating document and editor instances. */ -public abstract class EditorFactory implements ApplicationComponent { +public abstract class EditorFactory { /** * Returns the editor factory instance. * diff --git a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightManagerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightManagerImpl.java index 1b02e32e236c..8299f59d69e1 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -24,7 +24,6 @@ import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.actionSystem.ex.ActionManagerEx; import com.intellij.openapi.actionSystem.ex.AnActionListener; -import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.EditorFactory; @@ -49,31 +48,12 @@ import org.jetbrains.annotations.Nullable; import java.awt.*; import java.util.*; -public class HighlightManagerImpl extends HighlightManager implements ProjectComponent { +public class HighlightManagerImpl extends HighlightManager { private final Project myProject; public HighlightManagerImpl(Project project) { myProject = project; - } - - @Override - @NotNull - public String getComponentName() { - return "HighlightManager"; - } - - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - - @Override - public void projectOpened() { - AnActionListener anActionListener = new MyAnActionListener(); - ActionManagerEx.getInstanceEx().addAnActionListener(anActionListener, myProject); + ActionManagerEx.getInstanceEx().addAnActionListener(new MyAnActionListener(), myProject); DocumentListener documentListener = new DocumentAdapter() { @Override @@ -102,10 +82,6 @@ public class HighlightManagerImpl extends HighlightManager implements ProjectCom EditorFactory.getInstance().getEventMulticaster().addDocumentListener(documentListener, myProject); } - @Override - public void projectClosed() { - } - @Nullable public Map getHighlightInfoMap(@NotNull Editor editor, boolean toCreate) { if (editor instanceof EditorWindow) return getHighlightInfoMap(((EditorWindow)editor).getDelegate(), toCreate); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/problems/MockWolfTheProblemSolver.java b/platform/lang-impl/src/com/intellij/codeInsight/problems/MockWolfTheProblemSolver.java index 75ad56ed5497..eeb5e04b8aab 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/problems/MockWolfTheProblemSolver.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/problems/MockWolfTheProblemSolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -22,7 +22,6 @@ import com.intellij.openapi.util.Condition; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.problems.Problem; import com.intellij.problems.WolfTheProblemSolver; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import java.util.Collection; @@ -83,33 +82,6 @@ public class MockWolfTheProblemSolver extends WolfTheProblemSolver { if (myDelegate != null) myDelegate.queue(suspiciousFile); } - @Override - public void projectOpened() { - if (myDelegate != null) myDelegate.projectOpened(); - } - - @Override - public void projectClosed() { - if (myDelegate != null) myDelegate.projectClosed(); - } - - @Override - @NonNls - @NotNull - public String getComponentName() { - return "mockwolf"; - } - - @Override - public void initComponent() { - - } - - @Override - public void disposeComponent() { - - } - @Override public void clearProblems(@NotNull VirtualFile virtualFile) { if (myDelegate != null) myDelegate.clearProblems(virtualFile); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/problems/WolfTheProblemSolverImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/problems/WolfTheProblemSolverImpl.java index 6cfbe08635d5..45b4532713c4 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/problems/WolfTheProblemSolverImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/problems/WolfTheProblemSolverImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -44,7 +44,6 @@ import com.intellij.psi.*; import com.intellij.util.containers.ContainerUtil; import gnu.trove.THashMap; import gnu.trove.THashSet; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -218,31 +217,6 @@ public class WolfTheProblemSolverImpl extends WolfTheProblemSolver { } } - @Override - public void projectOpened() { - } - - @Override - public void projectClosed() { - } - - @Override - @NotNull - @NonNls - public String getComponentName() { - return "Problems"; - } - - @Override - public void initComponent() { - - } - - @Override - public void disposeComponent() { - - } - public void startCheckingIfVincentSolvedProblemsYet(@NotNull ProgressIndicator progress, @NotNull ProgressableTextEditorHighlightingPass pass) throws ProcessCanceledException { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateManagerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateManagerImpl.java index 366fe62d97f2..6a11b5897dda 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateManagerImpl.java @@ -24,7 +24,6 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.command.WriteCommandAction; -import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.event.EditorFactoryAdapter; import com.intellij.openapi.editor.event.EditorFactoryEvent; @@ -47,7 +46,7 @@ import org.jetbrains.annotations.TestOnly; import java.util.*; -public class TemplateManagerImpl extends TemplateManager implements ProjectComponent, Disposable { +public class TemplateManagerImpl extends TemplateManager implements Disposable { protected Project myProject; private boolean myTemplateTesting; @@ -55,26 +54,6 @@ public class TemplateManagerImpl extends TemplateManager implements ProjectCompo public TemplateManagerImpl(Project project) { myProject = project; - } - - @Override - public void disposeComponent() { - } - - @Override - public void dispose() { - } - - @Override - public void initComponent() { - } - - @Override - public void projectClosed() { - } - - @Override - public void projectOpened() { final EditorFactoryListener myEditorFactoryListener = new EditorFactoryAdapter() { @Override public void editorReleased(@NotNull EditorFactoryEvent event) { @@ -91,6 +70,11 @@ public class TemplateManagerImpl extends TemplateManager implements ProjectCompo EditorFactory.getInstance().addEditorFactoryListener(myEditorFactoryListener, myProject); } + @Override + public void dispose() { + + } + @TestOnly @Deprecated public void setTemplateTesting(final boolean templateTesting) { @@ -540,12 +524,6 @@ public class TemplateManagerImpl extends TemplateManager implements ProjectCompo return Extensions.getExtensions(TemplateContextType.EP_NAME); } - @Override - @NotNull - public String getComponentName() { - return "TemplateManager"; - } - @Override @Nullable public Template getActiveTemplate(@NotNull Editor editor) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java index 165e2be8b320..548264e4676b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java @@ -26,6 +26,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandAdapter; import com.intellij.openapi.command.CommandEvent; import com.intellij.openapi.command.CommandProcessor; +import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.command.undo.BasicUndoableAction; import com.intellij.openapi.command.undo.DocumentReference; import com.intellij.openapi.command.undo.DocumentReferenceManager; @@ -116,9 +117,9 @@ public class TemplateState implements Disposable { public void commandStarted(CommandEvent event) { if (myEditor != null) { final int offset = myEditor.getCaretModel().getOffset(); - myDocumentChangesTerminateTemplate = (myCurrentSegmentNumber >= 0 && + myDocumentChangesTerminateTemplate = myCurrentSegmentNumber >= 0 && (offset < mySegments.getSegmentStart(myCurrentSegmentNumber) || - offset > mySegments.getSegmentEnd(myCurrentSegmentNumber))); + offset > mySegments.getSegmentEnd(myCurrentSegmentNumber)); } started = true; } @@ -393,13 +394,8 @@ public class TemplateState implements Disposable { } private String getRangesDebugInfo() { - return myTemplateRange.toString() + - "\ntemplateKey: " + - myTemplate.getKey() + - "\ntemplateText: " + - myTemplate.getTemplateText() + - "\ntemplateString: " + - myTemplate.getString(); + return myTemplateRange + "\ntemplateKey: " + myTemplate.getKey() + "\ntemplateText: " + myTemplate.getTemplateText() + + "\ntemplateString: " + myTemplate; } private void doReformat(final TextRange range) { @@ -479,7 +475,7 @@ public class TemplateState implements Disposable { } String message = template.getKey(); - if (message == null || message.length() == 0) { + if (message == null || message.isEmpty()) { message = template.getString(); if (message == null) { message = template.getTemplateText(); @@ -633,7 +629,7 @@ public class TemplateState implements Disposable { if (myProcessor != null && myCurrentVariableNumber >= 0) { final String variableName = myTemplate.getVariableNameAt(myCurrentVariableNumber); final TextResult value = getVariableValue(variableName); - if (value != null && value.getText().length() > 0) { + if (value != null && !value.getText().isEmpty()) { if (!myProcessor.process(variableName, value.getText())) { finishTemplateEditing(false); // nextTab(); ? return; @@ -643,7 +639,7 @@ public class TemplateState implements Disposable { fixOverlappedSegments(myCurrentSegmentNumber); - ApplicationManager.getApplication().runWriteAction(new Runnable() { + WriteCommandAction.runWriteCommandAction(myProject, new Runnable() { @Override public void run() { BitSet calcedSegments = new BitSet(); @@ -1146,7 +1142,7 @@ public class TemplateState implements Disposable { final int offset = mySegments.getSegmentStart(endSegmentNumber); final int lineStart = myDocument.getLineStartOffset(myDocument.getLineNumber(offset)); // if $END$ is at line start, put it at correct indentation - if (myDocument.getCharsSequence().subSequence(lineStart, offset).toString().trim().length() == 0) { + if (myDocument.getCharsSequence().subSequence(lineStart, offset).toString().trim().isEmpty()) { final int adjustedOffset = style.adjustLineIndent(file, offset); mySegments.replaceSegmentAt(endSegmentNumber, adjustedOffset, adjustedOffset); } diff --git a/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.java b/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.java index d33cf8dcb298..d3a1e1cb0574 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/RunManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -20,7 +20,8 @@ import com.intellij.ProjectTopics; import com.intellij.execution.*; import com.intellij.execution.configurations.*; import com.intellij.ide.util.PropertiesComponent; -import com.intellij.openapi.components.ProjectComponent; +import com.intellij.openapi.Disposable; +import com.intellij.openapi.components.NamedComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; @@ -43,7 +44,7 @@ import javax.swing.*; import java.util.*; -public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable, ProjectComponent { +public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable, NamedComponent, Disposable { private static final Logger LOG = Logger.getInstance("#com.intellij.execution.impl.RunManagerImpl"); private final Project myProject; @@ -61,9 +62,9 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable, @Nullable private String myLoadedSelectedConfigurationUniqueName = null; @Nullable private String mySelectedConfigurationId = null; - private Map myIdToIcon = new HashMap(); - private Map myIconCheckTimes = new HashMap(); - private Map myIconCalcTime = Collections.synchronizedMap(new HashMap()); + private final Map myIdToIcon = new HashMap(); + private final Map myIconCheckTimes = new HashMap(); + private final Map myIconCalcTime = Collections.synchronizedMap(new HashMap()); @NonNls protected static final String CONFIGURATION = "configuration"; @@ -78,7 +79,7 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable, @NonNls private static final String OPTION = "option"; private List myUnknownElements = null; - private JDOMExternalizableStringList myOrder = new JDOMExternalizableStringList(); + private final JDOMExternalizableStringList myOrder = new JDOMExternalizableStringList(); private final ArrayList myRecentlyUsedTemporaries = new ArrayList(); private boolean myOrdered = true; @@ -127,18 +128,6 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable, initializeConfigurationTypes(configurationTypes); } - @Override - public void disposeComponent() { - } - - @Override - public void initComponent() { - } - - @Override - public void projectOpened() { - } - @Override @NotNull public RunnerAndConfigurationSettings createConfiguration(@NotNull final String name, @NotNull final ConfigurationFactory factory) { @@ -171,7 +160,7 @@ public class RunManagerImpl extends RunManagerEx implements JDOMExternalizable, } @Override - public void projectClosed() { + public void dispose() { myTemplateConfigurationsMap.clear(); } diff --git a/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java b/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java index 7d78cf10e2cc..e1366431efd0 100644 --- a/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java +++ b/platform/lang-impl/src/com/intellij/formatting/FormatterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -19,7 +19,6 @@ package com.intellij.formatting; import com.intellij.lang.ASTNode; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.fileTypes.FileType; @@ -47,13 +46,11 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; public class FormatterImpl extends FormatterEx - implements ApplicationComponent, - IndentFactory, + implements IndentFactory, WrapFactory, AlignmentFactory, SpacingFactory, - FormattingModelFactory -{ + FormattingModelFactory { private static final Logger LOG = Logger.getInstance("#com.intellij.formatting.FormatterImpl"); private final AtomicReference myProgressTask = new AtomicReference(); @@ -797,20 +794,6 @@ public class FormatterImpl extends FormatterEx } } - @Override - @NotNull - public String getComponentName() { - return "FormatterEx"; - } - - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - @Override public Indent getAbsoluteNoneIndent() { return myAbsoluteNoneIndent; diff --git a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureGestureDetector.java b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureGestureDetector.java index 5693e3ad363b..503537873808 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureGestureDetector.java +++ b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureGestureDetector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -18,7 +18,6 @@ package com.intellij.refactoring.changeSignature; import com.intellij.codeInsight.template.TemplateManager; import com.intellij.openapi.Disposable; import com.intellij.openapi.command.CommandProcessor; -import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; @@ -56,7 +55,7 @@ import java.util.Map; * User: anna * Date: Sep 6, 2010 */ -public class ChangeSignatureGestureDetector extends PsiTreeChangeAdapter implements ProjectComponent, EditorFactoryListener { +public class ChangeSignatureGestureDetector extends PsiTreeChangeAdapter implements EditorFactoryListener, Disposable { private final Map myListenerMap = new HashMap(); private static final Logger LOG = Logger.getInstance("#" + ChangeSignatureGestureDetector.class.getName()); private boolean myDeaf = false; @@ -79,6 +78,14 @@ public class ChangeSignatureGestureDetector extends PsiTreeChangeAdapter impleme myFileEditorManager = fileEditorManager; myProject = project; myTemplateManager = templateManager; + myPsiManager.addPsiTreeChangeListener(this, this); + EditorFactory.getInstance().addEditorFactoryListener(this, this); + Disposer.register(this, new Disposable() { + @Override + public void dispose() { + LOG.assertTrue(myListenerMap.isEmpty(), myListenerMap); + } + }); } public static ChangeSignatureGestureDetector getInstance(Project project){ @@ -137,37 +144,6 @@ public class ChangeSignatureGestureDetector extends PsiTreeChangeAdapter impleme } } - @Override - public void projectOpened() { - myPsiManager.addPsiTreeChangeListener(this); - EditorFactory.getInstance().addEditorFactoryListener(this, myProject); - Disposer.register(myProject, new Disposable() { - @Override - public void dispose() { - myPsiManager.removePsiTreeChangeListener(ChangeSignatureGestureDetector.this); - LOG.assertTrue(myListenerMap.isEmpty(), myListenerMap); - } - }); - } - - @Override - public void projectClosed() { - } - - @NotNull - @Override - public String getComponentName() { - return "ChangeSignatureGestureDetector"; - } - - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - @Override public void beforeChildRemoval(@NotNull PsiTreeChangeEvent event) { final PsiElement child = event.getChild(); @@ -396,4 +372,9 @@ public class ChangeSignatureGestureDetector extends PsiTreeChangeAdapter impleme myCurrentInfo = null; } } + + @Override + public void dispose() { + + } } diff --git a/platform/platform-impl/src/com/intellij/ide/FrameStateManagerImpl.java b/platform/platform-impl/src/com/intellij/ide/FrameStateManagerImpl.java index 06c419a4ff15..726c8e5e1fb5 100644 --- a/platform/platform-impl/src/com/intellij/ide/FrameStateManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/FrameStateManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -18,20 +18,18 @@ package com.intellij.ide; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationActivationListener; import com.intellij.openapi.application.impl.ApplicationImpl; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.util.ActionCallback; import com.intellij.openapi.util.BusyObject; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.wm.IdeFrame; import com.intellij.util.Alarm; import com.intellij.util.containers.ContainerUtil; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; -public class FrameStateManagerImpl extends FrameStateManager implements ApplicationComponent { +public class FrameStateManagerImpl extends FrameStateManager { private final List myListeners = ContainerUtil.createLockFreeCopyOnWriteList(); private boolean myShouldSynchronize; @@ -84,21 +82,6 @@ public class FrameStateManagerImpl extends FrameStateManager implements Applicat return myActive.getReady(this); } - @Override - @NotNull - @NonNls - public String getComponentName() { - return "FrameStateManager"; - } - - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - private void fireDeactivationEvent() { for (FrameStateListener listener : myListeners) { listener.onFrameDeactivated(); diff --git a/platform/platform-impl/src/com/intellij/ide/impl/DataManagerImpl.java b/platform/platform-impl/src/com/intellij/ide/impl/DataManagerImpl.java index aeb9e6577dd9..bea92c9626b9 100644 --- a/platform/platform-impl/src/com/intellij/ide/impl/DataManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/impl/DataManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -20,7 +20,6 @@ import com.intellij.ide.IdeEventQueue; import com.intellij.ide.impl.dataRules.*; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ModalityState; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.extensions.Extensions; @@ -48,7 +47,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -public class DataManagerImpl extends DataManager implements ApplicationComponent { +public class DataManagerImpl extends DataManager { private static final Logger LOG = Logger.getInstance("#com.intellij.ide.impl.DataManagerImpl"); private final Map myDataConstantToRuleMap = new THashMap(); private WindowManagerEx myWindowManager; @@ -57,14 +56,6 @@ public class DataManagerImpl extends DataManager implements ApplicationComponent registerRules(); } - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - @Nullable private Object getData(@NotNull String dataId, final Component focusedComponent) { for (Component c = focusedComponent; c != null; c = c.getParent()) { @@ -284,12 +275,6 @@ public class DataManagerImpl extends DataManager implements ApplicationComponent myDataConstantToRuleMap.put(CommonDataKeys.EDITOR_EVEN_IF_INACTIVE.getName(), new InactiveEditorRule()); } - @Override - @NotNull - public String getComponentName() { - return "DataManager"; - } - @Override public void saveInDataContext(DataContext dataContext, @NotNull Key dataKey, @Nullable T data) { if (dataContext instanceof UserDataHolder) { diff --git a/platform/platform-impl/src/com/intellij/internal/statistic/persistence/UsageStatisticsPersistenceComponent.java b/platform/platform-impl/src/com/intellij/internal/statistic/persistence/UsageStatisticsPersistenceComponent.java index 273e5803426e..65298387a902 100644 --- a/platform/platform-impl/src/com/intellij/internal/statistic/persistence/UsageStatisticsPersistenceComponent.java +++ b/platform/platform-impl/src/com/intellij/internal/statistic/persistence/UsageStatisticsPersistenceComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -42,7 +42,7 @@ import java.util.Set; )} ) public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersistenceComponent - implements ApplicationComponent, PersistentStateComponent { + implements NamedComponent, PersistentStateComponent { @NonNls private boolean isAllowed = false; @NonNls private boolean isShowNotification = true; @@ -171,12 +171,4 @@ public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersiste public String getComponentName() { return "SentUsagesPersistenceComponent"; } - - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java index 611a7c21260d..42abddccfc6b 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -20,6 +20,7 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityStateListener; import com.intellij.openapi.application.impl.LaterInvocator; +import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; @@ -45,7 +46,7 @@ import org.jetbrains.annotations.NotNull; import java.util.List; -public class EditorFactoryImpl extends EditorFactory { +public class EditorFactoryImpl extends EditorFactory implements ApplicationComponent { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.editor.impl.EditorFactoryImpl"); private final EditorEventMulticasterImpl myEditorEventMulticaster = new EditorEventMulticasterImpl(); private final EventDispatcher myEditorFactoryEventDispatcher = EventDispatcher.create(EditorFactoryListener.class); diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/VisibleEditorsTracker.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/VisibleEditorsTracker.java index 1c380a0f07df..bacbf42ec614 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/VisibleEditorsTracker.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/VisibleEditorsTracker.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -19,15 +19,13 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandAdapter; import com.intellij.openapi.command.CommandEvent; import com.intellij.openapi.command.CommandProcessor; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.EditorFactory; -import org.jetbrains.annotations.NotNull; import java.util.HashSet; import java.util.Set; -public class VisibleEditorsTracker extends CommandAdapter implements ApplicationComponent{ +public class VisibleEditorsTracker extends CommandAdapter { private final Set myEditorsVisibleOnCommandStart = new HashSet(); private long myCurrentCommandStart; private long myLastCommandFinish; @@ -41,20 +39,6 @@ public class VisibleEditorsTracker extends CommandAdapter implements Application commandProcessor.addCommandListener(this); } - @Override - @NotNull - public String getComponentName() { - return "VisibleEditorsTracker"; - } - - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - public boolean wasEditorVisibleOnCommandStart(Editor editor){ return myEditorsVisibleOnCommandStart.contains(editor); } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java index 1a3159f200a0..89521379cc29 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java @@ -23,7 +23,6 @@ import com.intellij.openapi.application.AccessToken; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.command.UndoConfirmationPolicy; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diff.DiffManager; import com.intellij.openapi.diff.DocumentContent; @@ -41,7 +40,9 @@ import com.intellij.openapi.editor.impl.EditorFactoryImpl; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.*; import com.intellij.openapi.fileEditor.impl.text.TextEditorImpl; -import com.intellij.openapi.fileTypes.*; +import com.intellij.openapi.fileTypes.BinaryFileTypeDecompilers; +import com.intellij.openapi.fileTypes.FileType; +import com.intellij.openapi.fileTypes.UnknownFileType; import com.intellij.openapi.project.*; import com.intellij.openapi.project.ex.ProjectEx; import com.intellij.openapi.ui.DialogBuilder; @@ -84,7 +85,7 @@ import java.lang.reflect.Proxy; import java.util.*; import java.util.List; -public class FileDocumentManagerImpl extends FileDocumentManager implements ApplicationComponent, VirtualFileListener, +public class FileDocumentManagerImpl extends FileDocumentManager implements VirtualFileListener, ProjectManagerListener, SafeWriteRequestor { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl"); @@ -152,20 +153,6 @@ public class FileDocumentManagerImpl extends FileDocumentManager implements Appl } } - @Override - @NotNull - public String getComponentName() { - return "FileDocumentManager"; - } - - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - @Override @Nullable public Document getDocument(@NotNull final VirtualFile file) { diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpFileSystemBase.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpFileSystemBase.java index 7665e9496a99..752442007413 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpFileSystemBase.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpFileSystemBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -69,19 +69,13 @@ public abstract class HttpFileSystemBase extends HttpFileSystem { return file instanceof HttpVirtualFile && ((HttpVirtualFile)file).getFileInfo().getState() == RemoteFileState.DOWNLOADED; } - @Override - public void disposeComponent() { - } - - @Override - public void initComponent() { } - @Override @NotNull public VirtualFile createChildDirectory(Object requestor, @NotNull VirtualFile vDir, @NotNull String dirName) throws IOException { throw new UnsupportedOperationException(); } + @NotNull @Override public VirtualFile createChildFile(Object requestor, @NotNull VirtualFile vDir, @NotNull String fileName) throws IOException { throw new UnsupportedOperationException(); @@ -97,6 +91,7 @@ public abstract class HttpFileSystemBase extends HttpFileSystem { throw new UnsupportedOperationException(); } + @NotNull @Override public VirtualFile copyFile(Object requestor, @NotNull VirtualFile vFile, @NotNull VirtualFile newParent, @NotNull final String copyName) throws IOException { throw new UnsupportedOperationException(); diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpFileSystemImpl.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpFileSystemImpl.java index 02a102c4f71b..9f36af3ce928 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpFileSystemImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpFileSystemImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -16,7 +16,6 @@ package com.intellij.openapi.vfs.impl.http; import com.intellij.util.io.URLUtil; -import org.jetbrains.annotations.NotNull; /** * @author nik @@ -30,9 +29,4 @@ public class HttpFileSystemImpl extends HttpFileSystemBase { return (HttpFileSystemImpl)getInstance(); } - @Override - @NotNull - public String getComponentName() { - return "HttpFileSystem"; - } } diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpsFileSystem.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpsFileSystem.java index e9e53fa1fac5..e1068db3eebd 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpsFileSystem.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/http/HttpsFileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -17,7 +17,6 @@ package com.intellij.openapi.vfs.impl.http; import com.intellij.openapi.vfs.VirtualFileManager; import org.jetbrains.annotations.NonNls; -import org.jetbrains.annotations.NotNull; /** * @author nik @@ -33,9 +32,4 @@ public class HttpsFileSystem extends HttpFileSystemBase { return (HttpsFileSystem)VirtualFileManager.getInstance().getFileSystem(HTTPS_PROTOCOL); } - @Override - @NotNull - public String getComponentName() { - return "HttpsFileSystem"; - } } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/TestWindowManager.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/TestWindowManager.java index 413386bb9daa..b2fc056d0a71 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/TestWindowManager.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/TestWindowManager.java @@ -16,7 +16,6 @@ package com.intellij.openapi.wm.impl; import com.intellij.openapi.Disposable; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.TaskInfo; import com.intellij.openapi.project.Project; @@ -45,7 +44,7 @@ import java.util.List; * @author Anton Katilin * @author Vladimir Kondratyev */ -public final class TestWindowManager extends WindowManagerEx implements ApplicationComponent{ +public final class TestWindowManager extends WindowManagerEx { private static final StatusBarEx ourStatusBar = new DummyStatusBar(); public final void doNotSuggestAsParent(final Window window) { } @@ -338,18 +337,6 @@ public final class TestWindowManager extends WindowManagerEx implements Applicat @Override public void adjustContainerWindow(Component c, Dimension oldSize, Dimension newSize) { } - @Override - @NotNull - public final String getComponentName() { - return "TestWindowManager"; - } - - @Override - public final void initComponent() { } - - @Override - public final void disposeComponent() { } - @Override public void addListener(final WindowManagerListener listener) { } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java index 36012ed2c66a..19131753b5ba 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java @@ -69,7 +69,7 @@ import java.util.Set; name = "WindowManager", roamingType = RoamingType.GLOBAL, storages = {@Storage(file = StoragePathMacros.APP_CONFIG + "/window.manager.xml")}) -public final class WindowManagerImpl extends WindowManagerEx implements ApplicationComponent, PersistentStateComponent { +public final class WindowManagerImpl extends WindowManagerEx implements NamedComponent, PersistentStateComponent { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.wm.impl.WindowManagerImpl"); @NonNls public static final String FULL_SCREEN = "ide.frame.full.screen"; @@ -404,13 +404,6 @@ public final class WindowManagerImpl extends WindowManagerEx implements Applicat } } - @Override - public final void disposeComponent() {} - - @Override - public final void initComponent() { - } - @Override public final void doNotSuggestAsParent(final Window window) { myWindowWatcher.doNotSuggestAsParent(window); diff --git a/platform/projectModel-impl/src/com/intellij/application/options/PathMacrosImpl.java b/platform/projectModel-impl/src/com/intellij/application/options/PathMacrosImpl.java index 493b21d85306..cce7a68526bd 100644 --- a/platform/projectModel-impl/src/com/intellij/application/options/PathMacrosImpl.java +++ b/platform/projectModel-impl/src/com/intellij/application/options/PathMacrosImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -17,8 +17,8 @@ package com.intellij.application.options; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.PathMacros; -import com.intellij.openapi.components.ApplicationComponent; import com.intellij.openapi.components.ExpandMacroToPathMap; +import com.intellij.openapi.components.NamedComponent; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.NamedJDOMExternalizable; @@ -39,7 +39,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; /** * @author dsl */ -public class PathMacrosImpl extends PathMacros implements ApplicationComponent, NamedJDOMExternalizable, RoamingTypeDisabled { +public class PathMacrosImpl extends PathMacros implements NamedComponent, NamedJDOMExternalizable, RoamingTypeDisabled { private static final Logger LOG = Logger.getInstance("#com.intellij.application.options.PathMacrosImpl"); private final Map myLegacyMacros = new HashMap(); private final Map myMacros = new HashMap(); @@ -147,14 +147,6 @@ public class PathMacrosImpl extends PathMacros implements ApplicationComponent, return "PathMacrosImpl"; } - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - @Override public String getExternalFileName() { return EXT_FILE_NAME; diff --git a/platform/testFramework/src/com/intellij/mock/MockEditorFactory.java b/platform/testFramework/src/com/intellij/mock/MockEditorFactory.java index fa9a832be149..37d365e27baa 100644 --- a/platform/testFramework/src/com/intellij/mock/MockEditorFactory.java +++ b/platform/testFramework/src/com/intellij/mock/MockEditorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -119,16 +119,4 @@ public class MockEditorFactory extends EditorFactory { public void refreshAllEditors() { } - @Override - @NotNull - public String getComponentName() { - return "mockeditorfactory"; - } - - @Override - public void initComponent() { } - - @Override - public void disposeComponent() { - } } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java index 3191f1936887..04ab04f10600 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2014 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. @@ -64,7 +64,7 @@ import java.util.*; storages = {@Storage( file = StoragePathMacros.WORKSPACE_FILE)}) public class XDebuggerManagerImpl extends XDebuggerManager - implements ProjectComponent, PersistentStateComponent { + implements NamedComponent, PersistentStateComponent { @NonNls public static final String COMPONENT_NAME = "XDebuggerManager"; private final Project myProject; private final XBreakpointManagerImpl myBreakpointManager; @@ -148,28 +148,12 @@ public class XDebuggerManagerImpl extends XDebuggerManager return myProject; } - @Override - public void projectOpened() { - } - - @Override - public void projectClosed() { - } - @NotNull @Override public String getComponentName() { return COMPONENT_NAME; } - @Override - public void initComponent() { - } - - @Override - public void disposeComponent() { - } - @Override @NotNull public XDebugSession startSession(@NotNull final ProgramRunner runner,