PageRenderTime 438ms CodeModel.GetById 333ms app.highlight 12ms RepoModel.GetById 89ms app.codeStats 0ms

/src/mpv5/ui/panels/DataPanel.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 92 lines | 18 code | 17 blank | 57 comment | 0 complexity | 90a5e02830e5c0f0b6177ec5ac7d6d32 MD5 | raw file
 1/*
 2 * To change this template, choose Tools | Templates
 3 * and open the template in the editor.
 4 */
 5package mpv5.ui.panels;
 6
 7import mpv5.db.common.DatabaseObject;
 8
 9/**
10 *Represents a view for {@link DatabaseObject}s
11 *  
12 */
13public interface DataPanel {
14
15    /**
16     * Collect the view data
17     * @return 
18     */
19    public boolean collectData();
20
21    /**
22     * Get the database objec twhich owns the view
23     * @return
24     */
25    public DatabaseObject getDataOwner();
26
27    /**
28     * Assign this view to a database object
29     * @param object
30     * @param populateData If true, the DOs data is populated into the view.
31     */
32    public void setDataOwner(DatabaseObject object, boolean populateData);
33
34    /**
35     * Reload the view from database, in background
36     */
37    public void refresh();
38
39    /**
40     * Populate the data to the view
41     */
42    public void exposeData();
43
44    /**
45     * Paste a dbo into this panel and let the panel decide what to do with it
46     * @param dbo
47     */
48    public void paste(DatabaseObject... dbo);
49
50    /**
51     * Show the user the fields which are mandatory to fill in
52     */
53    public void showRequiredFields();
54
55    /**
56     * Show/hide the search panel for this view (if any)
57     * @param show
58     */
59    public void showSearchBar(boolean show);
60
61    /**
62     * Call this after saving the dataowner of the panel
63     */
64    public void actionAfterSave();
65
66    /**
67     * Call this after creating a new dataowner on the panel
68     */
69    public void actionAfterCreate();
70
71    /**
72     * Call this before creating a new dataowner on the panel
73     */
74    public void actionBeforeCreate();
75
76    /**
77     * Call this before saving the dataowner of the panel
78     * @throws ChangeNotApprovedException thrown if the user did not approve the change
79     */
80    public void actionBeforeSave() throws ChangeNotApprovedException;
81
82    /**
83     * Mail the current data
84     */
85    public void mail();
86
87    /**
88     * Print the current data
89     */
90    public void print();
91
92}