Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
60199511
Commit
60199511
authored
6 years ago
by
Artem Khvastunov
Browse files
Options
Download
Email Patches
Plain Diff
add default implementation to ChangeSignatureHandler#findTargetMember(Editor)
parent
6f22a0b1
Branches unavailable
Tags unavailable
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureHandler.java
+1
-22
...factoring/changeSignature/JavaChangeSignatureHandler.java
platform/lang-api/src/com/intellij/refactoring/changeSignature/ChangeSignatureHandler.java
+5
-16
...j/refactoring/changeSignature/ChangeSignatureHandler.java
with
6 additions
and
38 deletions
+6
-38
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureHandler.java
+
1
-
22
View file @
60199511
/*
* Copyright 2000-2016 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.refactoring.changeSignature
;
import
com.intellij.codeInsight.JavaTargetElementEvaluator
;
...
...
@@ -165,13 +151,6 @@ public class JavaChangeSignatureHandler implements ChangeSignatureHandler {
//}
}
@Override
@Nullable
public
PsiElement
findTargetMember
(
@NotNull
PsiFile
file
,
@NotNull
Editor
editor
)
{
PsiElement
element
=
file
.
findElementAt
(
editor
.
getCaretModel
().
getOffset
());
return
findTargetMember
(
element
);
}
@Override
public
PsiElement
findTargetMember
(
PsiElement
element
)
{
if
(
PsiTreeUtil
.
getParentOfType
(
element
,
PsiParameterList
.
class
)
!=
null
)
{
...
...
This diff is collapsed.
Click to expand it.
platform/lang-api/src/com/intellij/refactoring/changeSignature/ChangeSignatureHandler.java
+
5
-
16
View file @
60199511
/*
* Copyright 2000-2010 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.refactoring.changeSignature
;
import
com.intellij.openapi.actionSystem.DataContext
;
...
...
@@ -32,7 +18,10 @@ public interface ChangeSignatureHandler extends RefactoringActionHandler {
String
REFACTORING_NAME
=
RefactoringBundle
.
message
(
"changeSignature.refactoring.name"
);
@Nullable
PsiElement
findTargetMember
(
@NotNull
PsiFile
file
,
@NotNull
Editor
editor
);
default
PsiElement
findTargetMember
(
@NotNull
PsiFile
file
,
@NotNull
Editor
editor
)
{
PsiElement
element
=
file
.
findElementAt
(
editor
.
getCaretModel
().
getOffset
());
return
element
!=
null
?
findTargetMember
(
element
)
:
null
;
}
@Nullable
PsiElement
findTargetMember
(
PsiElement
element
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help