Extend a class

Is there a simple way (keyboard shortcut) to create a new class extending current one - just like "Implement interface" action? I can't find it...

5 comments
Comment actions Permalink

Hello Igor,

Is there a simple way (keyboard shortcut) to create a new class
extending current one - just like "Implement interface" action? I
can't find it...


http://www.intellij.org/twiki/bin/view/Main/LineagePlugin
http://plugins.intellij.net/plugins/view/?id=Lineage

--
Serge Baranov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Thanks a lot! A bit concerned that last update has been a year ago...
Shouldn't this be a part of core functionality? Creating subclasses is a very common task :)

0
Comment actions Permalink

Igor Romanov wrote:

Thanks a lot! A bit concerned that last update has been a year ago...


Report a bug and I will release a new version pretty quickly. But I
haven't had a bug report for more than a year now. Feature requests take
a little bit longer:-)

Bas

0
Comment actions Permalink

Oooh! Oooh! I've got one! It just hit me Friday!

When you change an abstract class to an interface, type parameters on any "extends" clauses for that abstract class don't show up on the "implements" clause created for the interface. Thus a class that looked like


public class Derived extends Base]]>
{
...
}

ends up

public class Derived implements Base //note lack of parameter
{
...
}

when you change Base from an abstract class to an interface. The resulting code will almost certainly be uncompilable.

--Dave Griffith

0
Comment actions Permalink

Ah, a customer. You have a problem you say? Ah, I see the issue, I am
sorry for the inconvenience.
It seems there is a problem in the quick fix for the "class may be
interface" inspection (part of InspectionGadgets) as well as the
"Convert interface to class" intention (part of IntentionPowerPack in
Demetra). I will put our people to work to fix this issue in all three
products.
Sorry for your troubles and thank you for choosing Lineage for your
subclassing needs;-)

Bas


Dave Griffith wrote:

Oooh! Oooh! I've got one! It just hit me Friday!

When you change an abstract class to an interface, type parameters on any "extends" clauses for that abstract class don't show up on the "implements" clause created for the interface. Thus a class that looked like


public class Derived extends Base<Foo>
{
...
}

ends up

public class Derived implements Base //note lack of parameter
{
...
}

when you change Base from an abstract class to an interface. The resulting code will almost certainly be uncompilable.

--Dave Griffith

0

Please sign in to leave a comment.