Load Insubstantial Swing Plugins to Eclipse - java

How do I load the Insubstantial Swing plugins to Eclipse?
I refer to the plugins here: http://insubstantial.posterous.com/

A simple solution would be to copy the jars into your project and add them to the build path (under "Properties->Java Build Path->Libraries"). If you want to use them in several projects and configure the source and javadoc attachments only once, then you might want to define a User Library for them (See the "Add Library" button on that same page).

Windows Builder allows you to apply any look and feel you want. So, you should be able to add Substance:
http://code.google.com/javadevtools/wbpro/preferences/swing/preferences_lookandfeel.html
Depending on what exactly you want to do, you may still have to do some customization in code.

Related

How to use Jpackage to make a distribution format for JavaFX applications

since .jar is not anymore the best format to use to distribute our JavaFX project, I'm willing to use the tool JPackage for that instead, but after reading this post : https://stackoverflow.com/a/68823040/4262407, I ended up having multiple questions, but first of all, I just wanna make sure I ve well understood the process that I should follow :
the process :
1-create a modular project
2-package the project in a .jar format
3-use the tool Jlink to create a customized run-time image (to reduce the size of the output)
4-use the tool jpackage (it takes 2 and 3 as inputs)
I'm also wondering if I can rely on Intellij artifacts to create the .jar file (the 2 step) is it better to use a specific plugin ?
The last thing that is not clear is do we need to include the dependencies in the .jar file ? since I believe they will be included in the customized run time, won't they?
If you take a look here, there is an explanation on how to create JavaFX projects starting from a template that includes Maven plugins to easily pack the application using jlink.
Doing it like this will allow you to completely rely on IntelliJ, making things much easier.
Once you have your runtime image, you can pack it with jpackage. There was already a discussion about this topic here.
And here is a fast link to the article mentioned there. The article there shows it using Gradle, but you can do the same with Maven, just use the appropriate plugin (jpackage-maven-plugin, as stated in another answer here).
Also, from what I can read in your comments, it seems that you have both modular and non-modular dependencies. In that case, you can use jdeps to achieve what you need. There is a nice article here about having mixed dependencies, that specifically uses JavaFX as an example of modular library within a non-modular application.
Just have look here https://github.com/dlemmermann/JPackageScriptFX for a tutorial with a working example. Its especially useful for non-modular projects.
I used the jpackage maven plug-in to build the native executable(https://search.maven.org/artifact/org.panteleyev/jpackage-maven-plugin).
You will first have to use maven-javafx-plugin to create a jlink runtime image(https://github.com/openjfx/javafx-maven-plugin).
You will then use that runtime image within jpackage plugin(... ).should create an executable successfully then.
The jpackage tool does not require a modular project. Though if your project is not modular then your project will be mixed due to JavaFX being modular. In that case, you'll add the JavaFX modules to the custom run-time image while telling jpackage to treat your code as non-modular (i.e. it will configure the executable to place your code on the class-path).
You can also combine steps 3 and 4 into a single step. The jpackage tool can generate the custom run-time image. It will use jlink "behind the scenes".
As for what format your code needs to be in, packaging it in a JAR file will be, in my opinion, the most straightforward. But I'm not sure that's strictly required.
Any dependencies of your application will of course need to be included with the final application. If those dependencies are modular then you can have them included via the custom run-time image. But if you want them on the class-path then you can include them the same way as your code (i.e. --input).
Note the jpackage tool has a user guide: https://docs.oracle.com/en/java/javase/16/jpackage/packaging-overview.html

Change IntelliJ code construct symbols

Is there a way to change the icons for symbols suchs the C for classes and the M methods. They're a little hard to distinguish on my laptop. Ideally I'd like to change it throughout the IDE but fine if it's just for the project pane or auto complete.
The icons can't be changed via the UI as far as I know. It is however possible to change them manually. All icons used by IntelliJ are located in $IDEA_HOME/lib/icons.jar, where $IDEA_HOME represents the IntelliJ installation directory.
It might be possible to modify content of this JAR (by unzipping it, changing the icons and creating JAR from it again) and replace the original icons.jar with it. But change such as this will probably be overwritten during IntelliJ upgrade.
One solution would be to package the icons into a plugin. There is a Idea 11 Icon Pack plugin which does exactly the same thing you want. It is a JAR with the same structure as the icons.jar. Except two things:
It has plugin descriptor (META-INF/plugin.xml) in order for the JAR to be registered as plugin
It has implementation class com/bulenkov/idea/Idea11IconPack in order to register the icons I guess
I would use this as an inspiration. You can modify the descriptor so that there are no clashes in plugins, and change all of the old icons for your modified ones. One thing I'm not sure about is the implementation class. You could keep it and it might work. Or you could decompile it to see what it does and create your own version.
You can then install the JAR with the plugin descriptor by clicking Install plugin from disk button in the plugin settings.
Here is also a documentation for plugin development which might be useful.

Export wizard application in netbeans

I did a sample application mentioned in this link using Netbeans Wizard template https://platform.netbeans.org/tutorials/nbm-wizard.html
But how do I export as executable jar. I just want to execute the project independently with out IDE. Any suggestions.
I can't find it in the tutorial that you point to but in order to share your newly created Netbeans plugin you need to export it as a binary NetBeans Module or .nbm file. Right click on your project and select Create NBM. Check this old tutorial here: http://docs.huihoo.com/netbeans/6.0/kb/60/platform/nbm-google.html
For Netbeans 8.0: When the file is created you can then go Tools->Plugins , downloaded tab and then click add plugins
EDIT (based on your comments)
The tuturial you point to guides you to build a custom Netbeans module (in this case a Wizard). The module is packaged as a .nbm file which you can then distribute it so that it can be installed to any Netbeans IDE.
As it turns out you need something like a "Java swing wizard" application. By searching google you can find some results that fit your needs (these are from the first google results):
http://www.oracle.com/technetwork/articles/javase/wizard-136789.html
https://code.google.com/p/cjwizard/
http://www.javaworld.com/article/2077850/java-se/open-source-java-projects-the-wizard-api.html
http://sourceforge.net/projects/jwf/
Similar question (maybe you can post a comment asking for details there):
https://softwareengineering.stackexchange.com/questions/132723/is-there-a-java-library-to-create-assisted-wizard-flow-into-your-desktop-applica
Hope I am not leading you to the wrong way but another thing you can also have a look at, (haven't checked it myself but you might find it useful) is how to create OSGI modules and the posibility of converting Netbeans modules to OSGI modules.
Look here: http://wiki.netbeans.org/OSGiAndNetBeans.

Tool for creating Dynamically Generated Code in Java (In Eclipse)

In Visual Studio land, I used to be able to define a structure in an XSD file and add a special attribute to it which would cause it to be dynamically compiled and available to use with intellisense in the other C# files in the application. I am not sure exactly what the term for this is, perhaps "dynamic code generation."
I am trying to accomplish the same in Java using Eclipse IDE. Basically what I am looking for is a tool that will allow me to specify some template and generate Java code from it in a "hot folder" that will allow me code complete in the other static Java files.
Does anyone know of a solution for this? I know it is possible in Visual Studio, but I can't seem to find anything for Eclipse.
Ok, here is exactly what I want to do.
Step 1. I create a folder called templates
Step 2. I create a file called HelloWord.ibes
Step 3. Code it automatically generated in my src folder HelloWorld.java
I want to be able to do this in eclipse easily.
You may create an ant build file that does the source generation for you. Then you are free to use any code generator you like. Ant support is part of the eclipse IDE. If you prefer maven, there's a nice eclipse pluging available (that's what I actually use for source code generation based on jaxb, javacc and xdoclet...).
Technically spoken, you just add another eclipse builder which is invoked anytime eclipse detects a change in your code base.
If you already have a code generator in mind, just 'ask' the internet if there's a plugin available.
Edit
On how to install a builder: This is done automatically. For maven, you just install the maven plugin (m2eclipse) and enable maven dependencies for a project. Then if you look at the projects properties pages (Builder section), you find a second entry in the list of builders.
It's similiar with ant, even easier, because ant is already integrated. "enable" ant for a project and the builder is added to the list of builders for the project. You can deselect it at any time if it kills performance or switch of automatic building (I don't know by heart how to enable ant builds for a project, but I remember that the eclipse help had sufficiant informations).
All about ant can be found here: Apache Ant
Creating a new builder is difficult, as it has to be coded in java and added to eclipse as a plugin. I bet you don't want to follow that track ;)
I'm not sure whether you have seen the code template option?
Preferences.Java, Code Style then Code Templates
How
to add code templates
Useful
code templates

how to repackage eclipse for my team

I'd like to set up eclipse with a bunch of plugins and DB connection configurations, etc and re-zip it up so my team-mates and new starters can all be working on the same platform easily.
It seems that installing plugins is fine, but when I add in custom jars (e.g. ivy2, ojdbc, etc) they all save with full, absolute paths which probably dont exist on others machines (particularly if they unzip in a different location to me).
Anyway, I'm hoping that this idea is not silly and am working if this sort of process is documented somewhere or if anyone has any tips in general.
Thanks,
I would recommend against requiring all developers to place eclipse in the same location. There are times when some developers may want to try an alternate version of eclipse to explore a technology that requires a different set of plugins or a different eclipse base version.
Let developers install eclipse where they would like.
However, for jars that you need to run plugins (external dependencies that you need to configure for proper plugin usage):
Hardwire a directory for those jars (as opposed to the entire eclipse dir), like c:\eclipse-helpers or something.
To deal with third-party library dependencies (in the code you're developing), you have a few good choices:
Create project(s) to hold the third-party libs and check them into your source version control system (which you are using, right?). You can then add the libs to the build path(s) of the project(s) - make sure you mark them for export in the "order and export" tab of the build path page. You can then simply add these third-party projects as project dependencies.
Reference the third-party jars as CLASSPATH variables when adding them to the build path of your projects. This allows other developers to store the dependencies in different locations. Perhaps define a CLASSPATH variable (in eclipse's Window->Preferences->Java->Build Path->Classpath Variables) called THIRD_PARTY_JARS; each developer can map it to a different path where they want to hold their deps.
Reference the third-party jars as a "user library" (Window->Preferences->Java->Build Path->User library). This is similar to classpath variables, but acts as an explicit set of jars.
Include the third-party jars directly in your projects. Use this option only if you need the deps in a single location.
Although not exactly in line with the direction of the question, you could use Yoxos OnDemand. It allows you to "roll-your-own" Eclipse distro and download it as a zip. They add in their own perspective where you can add more plugins (direct from their repo), or update the plugins that you have.
Although I've never used the feature, you can make make your own stacks and name them, allowing anyone to go to the site later and download it (with the most up-to-date versions of the plugins). Also, dependencies for plugins are resolved automatically if need be.
In eclipse - in many places it's possible to use workspace relative paths or system environment infos to reference external files, too.
Another option could be to place your jars into a workspace project so that every team member can check it out from cvs/subversion/whatever and start working. Working like this ensures a reproducible environment for server builds or for desktops even after years.
Talking about Yoxos...
it provides "Workspace Provisioning" as well. This means you can attach Eclipse Preferences, checkstyle configurations and Mylyn setups additionally to your list of needed tools/plugins for your IDE to your yoxos profile.
This means your team could share a profile and would be able to start working with the same setup regardless of their OS or whatever. (Its possible to use multiple profiles at once, too.)
We did a similar thing with our development environment (it needed both Eclipse and our own plug-in which, in the early stages, had to run in a known location).
We just put it in c:\eclipse_<projName> and made that a requirement for the team. That's probably the easiest solution for you.
It's your team, you can dictate this as a requirement. Unless your team members are absolute idiots, they'll work with you.
I found Yoxos really good and it does very good work in determining dependencies.
Its really a good tool and worth giving a look.
I just started using git to manage my eclipse install. I did a write-up. The approach might work for you, and it's probably worth looking at.
If developers all don't have the same paths on their machine, instead of adding independent JAR files you could create what Eclipse calls a "library" and include a bunch of jars in that. Then another developer just has to change the location of the library and it'll pick up all the jars in there.

Categories

Resources