Package name.shamansir.mvp4glayoutdemo.shared.dao

Examples of name.shamansir.mvp4glayoutdemo.shared.dao.NewsItem


    public void bindView() {
        view.getSaveButton().addClickHandler(new ClickHandler() {
           
            @Override
            public void onClick(ClickEvent event) {
                final NewsItem item = view.collect();
                service.saveNewsItem(item, new SafeCallback<Integer>(eventBus) {

                    @Override
                    public void onSuccess(Integer newId) {
                        History.newItem(url.build(P.NEWS_EDIT, String.valueOf(newId)));
View Full Code Here


        text.setValue(item.text);
    }

    @Override
    public NewsItem collect() {
        final NewsItem result = new NewsItem(currentItem);
        result.title = title.getValue();
        result.text = text.getValue();
        result.author = currentAuthor != null ? currentAuthor : createDefaultAuthor();
        result.postTime = currentPostTime != null ? currentPostTime : new Date();
        return result;
View Full Code Here

   
    final Map<Integer, NewsItem> news = new HashMap<Integer, NewsItem>();
   
    public NewsServiceImpl() {
        int n1id = news.size();
        NewsItem newsOne = new NewsItem(n1id);
        newsOne.author = createUser("Joe", "Simpson", 12, "wooo.png");
        newsOne.title = "Fassbinder";       
        newsOne.text = "Blah blah blah";
        newsOne.postTime = new Date();       
        news.put(n1id, newsOne);
       
        int n2id = news.size();
        NewsItem newsTwo = new NewsItem(n2id);
        newsTwo.author = createUser("Moo", "Wangwang", 27, "foo.png");
        newsTwo.title = "Second news";       
        newsTwo.text = "Hello! The news are from the second hand";
        newsTwo.postTime = new Date();
        news.put(n2id, newsTwo);
       
        int n3id = news.size();
        NewsItem newsThree = new NewsItem(n3id);
        newsThree.author = createUser("Boo", "Trolalah", 81, "foo.png");
        newsThree.title = "I don't know Internet";       
        newsThree.text = "I had a dream, when I was young, a dream of sweet illusion.";
        newsThree.postTime = new Date();
        news.put(n3id, newsThree);
View Full Code Here

        int id = item.getId();
        if (id != -1) {
            news.put(id, item);
        } else {
            id = news.size();
            final NewsItem newItem = new NewsItem(id);
            newItem.author = item.author;
            newItem.title = item.title;
            newItem.text = item.text;           
            newItem.postTime = item.postTime;          
            news.put(id, newItem);
View Full Code Here

TOP

Related Classes of name.shamansir.mvp4glayoutdemo.shared.dao.NewsItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.