chat/client/src/main/java/org/apidesign/html/chatserver/client/Main.java
author Jaroslav Tulach <jtulach@netbeans.org>
Tue, 11 Feb 2014 21:59:17 +0100
changeset 83 1b1d3f559196
permissions -rw-r--r--
Separating initializaiton code into separate class
jtulach@83
     1
/**
jtulach@83
     2
 * The MIT License (MIT)
jtulach@83
     3
 *
jtulach@83
     4
 * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jtulach@83
     5
 *
jtulach@83
     6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
jtulach@83
     7
 * of this software and associated documentation files (the "Software"), to deal
jtulach@83
     8
 * in the Software without restriction, including without limitation the rights
jtulach@83
     9
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
jtulach@83
    10
 * copies of the Software, and to permit persons to whom the Software is
jtulach@83
    11
 * furnished to do so, subject to the following conditions:
jtulach@83
    12
 *
jtulach@83
    13
 * The above copyright notice and this permission notice shall be included in
jtulach@83
    14
 * all copies or substantial portions of the Software.
jtulach@83
    15
 *
jtulach@83
    16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
jtulach@83
    17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
jtulach@83
    18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
jtulach@83
    19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
jtulach@83
    20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
jtulach@83
    21
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
jtulach@83
    22
 * THE SOFTWARE.
jtulach@83
    23
 */
jtulach@83
    24
package org.apidesign.html.chatserver.client;
jtulach@83
    25
jtulach@83
    26
import org.apidesign.html.chatserver.model.Message;
jtulach@83
    27
jtulach@83
    28
/**
jtulach@83
    29
 *
jtulach@83
    30
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jtulach@83
    31
 */
jtulach@83
    32
public class Main {
jtulach@83
    33
    private Main() {
jtulach@83
    34
    }
jtulach@83
    35
    
jtulach@83
    36
    static {
jtulach@83
    37
        ChatModel chm = new ChatModel();
jtulach@83
    38
        Message m = new Message();
jtulach@83
    39
        m.setComment("Waiting for messages from the server...");
jtulach@83
    40
        m.setUser("system");
jtulach@83
    41
        chm.getMsgs().add(m);
jtulach@83
    42
        chm.applyBindings();
jtulach@83
    43
        chm.initialRead();
jtulach@83
    44
    }
jtulach@83
    45
}