create constructor from usage: use "override method body" template when super class contains no default constructor

This commit is contained in:
anna
2011-02-08 18:41:34 +01:00
parent 34aa1a7d2a
commit 1c8936875f
8 changed files with 94 additions and 6 deletions
@@ -0,0 +1,16 @@
// "Create Constructor" "true"
class Test extends A{
public Test(String a) {
<selection>//To change body of created methods use File | Settings | File Templates.</selection>
}
public void t() {
new Test("a"){};
}
}
class A {
A(String s){}
A(){}
}
@@ -0,0 +1,14 @@
// "Create Constructor" "true"
class Test extends A{
public Test(String a) {
<selection>//To change body of created methods use File | Settings | File Templates.</selection>
}
public void t() {
new Test("a"){};
}
}
class A {
}
@@ -0,0 +1,15 @@
// "Create Constructor" "true"
class Test extends A{
public Test(String a) {
<selection>super(a); //To change body of overridden methods use File | Settings | File Templates.</selection>
}
public void t() {
new Test("a"){};
}
}
class A {
A(String s){}
}
@@ -0,0 +1,12 @@
// "Create Constructor" "true"
class Test extends A{
public void t() {
new Test(<caret>"a"){};
}
}
class A {
A(String s){}
A(){}
}
@@ -0,0 +1,10 @@
// "Create Constructor" "true"
class Test extends A{
public void t() {
new Test(<caret>"a"){};
}
}
class A {
}
@@ -0,0 +1,11 @@
// "Create Constructor" "true"
class Test extends A{
public void t() {
new Test(<caret>"a"){};
}
}
class A {
A(String s){}
}