javafx - drag to filesystem - get path - javafx

I am relatively new to java and javafx. So my program is a product of my growing java skills:) and "thankfully" copying stuff from the growing quantity of javafx howto's.
Well now i am stuck on a problem and I have spent now quite a time looking for the solution before asking you guys. Basically I have builtin this application a very simple ftp-client using the apache common library, which does a connection and loads the ftpfiles into a tablerow and one can browse through the directories, what for I have implemented some FTPCLient functionalities on a seperate class. Well I already have set up a dragin-files functionality from the os's filesystem into the tableview, which does the upload of files part very well.
But know I would like to be implement the drag/copy file from the tableview to the filesystem. I am very thankful if anyone could give me a short description on how to do that. I think I could get that done, if I could get the path of the target-directory when dragging to it. Probably set up in a row- or cellfactory.
Thanks in advance guys,

Related

Is there a way to generate windows and/or components in Ignition?

I was hoping that Ignition had a way to import/export windows to a non-binary format such as JSON or XML, but that seems not to be the case (or is there a way?).
Is there a way to use the script console to generate and populate a new window, or to insert components into an existing window?
This would be used for inserting templates and other components, such as navigation buttons etc.
Yes, but...
I assume here that you're referring to Vision windows. The windows are indeed binary serialized, but the underlying structure is XML. But getting the deserialization done programmatically is a pain and probably not worth it.
You can get a feel for what this looks like by opening a Vision window in the designer, right-clicking its Root Container and choosing Copy, then pasting it into Notepad. I myself tried to find a way to do this from a module and decided it wasn't worth it. For more detail, you can view that thread in the Ignition forum here.
However, that's not really useful for generating and populating a new window.
To do that, you need to do some Java programming. Vision is Java Swing under the hood. There are a couple ways you can dynamically build / populate a Window.
From Python, you can import any Java libraries you need and generate the window dynamically. For relatively simple things, you're probably better off working with the Template Canvas component. There's an Ignition forum thread discussing this topic here. This would be more of a run-time generation, not from the Script Console.
You can write your own module to do it.
Module SDK Vision Component Guide
Vision Component Module Example
Good luck!

JavaFX able to control window components?

I have a general question regarding to JavaFX.
I am wondering if it is able to control window components such as file download / upload dialog (i.e: When you are using Internet Explorer, you may need to upload/download files. I want to automate the operation hopefully with javaFX). If they are possible, could you please, point me where to look?
What you're looking for is functionality similar to java.awt.Robot. JavaFX doesn't provide an API for this, but you can still use Glass to use Robot, see this question and this issue on javafx-jira

Embedding HTML Help in a QT application

I write an application, with Qt and it has a pretty big help system, which is including images, tables, links, etc... This help system is stored on a disk in a specific location as simple HTML files, together with the images and using a QWebkit control it's loaded in the application on request, and the user can browse it, etc...
Now, I would like to move away from my "in-house, file based" help solution, meaning: I want a help system which still will use my HTML files, but without the need to ship 100 files to the user, only 1 or 2.
I am aware of Qt's help system ( http://doc-snapshot.qt-project.org/4.8/qthelp-framework.html ) but I am wondering if there are any other solutions providing the same or similar functionality.
What I am looking for:
take all the HTML files and create one of them, including images
reader possibly embeddable in application, but separate application is good too.
multiplatform
support for context sensitive help (ie: "Click on what's this", help shows relevant page)
For huge help docs the best way is to use Qt Help Framework. For example QAssistant is done in this way.
It mainly consists of several html like files and index files. Then you "compile" them to get a binary(and compressed) version. You can split help in sections and so on...
I am using QWebView to display HTML help files. You get a widget and can integrate it in your application.
Qt have a good easy example here: http://qt-project.org/wiki/Open_Web_Page_in_QWebView
Since it is a widget, you can greate a stand-alone or integrated look and it it very flexible.

How to regenerate service super-class in Flash Builder

So my problem is exactly the same as this guy's here: http://www.pubbs.net/201003/flex/61462-flexcoders-flash-builder-super-class-regeneration.html , but unfortunately, he got no answer.
After initially generating service classes connecting with PHP, I modified the PHP, added new call specifically.
While the Data/Services window successfully made notice of the changes, including new function in the list, the service super-class didn't change whatsoever. Which baffles me, since all super-classes in generated service and valueObject packages contain an annotation like this:
This is a generated class and is not intended for modification. To customize behavior
of this service wrapper you may modify the generated sub-class of this class - SomethingService.as.
And also the sub-class contains something about "regeneration of the super-class". So obviously, my goal is to force the mentioned regeneration. Any thoughts?
Just had a similar problem and it was driving me nuts. In my case, I am using an Eclipse plug-in for Team Foundation Server (a source control repository). In TFS, files are kept read-only until you check them out. Usually when something behind the scenes tries to modify a file that I have open, the plug-in will check out the file automatically and let it make the changes. For some reason, it didn't in this case.
So for me, all I had to do was check out the file and it would then be able to regenerate (which translates to making the file writable for the rest of you who might have the same issue).
I find that most code generators work once to generate classes, but do not work well updating them. It's really hard (I've worked on them).
Can you correct your classes by hand?

Flash Builder 'building' html files

I'm using Flash Builder 3 to edit my Flex app, but I noticed that every time I make a change on the .html files (index.template.html for example), even if it's not in the IDE but with another program, Flash Builder rebuilds the whole project.
Is there anyway to stop this? Why would it need to rebuild the workspace everytime a html file changes?
If it was too long it wouldn't bother me, but it takes a lot of time (more than 1 minute) every time. For your information the html file is 95 lines of 'code'.
Thanks
In the main application menu, make sure Project->Build Automatically is unchecked. That will stop it from automatically rebuilding your project every time a file changes.
Looks like it's the HTMLWrapper that takes a long time for compiling.
If you encounter the same problem, you can deactivate the wrapper generation in the compiler option.
Ive written a short article about how to edit index.template.html so that your swf will centre on the page similar to Flashdevelop centering. You might find that useful, I wrote it mainly to explain to myself and the technique works fine.
See
http://www.thumbleaf.com/journal/?p=239
, Thomas

Resources