~ubuntu-branches/ubuntu/raring/zeroc-icee-java/raring

« back to all changes in this revision

Viewing changes to test/IceE/faultTolerance/ClientMIDlet.java

  • Committer: Bazaar Package Importer
  • Author(s): Francisco Moya
  • Date: 2008-08-07 23:05:39 UTC
  • mfrom: (3.1.2 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080807230539-iiuezo41bclg5yxy
Tags: 1.2.0-3
* Upgraded packaging standards.
* Removed unsatisfiable build dependency (Closes: #487027).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// **********************************************************************
 
2
//
 
3
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
 
4
//
 
5
// This copy of Ice-E is licensed to you under the terms described in the
 
6
// ICEE_LICENSE file included in this distribution.
 
7
//
 
8
// **********************************************************************
 
9
 
 
10
import javax.microedition.lcdui.*;
 
11
 
 
12
public class ClientMIDlet extends ClientBase
 
13
{
 
14
    protected ConfigurationForm
 
15
    initConfigurationForm(javax.microedition.midlet.MIDlet parent, Ice.Properties properties)
 
16
    {
 
17
        _properties = properties;
 
18
        ConfigurationForm cf = new ConfigurationForm(parent, properties);
 
19
        _addr = new TextField("Addr: ", properties.getPropertyWithDefault("Test.Host", "127.0.0.1"), 128, 
 
20
                TextField.ANY);
 
21
        _port = new TextField("Port: ", properties.getPropertyWithDefault("Test.FirstPort", "12010"), 128, 
 
22
                TextField.NUMERIC);
 
23
 
 
24
        String count = properties.getPropertyWithDefault("Test.ServerCount", "13");
 
25
        _serverCount = new TextField("Server count:", count.trim(), 128, TextField.NUMERIC);
 
26
 
 
27
        cf.append(_addr);
 
28
        cf.append(_port);
 
29
        cf.append(_serverCount);
 
30
 
 
31
        //
 
32
        // We enable the ok button here in this particular midlet
 
33
        // instead of waiting for the IP address to be resolved. This
 
34
        // works around a problem in the Nokia S40 2nd emulator where it
 
35
        // doesn't seem to be possible to add commands to a Displayable
 
36
        // once its been set. The workaround isn't needed on any other
 
37
        // emulators or devices that were tested.
 
38
        //
 
39
        cf.enableOk();
 
40
        return cf;
 
41
    }
 
42
 
 
43
    public void
 
44
    updateProperties(Ice.Properties properties)
 
45
    {
 
46
        properties.setProperty("Test.FirstPort", _port.getString());
 
47
        properties.setProperty("Test.ServerCount", _serverCount.getString());
 
48
        properties.setProperty("Test.Host", _addr.getString());
 
49
    }
 
50
 
 
51
    public void
 
52
    setup()
 
53
    {
 
54
        //
 
55
        // Nothing to do here. See comment re: S40 emulator workaround
 
56
        // in this MIDlet's initConfigurationForm method. 
 
57
        //
 
58
    }
 
59
 
 
60
    private TextField _serverCount;
 
61
}