[TIP] User Code in Component Properties

When you are creating an application in Mobility Pack Visual Designer you probably use the Properties to change texts and other properties of the components used in your midlet. The Properties window is opened by default in right bottom corner of the Visual Designer. The Properties window shows the properties of selected component either in Flow/Screen Designer view or in Inspector/Navigator.


When the property name is in bold then the property doesn't have the default value. It means that you (or the IDE) changed it. The same approach is used by the Properties window in Matisse GUI Designer.
Look at the String, Timeout, Title, Instance Name properties at the picture on right side.

You can change Title of component, you can change the text shown etc. There are two ways how to do it.
The first one is to use a string that you write to the appropriate property of the component - e.g. .

The other option is to open Property editor(PE) of a property by click on the three dots button. In the PE you can use your User Code to assign the value to the property.



Property Editor in 5.5.1



Property Editor in 6.0
The generated code for the user code value of the property from the pictures above will look like
    public Alert getAlert() {
        if (alert == null) {
            // write pre-init user code here
            alert = new Alert("My Little Alert", LocalizationSupport.getMessage("licenseincorrect"), null, null);
            alert.setTimeout(Alert.FOREVER);
            // write post-init user code here
        }
        return alert;
    }
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

This is the main channel to share news, tips and other stuff related to my work. Sometimes you can find even personal stuff. Enjoy your reading...

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
news
Blogroll

No bookmarks in folder

OldNews
MyTrash
NavBar
NetBeans
LinksToBeExpanded