How to embed jEdit in a JTabbedPane (or JInternalFrame) - jedit

jEdit is great, and I would like to include it in JTabbedPane.
From the API it seems to be possible but I have been unable to achieve this.
By any chance do you have a simple example that works ?

Do you mean just the text area?
Well, you can build the text area as library JAR for you to use with the ant target build-textArea.
But be aware that the standalone textarea is also under GPL like whole rest of jEdit, so if you plan to release your work, you have to release it under GPL too. If it is just for your private use, you can use it like you want of course.
The package also has StandaloneTextArea which demonstrate how to use the text area outside jEdit. You can just run the built JAR, it is an executable JAR that runs this example StandaloneTextArea.

Related

Openhtml to pdf messes up pdf display when build natively

I am using this - https://github.com/danfickle/openhtmltopdf to convert from html to pdf. (Which uses Apache PDFBox internally and that's where I guess the problem is).
Everything works well in development mode - I am using quarkus.
When I run - mvn clean quarkus:dev and generate the pdf it display properly (with html table and all) as expected.
However when I build natively (mvn package -Pnative) and than generate pdf, it messes up all display. Everything is just one string and it fails to understand css too.
Hard part is, I don't see any errors so can't figure out what's going wrong.
Htmlto pdf code, its really basic -
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.useFastMode();
builder.withHtmlContent(htmlContent, null);
builder.toStream(os);
builder.run();
Pass any string (Well formatted html) and you will see the difference between two different execution style.
Why is this happening?
Hard to tell without looking into the library code.
Quarkus does its best to integrate libraries and make them work with native mode, by adding the pieces required by native mode. For native mode limitations, please check this link: https://www.graalvm.org/reference-manual/native-image/Limitations/.
Some libraries may work out of the box without additional configuration. Other require additional configuration to comply with the native image rules.
I suspect that the library may be using some sort of reflection that is not registered in the native image. Maybe try to have a look into it first and register additional resources: https://quarkus.io/guides/writing-native-applications-tips

How to open and modify .gtk plugin

I have found a plugin (EELSTools.gtk from http://www.dmscripting.com) which I want to modify.
The plugin contains nearly every function I need, but I want also to integrate some extra functions.
Does anyone know how to open .gtk files?
You can't and shouldn't.
*.gtk files are packages files with the purpose of encapsulation. This might either be because of convenience, but it might as well be, because the author does not want to make the code open-source. (Note that there are some proprietory plugins as well, they are also .gtk files.)
If you have found a plugin and want to expand on it, the best way forward is to contact the plugin-author.
The *.gtk files get loaded before *.s files. If you install your own script from DM Menu Install Script File or Install Script, you can add it to the menu that the *.gtk file has, e.g. EELSTools. It is added at the end of the list. For example, I put a measure ZLP width script in EELSTools.

Compiling .hx code directly (or indirectly) to a dynamic library (ndll)

I am working on a project and I have a plan to separate certain sections out into separate dlls/ndlls in the final program. The main reason I want to do this is to support plugins and add ons, so more functionality can be added if needed, but the core app can still be used if that's the only requirement.
I have done something similar in C# (abet through an IDE so I never had to write any linker/compiling commands) so I know the general process but I can't seem to find a way to write HX code and then have it compile into a ndll.
I found this http://old.haxe.org/doc/cpp/ffi?lang=en which shows how to compile cpp code into a ndll using hxcpp and g++. I would think there should be a way I can use LIME or HXCPP to create a build file that will allow me to do it in one step instead of having to make a "fake" main function to compile the HX to CPP or CS.
If anyone knows of a project that does this and has a build.hxml or build.xml file that describes this or a tutorial or guide that takes about this, I would love it see it.
Try this:
lime create extension TestExt
lime rebuild TestExt windows
Replace "windows" with "mac" or "linux" as appropriate. Assuming it works, the ndll will show up in a subfolder of TestExt/ndll/.
As for tutorials, I wrote this one. It's targeted at OpenFL programmers, but the "Writing code for iOS" section covers what you'll need to know. (You can also just model your code on the template.)
In case it helps, I've made a tool to generate some of the boilerplate code that Lime requires.

Using Apparat dump with FDT and ant

I am totally new to flash development, don't even know ActiveScript yet.
I have to improve some existing flash application, so at first I need to understand the code.
I want to use some tool for code analysis, something to visualize class dependencies and code structure. I googled and found out about Apparat tool. Now I'm struggling with it because I can not find documentation that describes how to use Apparat. I'm frustrated, but it seems to be the only such tool.
So I started with example.
I've set up apparat running on FDT following this guide:
http://www.webdevotion.be/blog/2010/06/02/how-to-get-up-and-running-with-apparat/
The example (http://blog.joa-ebert.com/2010/05/26/new-apparat-example/) builds well and creates two SWF files. (I'm using ANT builder)
Now I want to analyze existing swf and see a PNG with class dependencies.
How should I do that?
What do I have to add and where?
Or maybe someone can explain how to use dump from windows command line? Something like
dump example.swf exampleAnalysis.png
After resolving all dependencies (which was tricky), I managed to get dump running
dump -i example.swf -uml
But it saves the UML diagram in .DOT format which is really hard to read as Graphviz GVedit cannot zoom and exports to PNG only what you see (messy impossible to read zoomed out graph), smyrna doesn't work and zgrviewer fails to load some files.

Flash Builder: conditional compilation - app.xml

I have a flash project that shall target different platforms. However - code is not completely the same for the different platforms.
using compiler statements and config blocks like
CONFIG::MOBILE{
...mobile specific code here...
}
I can easily maintain the different versions within the same project.
However - there should also be different mainapp-app.xml files be used for the different versions - or depending on the compiler flags different content within the mainapp-app.xml
how can I do that?
Great question. Indeed, you can create multiple config.xml files in your project and link to these config files via compiler arguments. I generally use ANT to do this as it makes the build process simple. But if you don't have ANT setup, simply right click on your project, select ActionScript Compiler and add the following to the list of additional compiler arguments:
-load-config+=config/mainapp-app.xml
Note that the config folder is relative to the project root. I generally put my config files in this folder. I wrote a detailed post on how to perform conditional compilation in AS3 on my blog. Visit http://www.willjohnson.me/blog/?p=146 for detailed instructions.
I hope this answered your question.
Regards,
Will