From 6fe92f5983f43f4fd9276151f49b70fbe02a17ef Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 4 Jul 2018 15:00:24 +0200 Subject: [PATCH] Add empty default methods to LookupListener interface --- .../codeInsight/lookup/LookupListener.java | 32 ++++++++----------- .../codeInsight/lookup/LookupAdapter.java | 19 +++-------- 2 files changed, 17 insertions(+), 34 deletions(-) diff --git a/platform/lang-api/src/com/intellij/codeInsight/lookup/LookupListener.java b/platform/lang-api/src/com/intellij/codeInsight/lookup/LookupListener.java index 9ec13dc5bc02..a705a850065d 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/lookup/LookupListener.java +++ b/platform/lang-api/src/com/intellij/codeInsight/lookup/LookupListener.java @@ -1,30 +1,24 @@ -/* - * Copyright 2000-2009 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. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.lookup; import java.util.EventListener; +/** + * Listener to receive notifications for events in lookup. + * + * @see Lookup#addLookupListener(LookupListener) + */ public interface LookupListener extends EventListener { /* * Note: this event comes inside the command that performs inserting of text into the editor. */ - void itemSelected(LookupEvent event); + default void itemSelected(LookupEvent event) { + } - void lookupCanceled(LookupEvent event); + default void lookupCanceled(LookupEvent event) { + } - void currentItemChanged(LookupEvent event); -} \ No newline at end of file + default void currentItemChanged(LookupEvent event) { + } +} diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/LookupAdapter.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/LookupAdapter.java index ddb3b96265bb..7b0d0d34c165 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/LookupAdapter.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/LookupAdapter.java @@ -1,21 +1,10 @@ -/* - * Copyright 2000-2009 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. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.lookup; +/** + * @deprecated Use LookupListener directly + */ public abstract class LookupAdapter implements LookupListener{ @Override public void itemSelected(LookupEvent event){