Sha256: 4125775f7183509d32eddc59fa7d10fb6dca1a007ffbdac2ca9a98132962ae81

Contents?: true

Size: 1.55 KB

Versions: 1

Compression:

Stored size: 1.55 KB

Contents

package <%= views_package %>;

<% if !options[:singleton] || attributes.detect { |a| a.type == :belongs_to} -%>
import java.util.List;

<% end -%>
<% for attribute in attributes -%>
<% if attribute.type == :belongs_to -%>
import <%= models_package %>.<%= attribute.name.classify %>;
<% end -%>
<% end -%>
import <%= models_package %>.<%= class_name %>;

import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.inject.ImplementedBy;

import <%= gwt_rails_package %>.places.RestfulAction;

@ImplementedBy(<%= class_name %>ViewImpl.class)
public interface <%= class_name %>View extends IsWidget {

    public interface Presenter {
<% unless options[:singleton] -%>
        void create();
<% end -%>        
        void save();
<% unless options[:singleton] -%>
        void delete(<%= class_name %> model);
<% end -%>
        void goTo(Place place);
    }
    void setPresenter(Presenter presenter);

    void edit(<%= class_name %> model);

    <%= class_name %> flush();
<% unless options[:singleton] -%>

    void reset(List<<%= class_name %>> models);
<% end -%>

    void reset(RestfulAction action);
    
    void setEnabled(boolean enabled);
<% unless options[:singleton] -%>

    void updateInList(<%= class_name %> model);

    void removeFromList(<%= class_name %> model);

    void addToList(<%= class_name %> model);
<% end -%>
<% for attribute in attributes -%>
<% if attribute.type == :belongs_to -%>

    void reset<%= attribute.name.classify.to_s.pluralize %>(List<<%= attribute.name.classify %>> list);
<% end -%>
<% end -%>
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
resty-generators-0.6.0 lib/generators/resty/templates/View.java