Monday Oct 04, 2010

RedFX: JavaFX Widget Library for GlassFish

RedFX provides a JavaFX widget library that connects front-end JavaFX widgets with services running on GlassFish, without writing any boiler plate code.

Why they picked GlassFish ?

  • Its the Reference Implementation of Java EE 6 and contains all the latest specifications implemented.
  • First-class open source application server
  • Quality is very very good
  • Scalability is enormous
  • Code is very easy to understand

Hear Johan Vos share all the juicy details in this video captured at the recently concluded JavaOne:

A requirement for one of their application was to be "scalable as hell" and GlassFish very well handled few hundred thousand users/hour with about 40 requests/user. Read more about the library here.

The library can be downloaded here.

Coming soon on a GlassFish Update Center on your desktop ...

Technorati: conf javaone javafx glassfish javaee6 widgets

Thursday Jan 03, 2008

OSX #6: Organizing your Dock & Dashboard

Dock is the Windows Start Bar equivalent in MacOS. However if a program is installed on your MacBook, unlike Windows, you'll need to explicitly add it to the Dock.
To add an icon to Dock: Just click on the Finder icon in Dock, Finder Icon, locate the installed program and drag/drop the icon to Dock. This can be done from the Desktop as well.
To remove an icon from Dock: just drag it away from the Dock onto the desktop; the icon will disappear in a poof of smoke Icon deleted from Dock

Mac DashboardDashboard is Windows Sidebar equivalent in MacOS - it is used for hosting widgets and activated by the default keyboard shortcut of F12.  

To add widgets to Dashboard: Some common widgets are included with the OS itself and can be enabled by clicking on the + button in left-bottom corner of the screen when Dashboard is visible. More widgets can be downloaded from here or by clicking on +, "Manage Widgets..." and "More Widgets...". MacBook Dock - Manage Widgets

To remove widgets from Dashboard: Deleting a widget requires you to hold the Option key over a widget which enables a X in the left-top corner of the widget. Just click on the X and the widget will disappear.

A complete archive of all Mac OS X tips on this blog are available here.

Technorati: mac osxtips dock dashboard widgets

Wednesday Dec 12, 2007

TOTD #20: How to create a new jMaki widget ?

This TOTD explains how to create a new jMaki widget and make it available in the NetBeans palette.

In order to create a jMaki widget, it's important to understand the jMaki Widget Model.

Basically, "component.htm", "component.js" and an optional "component.css" together make a jMaki widget.

Here are the files for a Hello World widget that takes an argument, concatenates it with the string "Hello" and displays the result on the page.

component.htm

<div id="${uuid}" class="hello"></div>

component.js

jmaki.namespace("jmaki.widgets.hello");

jmaki.widgets.hello.Widget = function(wargs) {
  var hello = document.getElementById(wargs.uuid);
  hello.innerHTML = "Hello " + wargs.args.name;
}

component.css

.hello {
  font-size: 22px;color: red;
}

The following files are required if you like to package your component as a reusable widget library in the NetBeans IDE:

hello.jsp

<a:widget name="hello" args="{name: 'Duke'}" />

Bundle.properties (top-level)

jMaki.Library.Name=jMaki Hello Widget

Bundle.properties (templates)

NAME_templates.hello=Hello
HINT_templates.hello=<html>Hello</html>

widget.json

{
  'name': 'Hello',
  'type': 'custom',
  'version': '1.0',
  'jMakiVersion': '1.0'
}

Package these files together in the following directory structure (choose any zip file name):

Bundle.properties
resources
  hello
    component.htm
    component.js
    component.css
    widget.json (optional)
templates
   hello
     hello.jsp
     Bundle.properties

And then you zip up these files together, that's it! Now this zip file can be added to the jMaki palette in the NetBeans IDE as shown here. Really simple!

After the widget is added to NetBeans palette, it looks like as shown below:

Now, just like any other jMaki widget, you can drag-and-drop "Hello" from the jMaki palette in your JSP page and the following code fragment is generated:

<a:widget name="hello" args="{name: 'Duke'}" />

After the application is deployed, the page is rendered in the browser as shown below:

Couple of points ...

  1. Templates for other languages such as Ruby or PHP can be added in the templates directory. This enables drag-and-drop of your widget in those languages as well.
  2. It's important to maintain the case sensitivity of the property names in Bundle.properties otherwise they will not be recognized.

Please leave suggestions on other TOTD that you'd like to see. A complete archive is available here.

Technorati: totd jmaki web2.0 widgets ajax netbeans

About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today