I have a subclass that has an extra method from the superclass so when I need to use that method I need to cast the superclass.
I was wondering if this was a violation of programming to an interface?
If it is, what would be the tradeoff of implementing a blank method of the subclass in the superclass and overriding it just in the subclass that I need it? And if this would make it programming to an interface?
If a method is meaningless in the superclass, adding it there simply to avoid casting is not a good idea. If a method is meaningful in the superclass, and it should reasonably take no action there, then you should put the method in the superclass and override it in the subclass. If the functionality of the added method does not belong in a superclass at all, add and implement a second interface in your subclass, and program to that interface instead when you need the additional functionality.
Edit: You can add an interface
WithText, and add it to the subclass that needssetText. If you add more subclasses that needsetText, make them implement that interface too.