Thursday, October 09, 2014

Play Framework: IntelliJ IDEA cannot find declaration to go to

I'm doing a Play! Framework project, and all of a sudden, IntelliJ IDEA forgets about everything, doesn't provide any autocomplete / intellisense, doesn't check syntax, doesn't check my imports, nada, kinda just a text-editor like Sublime at that point.

What I'm using:
- play! framework 2.3.5
- IntelliJ IDEA 13.5.1
- SBT 0.13.5
- Mix of Java and Scala
- Activator UI
- OSX Maverick

Bascially my issue/sympton is: IntelliJ cannot find declaration to go to in Play Framework, and provides no autocomplete / syntax check support.

Stack Overflow had me Invalidate Caches and Restart. ehh, wasn't enough.

Solution: Specify JDK for Scala to JDK 1.7

I'm on OSX, so Linux/Windows users will have to ad-lib.
IntelliJ -> Preferences -> IDE Settings -> Scala -> JVM SDK
Mine was oddly set to , thus nothing worked, so I flipped it to JDK 1.7, and then re-ran Invalidate Caches and Restart. A few minutes later, and I'm back in business.






Friday, October 03, 2014

Using PDFBox to create a PDF and PdfLayoutManager

I'm looking for documentation for creating a PDF with Apache PDFBox, and I'm hitting some limits. Either I'm not figuring out how to use this tool, or it doesn't have API's for how to draw what should be basic things.

So, there's a project from Glen Peterson to add PdfLayoutManager, which should be contributed upstream to PDFBox. Anyways, I was testing out his additions to the project, and here's the PDF it generates (I've removed the image it add to the PDF, I didn't want to include the resource bundle):

Here is a series of screenshots of the output of this. It can wrap text, make tables, draw shapes, insert an image, and specify colors.