• Home
  • About
  • Sample Apps
  • Always at your service

    This is the third post in a series of posts that offer a preview of the new features in the upcoming UltraLightClient ‘08 release. The first post was about forms, the second post discusses invisible table models. This post describes how to use the application services.

    UltraLightClient 08

    UltraLightClient ‘08 will provide more and improved services for your application:

    • Easy to use application skeletons
    • Easy to use internationalization
    • Easy to use actions

    Let’s have a closer look at the services one by one. The application skeletons gives an ultra easy way to implement your concrete application:

    public class ApplicationFrameworkSnippet1 extends SingleFrameApplication {
      @Override
      protected void startup() {
        show(new ULCLabel("Hello UltraLightClient '08"));
      }
    }

    The above snippet uses the SingleFrameApplication skeleton. This skeleton provides a single frame with a standard layout: a menu bar, a tool bar, and a content area. The content area is passed as a parameter to the show() method. The resulting application looks as follows:

    Hello Application Framework

    With help of the resource services you can easily internationalize your application. Simply name your components and then UltraLightClient ‘08 automatically fetches arbitrary property values out of a property file:

    public class ApplicationFrameworkSnippet2 extends SingleFrameApplication {
      @Override
      protected void startup() {
        ULCLabel nameLabel = new ULCLabel();
        nameLabel.setName("name.Label");
        ULCTextField nameField = new ULCTextField();
        nameField.setName("name.Field");
     
        ULCBoxPane content = new ULCBoxPane(2, 0);
        content.add(nameLabel);
        content.add(nameField);
     
        show(content);
      }
    }

    Here is the content of the ApplicationFrameworkSnippet2.properties file.

    Application.title=Snippet
     
    name.Label.icon=astrologer.png
    name.Label.font=Default Bold
    name.Label.text=Name:
    name.Field.columns=20

    Please note the name of your application is used to identify the correct property file. The internationalization service provides some standard properties. One of these standard properties is used to define the title of the main application window (Application.title). And you can have a separate property file for each language you want to support. This results in the following window:

    Internationalization

    Let’s add an action to the window. To do this we don’t need to provide a full Action class. In UltraLightClient ‘08, it is sufficient to annotate a method:

    IAction sayHelloAction = getContext().getActionMap().get("sayHello");
    ULCButton sayHelloButton = new ULCButton(sayHelloAction);
     
    @Action
    public void sayHello() {
      fGreetingsLabel.setText(toGreetings());
    }

    In the property file you can specify additional properties for the action, e.g. sayHello.Action.text for the action text. This results in the following:

    Action Support

    Summary: UltraLightClient ‘08 helps you in several aspects and makes it ultra easy to write your application. UltraLightClient ‘08 provides good support for application skeletons, internationalization, and actions.

    We plan to publish an UltraLightClient ‘08 milestone release in the next days. Stay tuned!

    Leave a Comment

    This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

    You must read and type the 5 chars within 0..9 and A..F, and submit the form.

      

    Oh no, I cannot read this. Please, generate a