Show content of elements in packaging element doesn't work

I have defined my own element for artifact and extended from ComplexPackagingElement. Method getSubstitution returns several DirectoryCopyPackagingElement elements. Also in my class extended from ComplexPackagingElementType I have override getShowContentActionText with my action name. But "Show show content of elements" check box doesn't make any action on my element, it still rendering as describing in my PackagingElementPresentation class. How do I get it to work?

Thanks in advance!

9 comments
Comment actions Permalink

Is your item shown in the list when you click on '...' button to the right of 'Show content of elements' checkbox?

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Yes, it is in that list.

0
Comment actions Permalink

Hmm, I have no ideas. You can try to debug the problem yourself. Put a breakpoint in CompositePackagingElementNode#buildChildren, it calls
PackagingTreeNodeFactory.addNodes which add the complex node or its substitution depending on substitutionParameters.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Oh, I have tried to debug this before make this topic, but it is imposible without debug info available. I have inspected only this condition " if (processed.add(element) && substitutionParameters.shouldSubstitute(complexElement))" isn't true. Why, I don't really know because processed elements seems to be empty, and private field myTypesToSubstitute in ComplexElementSubstitutionParameters have my ComplexPackagingElementType. This is still black box without debug info.

0
Comment actions Permalink

All of this code is part of IntellIJ IDEA Community Edition, which has full source code available under the Apache 2 license. Not a black box at all.

0
Comment actions Permalink

My plugin depends on "com.intellij.javaee". So I can't use Community version to develop.

0
Comment actions Permalink

I have reproduce this problem in sample plugin project with "MyResourcesPackagingElement". Show content of elements doesn't work :(

Additional thanks for help!



Attachment(s):
MyPackageElementType.zip
0
Comment actions Permalink

What value do you pass to ComplexPackagingElement constructor in your implementation? Note that this value must be equal to the instance of
ComplexPackagingElementType's implementation loaded as extension. You can use PackagingElementType#getInstance method to obtain this instance.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Thanks a lot Nikolay! Indeed this is work. I realize my mistake, that instance of element type must be a same as in extensions. Then myTypesToSubstitute.contains method works as expected.

0

Please sign in to leave a comment.