AbstractHint and JFrame from mattise

View: New views
3 Messages — Rating Filter:   Alert me  

AbstractHint and JFrame from mattise

by Bugzilla from hlavki@hlavki.eu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello,

I am writting java hint to generate serialVersionUID. It works on most cases, but when I have JFrame generated from wizard (File -> New File ...)
it doesn't work.

Code fragment is here:
    public List<ErrorDescription> run(CompilationInfo info, TreePath treePath) {
        try {
            treePath = Utilities.getPathElementOfKind(Tree.Kind.CLASS, treePath);
            TypeElement typeElement = (TypeElement) info.getTrees().getElement(treePath);
            System.out.println(typeElement.asType().toString());

In normal cases it writes class name with package e.g. com.sample.HelloWorld.
But for generated JFrame it writes <anonymous java.lang.Runnable>

How can I get type element for JFrame class in correct way??

thanks, m.


smime.p7s (2K) Download Attachment

RES: AbstractHint and JFrame from mattise

by Eduardo Maurício da Costa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michal,

There's such project already (available from Plugin catalog)... Are you
related to that project or implementing another version?

Regards,
Eduardo

-----Mensagem original-----
De: Michal Hlavac [mailto:hlavki@...]
Enviada em: quarta-feira, 16 de julho de 2008 04:19
Para: dev@...
Assunto: [openide-dev] AbstractHint and JFrame from mattise

hello,

I am writting java hint to generate serialVersionUID. It works on most
cases, but when I have JFrame generated from wizard (File -> New File ...)
it doesn't work.

Code fragment is here:
    public List<ErrorDescription> run(CompilationInfo info, TreePath
treePath) {
        try {
            treePath = Utilities.getPathElementOfKind(Tree.Kind.CLASS,
treePath);
            TypeElement typeElement = (TypeElement)
info.getTrees().getElement(treePath);
            System.out.println(typeElement.asType().toString());

In normal cases it writes class name with package e.g.
com.sample.HelloWorld.
But for generated JFrame it writes <anonymous java.lang.Runnable>

How can I get type element for JFrame class in correct way??

thanks, m.


--
Esta mensagem foi verificada pelo sistema de antivírus e
 acredita-se estar livre de perigo.


Re: RES: AbstractHint and JFrame from mattise

by Bugzilla from hlavki@hlavki.eu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dňa Wednesday 16 July 2008 12:54:06 Eduardo Maurício da Costa ste napísal:
> Michal,
>
> There's such project already (available from Plugin catalog)... Are you
> related to that project or implementing another version?

Hi Eduardo,

yes, it's my project ;) and it contains this bug...

m.


smime.p7s (2K) Download Attachment
LightInTheBox - Buy quality products at wholesale price