mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Javafx: Handle wildcard event type in the quick fix that creates event handler method. Add test for that. (IDEA-151694)
This commit is contained in:
+4
@@ -64,6 +64,10 @@ public class JavaFxEventHandlerInspectionTest extends AbstractJavaFXTestCase {
|
||||
doQuickfixTest("Create method 'void onSort(SortEvent)'");
|
||||
}
|
||||
|
||||
public void testQuickfixSuper() throws Exception {
|
||||
doQuickfixTest("Create method 'void click(MouseEvent)'");
|
||||
}
|
||||
|
||||
private void doHighlightingTest() throws Exception {
|
||||
myFixture.configureByFiles(getTestName(true) + ".fxml", getTestName(false) + ".java");
|
||||
myFixture.checkHighlighting();
|
||||
|
||||
+4
-1
@@ -112,7 +112,10 @@ public class JavaFxEventHandlerReference extends PsiReferenceBase<XmlAttributeVa
|
||||
final PsiType handlerType =
|
||||
tagClassSubstitutor != null ? tagClassSubstitutor.substitute(eventHandlerPropertyType) : eventHandlerPropertyType;
|
||||
if (handlerType instanceof PsiClassType) {
|
||||
final PsiType eventType = JavaFxPsiUtil.substituteEventType((PsiClassType)handlerType, element.getProject());
|
||||
PsiType eventType = JavaFxPsiUtil.substituteEventType((PsiClassType)handlerType, element.getProject());
|
||||
if (eventType instanceof PsiWildcardType && ((PsiWildcardType)eventType).isSuper()) {
|
||||
eventType = ((PsiWildcardType)eventType).getBound();
|
||||
}
|
||||
if (eventType != null) {
|
||||
if (eventType instanceof PsiClassType && JavaFxPsiUtil.isNotFullyResolvedGeneric((PsiClassType)eventType)) {
|
||||
canonicalText = ((PsiClassType)eventType).rawType().getCanonicalText();
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
public class QuickfixSuper{}
|
||||
@@ -0,0 +1,7 @@
|
||||
import javafx.scene.input.MouseEvent;
|
||||
|
||||
public class QuickfixSuper{
|
||||
public void click(MouseEvent mouseEvent) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<GridPane xmlns:fx="http://javafx.com/fxml" fx:controller="QuickfixSuper">
|
||||
<Label onMouseClicked="#cl<caret>ick"/>
|
||||
</GridPane>
|
||||
Reference in New Issue
Block a user