Package org.snippr.business.entities

Examples of org.snippr.business.entities.Snippet


        }
    }

    @Override
    public void prepareForCreate() {
        snippet = new Snippet();
    }
View Full Code Here


     */
    @Override
    @Transactional
    public void addNewSnippet(Label label) throws DuplicateName {
        User user = userDAO.getCurrentUser();
        snippet = new Snippet();
        snippet.setTitle("New Snippet, please fill it.");
        snippet.setDescription("Add a description here.");
        snippet.setUser(user);
        snippet.setLabel(label);
        if (snippetDAO.exists(snippet)) {
View Full Code Here

     * Create a new Snippet for this user
     * @access public
     */
    @Override
    public void addNewSnippet() {
        Snippet snippet = new Snippet();
        user.addSnippet(snippet);
    }
View Full Code Here

        Util.reloadBindings(listComments);
    }

    public void snippetSelected(Listbox list) {
        Listitem listItem = list.getSelectedItem();
        Snippet snippet = (Snippet) listItem.getValue();
        snippetModel.setSnippet(snippet);
        getComments();
        Util.reloadBindings(listComments);
    }
View Full Code Here

    private class SnippetRenderer implements ListitemRenderer {

        @Override
        public void render(Listitem item, Object data) throws Exception {
            Snippet snippet = (Snippet) data;

            item.setValue(data);
            item.appendChild(new Listcell(data.toString()));

            // Select snippetCode.snippet in list
            SnippetCode snippetCode = snippetCodeModel.getSnippetCode();
            if (snippetCode != null && snippetCode.getSnippet() != null
                    && snippetCode.getSnippet().getId().equals(snippet.getId())) {
                item.setSelected(true);
            }
        }
View Full Code Here

TOP

Related Classes of org.snippr.business.entities.Snippet

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.