Révision 8

projets/BCCCC/src/org/ccc/bcccc/client/GreetingServiceAsync.java (revision 8)
51 51
	 *
52 52
	 * @param login the login
53 53
	 * @param eta the eta
54
	 * @param mdp the mdp
55 54
	 * @param callback the callback
56 55
	 */
57
	void logIn(String login, String eta, String mdp, AsyncCallback<Boolean> callback);
56
	void logIn(String login, String eta, AsyncCallback<Boolean> callback);
58 57
	
59 58
	/**
60 59
	 * Log out.
projets/BCCCC/src/org/ccc/bcccc/client/GreetingService.java (revision 8)
27 27
import com.google.gwt.user.client.rpc.RemoteService;
28 28
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
29 29

  
30
// TODO: Auto-generated Javadoc
31 30
/**
32
 * The client-side stub for the RPC service.
31
 * All the RPC services.
33 32
 */
34 33
@RemoteServiceRelativePath("greet")
35 34
public interface GreetingService extends RemoteService {
36 35
	
37 36
	/**
38
	 * Hello.
37
	 * Starts the user session
39 38
	 *
40 39
	 * @return the string
41 40
	 * @throws IllegalArgumentException the illegal argument exception
......
43 42
	String hello() throws IllegalArgumentException;
44 43
	
45 44
	/**
46
	 * Log in.
47
	 *
48
	 * @param login the login
49
	 * @param eta the eta
50
	 * @param mdp the mdp
51
	 * @return the boolean
45
	 * Log user to the site and enable him to create records
46
	 * 
47
	 * @param login email
48
	 * @param password
49
	 * @return
52 50
	 */
53
	Boolean logIn(String login, String eta, String mdp);
51
	boolean logIn(String login, String password);
54 52
	
55 53
	/**
56 54
	 * Log out.
projets/BCCCC/src/org/ccc/bcccc/client/areas/RecordNOfParticipantsField.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import org.ccc.bcccc.client.panels.EditPanel;
22

  
23
import com.smartgwt.client.types.TitleOrientation;
24
import com.smartgwt.client.widgets.form.DynamicForm;
25
import com.smartgwt.client.widgets.form.fields.SpinnerItem;
26
import com.smartgwt.client.widgets.layout.HLayout;
27

  
28
// TODO: Auto-generated Javadoc
29
/**
30
 * The Class DoubleStringRecordArea.
31
 */
32
public class RecordNOfParticipantsField extends HLayout {
33

  
34
	/** The name. */
35
	String name;
36

  
37
	/** The panel. */
38
	protected EditPanel panel;
39

  
40
	private SpinnerItem f;
41

  
42
	/**
43
	 * Instantiates a new string record field.
44
	 *
45
	 * @param panel the panel
46
	 * @param name the name
47
	 * @param multiple the multiple
48
	 * @param freeField the free field
49
	 * @param values the values
50
	 */
51
	public RecordNOfParticipantsField(EditPanel panel, String name) {
52
		this.panel = panel;
53
		this.name = name;
54

  
55
		DynamicForm form = new DynamicForm();
56
		form.setTitleOrientation(TitleOrientation.LEFT);
57
		form.setWidth100();
58

  
59
		this.setWidth100();
60
		this.addMember(form);
61

  
62
		String lname = name.toLowerCase().replace(" ", "");
63
		f = new SpinnerItem(lname);
64
		f.setMin(1);
65
		f.setMax(10000);
66
		f.setTitle(name);
67
		
68
		form.setItems(f);
69
	}
70

  
71
	/**
72
	 * Gets the value.
73
	 *
74
	 * @return the value
75
	 */
76
	public String getValue() {
77
		return f.getValueAsString();
78
	}
79

  
80
	/**
81
	 * Sets the can edit.
82
	 *
83
	 * @param v the new can edit
84
	 */
85
	public void setCanEdit(boolean v) {
86
		f.setCanEdit(v);
87
	}
88

  
89
	/**
90
	 * Sets the value.
91
	 *
92
	 * @param numberOfParticipants the new value
93
	 */
94
	public void setValue(int numberOfParticipants) {
95
		f.setValue(numberOfParticipants);
96
	}
97
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/DateRecordField.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import java.util.Date;
22

  
23
import org.ccc.bcccc.client.panels.EditPanel;
24

  
25
import com.smartgwt.client.widgets.form.fields.DateItem;
26
import com.smartgwt.client.widgets.form.fields.FormItem;
27
import com.smartgwt.client.widgets.form.fields.PickerIcon;
28

  
29
// TODO: Auto-generated Javadoc
30
/**
31
 * The Class DateRecordArea.
32
 */
33
public class DateRecordField extends StringRecordField {
34

  
35
	/** The field. */
36
	FormItem field;
37
	
38
	/**
39
	 * Instantiates a new date record area.
40
	 *
41
	 * @param panel the panel
42
	 * @param name the name
43
	 * @param multiple the multiple
44
	 * @param freeField the free field
45
	 * @param values the values
46
	 */
47
	public DateRecordField(EditPanel panel, String name, boolean multiple, boolean freeField,
48
			String[] values) {
49
		super(panel, name, multiple, freeField, values);
50
	}
51
	
52
	/* (non-Javadoc)
53
	 * @see org.ccc.bcccc.client.areas.StringRecordField#createField()
54
	 */
55
	@Override
56
	protected FormItem createField() {
57
		String lname = name.toLowerCase().replace(" ", "");
58
		field = new DateItem(lname+""+no++);
59
		return field;
60
	}
61
	
62
	/* (non-Javadoc)
63
	 * @see org.ccc.bcccc.client.areas.StringRecordField#addDefaultPickers(com.smartgwt.client.widgets.form.fields.FormItem, com.smartgwt.client.widgets.form.fields.PickerIcon)
64
	 */
65
	protected void addDefaultPickers(FormItem field, PickerIcon editPicker) {
66
		
67
	}
68

  
69
	/**
70
	 * Sets the value.
71
	 *
72
	 * @param date the new value
73
	 */
74
	public void setValue(Date date) {
75
		if (items.size() > 0 ) {
76
			FormItem field = items.get(0);
77
			((DateItem)field).setValue(date);
78
		}
79
	}
80

  
81
	/**
82
	 * Gets the date.
83
	 *
84
	 * @return the date
85
	 */
86
	public Date getDate() {
87
		return ((DateItem)field).getValueAsDate();
88
	}
89
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/RecordNameField.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import java.util.ArrayList;
22
import java.util.List;
23

  
24
import org.ccc.bcccc.client.panels.EditPanel;
25

  
26
import com.google.gwt.user.client.ui.Label;
27
import com.smartgwt.client.types.TitleOrientation;
28
import com.smartgwt.client.util.SC;
29
import com.smartgwt.client.util.ValueCallback;
30
import com.smartgwt.client.widgets.form.DynamicForm;
31
import com.smartgwt.client.widgets.form.fields.FormItem;
32
import com.smartgwt.client.widgets.form.fields.PickerIcon;
33
import com.smartgwt.client.widgets.form.fields.PickerIcon.Picker;
34
import com.smartgwt.client.widgets.form.fields.SelectItem;
35
import com.smartgwt.client.widgets.form.fields.StaticTextItem;
36
import com.smartgwt.client.widgets.form.fields.TextItem;
37
import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler;
38
import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent;
39
import com.smartgwt.client.widgets.layout.HLayout;
40

  
41

  
42
// TODO: Auto-generated Javadoc
43
/**
44
 * The Class StringRecordField.
45
 */
46
public class RecordNameField extends HLayout {
47

  
48
	/** The no. */
49
	protected static int no = 1;
50
	
51
	/** The panel. */
52
	protected EditPanel panel;
53
	
54
	/** The form. */
55
	DynamicForm form;
56
	TextItem field;
57

  
58
	/**
59
	 * Instantiates a new string record field.
60
	 *
61
	 * @param panel the panel
62
	 * @param name the name
63
	 * @param multiple the multiple
64
	 * @param freeField the free field
65
	 * @param values the values
66
	 */
67
	public RecordNameField(EditPanel panel) {
68
		this.panel = panel;
69

  
70
		form = new DynamicForm();
71
		form.setTitleOrientation(TitleOrientation.LEFT);
72
		form.setWidth100();
73
		
74
		this.setWidth100();
75
		this.addMember(form);
76

  
77
		field = new TextItem("name"+no++);
78
		field.setTitle("Nom de la fiche");
79
		form.setFields(field);
80
	}
81

  
82
	/**
83
	 * Gets the value.
84
	 *
85
	 * @return the value
86
	 */
87
	public String getValue() {
88
		Object v = field.getValue();
89
		if (v == null) return "";
90
		return field.getValueAsString();
91
	}
92

  
93
	
94

  
95
	/**
96
	 * Sets the can edit.
97
	 *
98
	 * @param v the new can edit
99
	 */
100
	public void setCanEdit(boolean v) {
101
		if (form != null)
102
			form.setCanEdit(v);
103
	}
104

  
105
	/**
106
	 * Sets the value.
107
	 *
108
	 * @param v the new value
109
	 */
110
	public void setValue(String v) {
111
		field.setValue(v);
112
	}
113
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/PublicationsRecordArea.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import java.util.ArrayList;
22
import java.util.List;
23

  
24
import org.ccc.bcccc.client.areas.fields.PublicationRecordField;
25
import org.ccc.bcccc.client.panels.EditPanel;
26
import org.ccc.bcccc.shared.Publication;
27

  
28
import com.smartgwt.client.widgets.Button;
29
import com.smartgwt.client.widgets.Label;
30
import com.smartgwt.client.widgets.layout.VLayout;
31

  
32
// TODO: Auto-generated Javadoc
33
/**
34
 * The Class PublicationsRecordArea.
35
 */
36
public class PublicationsRecordArea extends VLayout {
37

  
38
	/** The fields. */
39
	ArrayList<PublicationRecordField> fields = new ArrayList<PublicationRecordField>();
40
	
41
	/**
42
	 * Instantiates a new publications record area.
43
	 *
44
	 * @param panel the panel
45
	 * @param name the name
46
	 */
47
	public PublicationsRecordArea(EditPanel panel, String name) {
48
		this.setWidth100();
49
		
50
		Label title = new Label();
51
		title.setContents(name);
52
		this.addMember(title);
53
		
54
		Button addButton = new Button("Ajouter une publication");
55
		this.addMember(addButton);
56
		addButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
57
			
58
			@Override
59
			public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
60
				addAField();
61
			}
62
		});
63
		
64
		addAField(); // create at least one entry
65
	}
66

  
67
	/** The n. */
68
	static int n;
69
	
70
	/** The Constant NITEMPERROW. */
71
	public static final int NITEMPERROW = 5;
72
	
73
	/* (non-Javadoc)
74
	 * @see org.ccc.bcccc.client.areas.StringRecordField#addAField()
75
	 */
76
	public void addAField() {
77
		PublicationRecordField f = new PublicationRecordField(this, n);
78
		this.addMember(f);
79
		fields.add(f);
80
		n++;
81
	}
82

  
83
	/**
84
	 * Sets the publication values.
85
	 *
86
	 * @param values the new publication values
87
	 */
88
	public void setValues(List<Publication> values) {
89
		
90
		while (fields.size() > values.size() ) {
91
			this.remove(fields.get(0));
92
		}
93
		
94
		int i = 0;
95
		for (Publication d : values) {
96
			if (fields.size() <= i) addAField();
97

  
98
			PublicationRecordField f = fields.get(i);
99
			f.setValue(d);
100
			i++;
101
		}
102
	}
103

  
104
	/**
105
	 * Sets the can edit.
106
	 *
107
	 * @param v the new can edit
108
	 */
109
	public void setCanEdit(boolean v) {
110
		for (PublicationRecordField form : fields) {
111
			form.setCanEdit(v);
112
		}
113
	}
114

  
115
	/**
116
	 * Gets the values.
117
	 *
118
	 * @return the values
119
	 */
120
	public List<Publication> getValues() {
121
		List<Publication> values = new ArrayList<Publication>();
122
		for (PublicationRecordField form : fields) {
123
			values.add(form.getValue());
124
		}
125
		return values;
126
	}
127

  
128
	/**
129
	 * Removes the.
130
	 *
131
	 * @param publicationRecordField the dispositifs record field
132
	 */
133
	public void remove(PublicationRecordField publicationRecordField) {
134
		this.removeMember(publicationRecordField);
135
		fields.remove(publicationRecordField);
136
		publicationRecordField.destroy();
137
	}
138
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/RecordDescriptionField.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import org.ccc.bcccc.client.panels.EditPanel;
22

  
23
import com.smartgwt.client.widgets.Label;
24
import com.smartgwt.client.widgets.RichTextEditor;
25
import com.smartgwt.client.widgets.form.DynamicForm;
26
import com.smartgwt.client.widgets.layout.HLayout;
27

  
28

  
29
// TODO: Auto-generated Javadoc
30
/**
31
 * The Class LongStringRecordArea.
32
 */
33
public class RecordDescriptionField extends HLayout {
34

  
35
	/** The no. */
36
	protected static int no = 1;
37
	DynamicForm form;
38
	RichTextEditor field;
39
	
40
	/**
41
	 * Instantiates a new long string record area.
42
	 *
43
	 * @param panel the panel
44
	 * @param name the name
45
	 * @param multiple the multiple
46
	 * @param freeField the free field
47
	 */
48
	public RecordDescriptionField(EditPanel panel) {
49
		super();
50
		
51
		this.setWidth100();
52
		
53
		Label l = new Label();
54
		l.setContents("Description courte<br>(20 lignes max)");
55
		
56
		field = new RichTextEditor();
57
		field.setHeight(200);  
58
        field.setCanDragResize(true);  
59
        field.setShowEdges(true);  
60
        field.setWidth("100%");
61
		
62
        this.addMember(l);
63
        this.addMember(field);
64
	}
65

  
66
	public String getValue() {
67
		return field.getValue();
68
	}
69

  
70
	public void setValue(String short_description) {
71
		field.setValue(short_description);
72
	}
73
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/ReportsRecordArea.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import java.util.ArrayList;
22
import java.util.List;
23

  
24
import org.ccc.bcccc.client.areas.fields.ReportRecordField;
25
import org.ccc.bcccc.client.panels.EditPanel;
26
import org.ccc.bcccc.shared.Report;
27

  
28
import com.smartgwt.client.widgets.Button;
29
import com.smartgwt.client.widgets.Label;
30
import com.smartgwt.client.widgets.layout.VLayout;
31

  
32
// TODO: Auto-generated Javadoc
33
/**
34
 * The Class ReportsRecordArea.
35
 */
36
public class ReportsRecordArea extends VLayout {
37

  
38
	/** The fields. */
39
	ArrayList<ReportRecordField> fields = new ArrayList<ReportRecordField>();
40
	
41
	/**
42
	 * Instantiates a new reports record area.
43
	 *
44
	 * @param panel the panel
45
	 * @param name the name
46
	 */
47
	public ReportsRecordArea(EditPanel panel, String name) {
48
		this.setWidth100();
49
		
50
		Label title = new Label();
51
		title.setContents(name);
52
		this.addMember(title);
53
		
54
		Button addButton = new Button("Ajouter un rapport");
55
		this.addMember(addButton);
56
		addButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
57
			
58
			@Override
59
			public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
60
				addAField();
61
			}
62
		});
63
		
64
		addAField(); // create at least one entry
65
	}
66

  
67
	/** The n. */
68
	static int n = 0;
69
	
70
	/**
71
	 * Adds the a field.
72
	 */
73
	public void addAField() {
74
		ReportRecordField f = new ReportRecordField(this, n);
75
		this.addMember(f);
76
		fields.add(f);
77
		n++;
78
	}
79

  
80
	/**
81
	 * Sets the values.
82
	 *
83
	 * @param values the new values
84
	 */
85
	public void setValues(List<Report> values) {
86
		
87
		while (fields.size() > values.size() ) {
88
			this.removeField(fields.get(0));
89
		}
90
		
91
		int i = 0;
92
		for (Report d : values) {
93
			if (fields.size() <= i) addAField();
94

  
95
			fields.get(i).setValue(d);
96
			i++;
97
		}
98
	}
99

  
100
	/**
101
	 * Sets the can edit.
102
	 *
103
	 * @param v the new can edit
104
	 */
105
	public void setCanEdit(boolean v) {
106
		for(ReportRecordField f: fields) {
107
			f.setCanEdit(v);
108
		}
109
	}
110

  
111
	/**
112
	 * Gets the values.
113
	 *
114
	 * @return the values
115
	 */
116
	public List<Report> getValues() {
117
		List<Report> values = new ArrayList<Report>();
118
		for(ReportRecordField f: fields) {
119
			values.add(f.getValue());
120
		}
121
		return values;
122
	}
123

  
124
	/**
125
	 * Removes the field.
126
	 *
127
	 * @param f the f
128
	 */
129
	public void removeField(ReportRecordField f) {
130
		this.removeMember(f);
131
		fields.remove(f);
132
		f.destroy();
133
		
134
	}
135
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/DispositifsRecordArea.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import java.util.ArrayList;
22
import java.util.List;
23

  
24
import org.ccc.bcccc.client.areas.fields.DispositifsRecordField;
25
import org.ccc.bcccc.client.panels.EditPanel;
26
import org.ccc.bcccc.shared.Dispositif;
27

  
28
import com.smartgwt.client.widgets.Button;
29
import com.smartgwt.client.widgets.Label;
30
import com.smartgwt.client.widgets.layout.VLayout;
31

  
32
// TODO: Auto-generated Javadoc
33
/**
34
 * The Class DispositifsRecordArea.
35
 */
36
public class DispositifsRecordArea extends VLayout {
37

  
38
	/** The fields. */
39
	ArrayList<DispositifsRecordField> fields = new ArrayList<DispositifsRecordField>();
40
	
41
	
42
	/**
43
	 * Instantiates a new dispositifs record area.
44
	 *
45
	 * @param panel the panel
46
	 * @param name the name
47
	 */
48
	public DispositifsRecordArea(EditPanel panel, String name) {
49
		this.setWidth100();
50
		
51
		Label title = new Label();
52
		title.setContents(name);
53
		this.addMember(title);
54
		
55
		Button addButton = new Button("Ajouter un dispositif (micro, caméra, etc.)");
56
		this.addMember(addButton);
57
		addButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
58
			
59
			@Override
60
			public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
61
				addAField();
62
			}
63
		});
64
		
65
		addAField(); // create at least one entry
66
	}
67

  
68
	/** The n. */
69
	static int n;
70
	
71
	/** The nitemperrow. */
72
	static public int NITEMPERROW = 5;
73

  
74
	/**
75
	 * Adds the a field.
76
	 */
77
	public void addAField() {
78
		DispositifsRecordField f = new DispositifsRecordField(this, n);
79
		this.addMember(f);
80
		fields.add(f);
81
		n++;
82
	}
83

  
84
	/**
85
	 * Sets the values.
86
	 *
87
	 * @param values the new values
88
	 */
89
	public void setValues(List<Dispositif> values) {
90
		
91
		while (fields.size() > values.size() ) {
92
			this.remove(fields.get(0));
93
		}
94
		
95
		int i = 0;
96
		for (Dispositif d : values) {
97
			if (fields.size() <= i) addAField();
98

  
99
			DispositifsRecordField f = fields.get(i);
100
			f.setValue(d);
101
			i++;
102
		}
103
	}
104

  
105
	/**
106
	 * Sets the can edit.
107
	 *
108
	 * @param v the new can edit
109
	 */
110
	public void setCanEdit(boolean v) {
111
		for (DispositifsRecordField form : fields) {
112
			form.setCanEdit(v);
113
		}
114
	}
115

  
116
	/**
117
	 * Gets the values.
118
	 *
119
	 * @return the values
120
	 */
121
	public List<Dispositif> getValues() {
122
		List<Dispositif> values = new ArrayList<Dispositif>();
123
		for (DispositifsRecordField form : fields) {
124
			values.add(form.getValue());
125
		}
126
		return values;
127
	}
128

  
129
	/**
130
	 * Removes the.
131
	 *
132
	 * @param dispositifsRecordField the dispositifs record field
133
	 */
134
	public void remove(DispositifsRecordField dispositifsRecordField) {
135
		this.removeMember(dispositifsRecordField);
136
		fields.remove(dispositifsRecordField);
137
		dispositifsRecordField.destroy();
138
	}
139
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/DocumentsRecordArea.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import java.util.ArrayList;
22
import java.util.List;
23

  
24
import org.ccc.bcccc.client.areas.fields.DocumentRecordField;
25
import org.ccc.bcccc.client.panels.EditPanel;
26
import org.ccc.bcccc.shared.DocumentUnit;
27

  
28
import com.smartgwt.client.widgets.Button;
29
import com.smartgwt.client.widgets.Label;
30
import com.smartgwt.client.widgets.layout.VLayout;
31

  
32
// TODO: Auto-generated Javadoc
33
/**
34
 * The Class DocumentsRecordArea.
35
 */
36
public class DocumentsRecordArea extends VLayout {
37

  
38
	/** The fields. */
39
	ArrayList<DocumentRecordField> fields = new ArrayList<DocumentRecordField>();
40
	
41
	
42
	/**
43
	 * Instantiates a new documents record area.
44
	 *
45
	 * @param panel the panel
46
	 * @param name the name
47
	 */
48
	public DocumentsRecordArea(EditPanel panel, String name) {
49
		this.setWidth100();
50
		
51
		Label title = new Label();
52
		title.setContents("Documents");
53
		this.addMember(title);
54
		
55
		Button addButton = new Button("Ajouter un document");
56
		this.addMember(addButton);
57
		addButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
58
			
59
			@Override
60
			public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
61
				addAField();
62
			}
63
		});
64
		
65
		addAField(); // create at least one entry
66
	}
67

  
68
	/** The n. */
69
	static int n;
70
	
71
	/** The nitemperrow. */
72
	public static int NITEMPERROW = 5;
73
	
74
	/* (non-Javadoc)
75
	 * @see org.ccc.bcccc.client.areas.StringRecordField#addAField()
76
	 */
77
	public void addAField() {
78
		DocumentRecordField f = new DocumentRecordField(this, n);
79
		this.addMember(f);
80
		fields.add(f);
81
		n++;
82
	}
83
	
84
	/**
85
	 * Sets the documentation values.
86
	 *
87
	 * @param values the new documentation values
88
	 */
89
	public void setValues(List<DocumentUnit> values) {
90
		
91
		while (fields.size() > values.size() ) {
92
			this.remove(fields.get(0));
93
		}
94
		
95
		int i = 0;
96
		for (DocumentUnit d : values) {
97
			if (fields.size() <= i) addAField();
98

  
99
			DocumentRecordField f = fields.get(i);
100
			f.setValue(d);
101
			i++;
102
		}
103
	}
104

  
105
	/* (non-Javadoc)
106
	 * @see org.ccc.bcccc.client.areas.StringRecordField#setCanEdit(boolean)
107
	 */
108
	public void setCanEdit(boolean v) {
109
		for (DocumentRecordField item : fields) {
110
			item.setCanEdit(v);
111
		}
112
	}
113

  
114
	/**
115
	 * Gets the values.
116
	 *
117
	 * @return the values
118
	 */
119
	public List<DocumentUnit> getValues() {
120
		List<DocumentUnit> values = new ArrayList<DocumentUnit>();
121
		for (DocumentRecordField item : fields) {
122
			values.add(item.getValue());
123
		}
124
		return values;
125
	}
126
	
127
	/**
128
	 * Removes the.
129
	 *
130
	 * @param docRecordField the dispositifs record field
131
	 */
132
	public void remove(DocumentRecordField docRecordField) {
133
		this.removeMember(docRecordField);
134
		fields.remove(docRecordField);
135
		docRecordField.destroy();
136
	}
137
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/DataRecordArea.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import java.util.ArrayList;
22
import java.util.List;
23

  
24
import org.ccc.bcccc.client.areas.fields.DataRecordField;
25
import org.ccc.bcccc.client.panels.EditPanel;
26
import org.ccc.bcccc.shared.Data;
27

  
28
import com.smartgwt.client.widgets.Button;
29
import com.smartgwt.client.widgets.Label;
30
import com.smartgwt.client.widgets.events.ClickEvent;
31
import com.smartgwt.client.widgets.events.ClickHandler;
32
import com.smartgwt.client.widgets.layout.VLayout;
33

  
34
// TODO: Auto-generated Javadoc
35
/**
36
 * The Class DataRecordArea.
37
 */
38
public class DataRecordArea extends VLayout {
39
	
40
	/** The fields. */
41
	ArrayList<DataRecordField> fields = new ArrayList<DataRecordField>();
42
	
43
	/**
44
	 * Instantiates a new data record area.
45
	 *
46
	 * @param panel the panel
47
	 * @param name the name
48
	 */
49
	public DataRecordArea(EditPanel panel, String name) {
50
		//super(panel, name, true, false, Data.values);
51
		//form.setNumCols(7); // show 3 item per line
52
		this.setWidth100();
53
		
54
		Label title = new Label();
55
		title.setContents(name);
56
		this.addMember(title);
57
		
58
		Button addButton = new Button("Ajouter une donnée");
59
		this.addMember(addButton);
60
		addButton.addClickHandler(new ClickHandler() {
61
			@Override
62
			public void onClick(ClickEvent event) {
63
				addAField();
64
			}
65
		});
66
		
67
		addAField(); // create at least one entry
68
	}
69

  
70
	/** The n. */
71
	static int n;
72
	
73
	/**
74
	 * Adds the a field.
75
	 */
76
	public void addAField() {
77
		DataRecordField f = new DataRecordField(this, n);
78
		this.addMember(f);
79
		fields.add(f);
80
		n++;
81
		//reloadFields();
82
	}
83

  
84
	/**
85
	 * Sets the data values.
86
	 *
87
	 * @param supports the new data values
88
	 */
89
	public void setValues(List<Data> supports) {
90
		
91
		while (fields.size() > supports.size() ) {
92
			this.removeField(fields.get(0));
93
		}
94
		
95
		int i = 0;
96
		for (Data d : supports) {
97
			if (fields.size() <= i) addAField();
98

  
99
			DataRecordField f = fields.get(i);
100
			f.setDataValue(d);
101
			i++;
102
		}
103
	}
104

  
105
	/**
106
	 * Gets the values.
107
	 *
108
	 * @return the values
109
	 */
110
	public List<Data> getValues() {
111
		List<Data> values = new ArrayList<Data>();
112
		for (DataRecordField f : fields) {
113
			values.add(f.getValue());
114
		}
115
		return values;
116
	}
117

  
118
	/**
119
	 * Removes the field.
120
	 *
121
	 * @param dataRecordField the data record field
122
	 */
123
	public void removeField(DataRecordField dataRecordField) {
124
		this.removeMember(dataRecordField);
125
		fields.remove(dataRecordField);
126
		dataRecordField.destroy();
127
	}
128

  
129
	/**
130
	 * Sets the can edit.
131
	 *
132
	 * @param editable the new can edit
133
	 */
134
	public void setCanEdit(boolean editable) {
135
		for (DataRecordField f : fields) {
136
			f.setDisabled(!editable);
137
		}
138
	}
139
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/RecordDataArea.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import java.util.ArrayList;
22
import java.util.List;
23

  
24
import org.ccc.bcccc.client.areas.fields.DataRecordField;
25
import org.ccc.bcccc.client.panels.EditPanel;
26
import org.ccc.bcccc.shared.Data;
27

  
28
import com.smartgwt.client.widgets.Button;
29
import com.smartgwt.client.widgets.Label;
30
import com.smartgwt.client.widgets.events.ClickEvent;
31
import com.smartgwt.client.widgets.events.ClickHandler;
32
import com.smartgwt.client.widgets.layout.VLayout;
33

  
34
// TODO: Auto-generated Javadoc
35
/**
36
 * The Class DataRecordArea.
37
 */
38
public class RecordDataArea extends VLayout {
39
	
40
	/** The fields. */
41
	ArrayList<DataRecordField> fields = new ArrayList<DataRecordField>();
42
	
43
	/**
44
	 * Instantiates a new data record area.
45
	 *
46
	 * @param panel the panel
47
	 * @param name the name
48
	 */
49
	public RecordDataArea(EditPanel panel, String name) {
50
		//super(panel, name, true, false, Data.values);
51
		//form.setNumCols(7); // show 3 item per line
52
		this.setWidth100();
53
		
54
		Label title = new Label();
55
		title.setContents(name);
56
		this.addMember(title);
57
		
58
		Button addButton = new Button("Ajouter une donnée");
59
		this.addMember(addButton);
60
		addButton.addClickHandler(new ClickHandler() {
61
			@Override
62
			public void onClick(ClickEvent event) {
63
				addAField();
64
			}
65
		});
66
		
67
		addAField(); // create at least one entry
68
	}
69

  
70
	/** The n. */
71
	static int n;
72
	
73
	/**
74
	 * Adds the a field.
75
	 */
76
	public void addAField() {
77
		DataRecordField f = new DataRecordField(this, n);
78
		this.addMember(f);
79
		fields.add(f);
80
		n++;
81
		//reloadFields();
82
	}
83

  
84
	/**
85
	 * Sets the data values.
86
	 *
87
	 * @param supports the new data values
88
	 */
89
	public void setValues(List<Data> supports) {
90
		
91
		while (fields.size() > supports.size() ) {
92
			this.removeField(fields.get(0));
93
		}
94
		
95
		int i = 0;
96
		for (Data d : supports) {
97
			if (fields.size() <= i) addAField();
98

  
99
			DataRecordField f = fields.get(i);
100
			f.setDataValue(d);
101
			i++;
102
		}
103
	}
104

  
105
	/**
106
	 * Gets the values.
107
	 *
108
	 * @return the values
109
	 */
110
	public List<Data> getValues() {
111
		List<Data> values = new ArrayList<Data>();
112
		for (DataRecordField f : fields) {
113
			values.add(f.getValue());
114
		}
115
		return values;
116
	}
117

  
118
	/**
119
	 * Removes the field.
120
	 *
121
	 * @param dataRecordField the data record field
122
	 */
123
	public void removeField(DataRecordField dataRecordField) {
124
		this.removeMember(dataRecordField);
125
		fields.remove(dataRecordField);
126
		dataRecordField.destroy();
127
	}
128

  
129
	/**
130
	 * Sets the can edit.
131
	 *
132
	 * @param editable the new can edit
133
	 */
134
	public void setCanEdit(boolean editable) {
135
		for (DataRecordField f : fields) {
136
			f.setDisabled(!editable);
137
		}
138
	}
139
}
projets/BCCCC/src/org/ccc/bcccc/client/areas/RecordParticipantsNumberArea.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import org.ccc.bcccc.client.panels.EditPanel;
22

  
23
import com.smartgwt.client.types.TitleOrientation;
24
import com.smartgwt.client.widgets.form.DynamicForm;
25
import com.smartgwt.client.widgets.form.fields.SpinnerItem;
26
import com.smartgwt.client.widgets.layout.HLayout;
27

  
28
// TODO: Auto-generated Javadoc
29
/**
30
 * The Class DoubleStringRecordArea.
31
 */
32
public class RecordParticipantsNumberArea extends HLayout {
33

  
34
	/** The name. */
35
	String name;
36

  
37
	/** The panel. */
38
	protected EditPanel panel;
39

  
40
	private SpinnerItem f;
41

  
42
	/**
43
	 * Instantiates a new string record field.
44
	 *
45
	 * @param panel the panel
46
	 * @param name the name
47
	 * @param multiple the multiple
48
	 * @param freeField the free field
49
	 * @param values the values
50
	 */
51
	public RecordParticipantsNumberArea(EditPanel panel, String name) {
52
		this.panel = panel;
53
		this.name = name;
54

  
55
		DynamicForm form = new DynamicForm();
56
		form.setTitleOrientation(TitleOrientation.LEFT);
57
		form.setWidth100();
58

  
59
		this.setWidth100();
60
		this.addMember(form);
61

  
62
		String lname = name.toLowerCase().replace(" ", "");
63
		f = new SpinnerItem(lname);
64
		f.setMin(1);
65
		f.setMax(10000);
66
		f.setTitle(name);
67
		
68
		form.setItems(f);
69
	}
70

  
71
	/**
72
	 * Gets the value.
73
	 *
74
	 * @return the value
75
	 */
76
	public String getValue() {
77
		return f.getValueAsString();
78
	}
79

  
80
	/**
81
	 * Sets the can edit.
82
	 *
83
	 * @param v the new can edit
84
	 */
85
	public void setCanEdit(boolean v) {
86
		f.setCanEdit(v);
87
	}
88

  
89
	/**
90
	 * Sets the value.
91
	 *
92
	 * @param numberOfParticipants the new value
93
	 */
94
	public void setValue(int numberOfParticipants) {
95
		f.setValue(numberOfParticipants);
96
	}
97
}
0 98

  
projets/BCCCC/src/org/ccc/bcccc/client/areas/RecordDateArea.java (revision 8)
1
/*
2
 * Authors: Matthieu Decorde
3
 * 
4
 * COPYRIGHT 2015 ICAR - CCC
5
 * 
6
 * This software is free software: you can redistribute it 
7
 * and/or modify it under the terms of the GNU General Public
8
 * License as published by the Free Software Foundation,
9
 * either version 2 of the License, or (at your option) any
10
 * later version.
11
 * 
12
 * This software is distributed in the hope that it will be
13
 * useful, but WITHOUT ANY WARRANTY; without even the implied
14
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
 * PURPOSE. See the GNU General Public License for more
16
 * details.
17
 * 
18
 */
19
package org.ccc.bcccc.client.areas;
20

  
21
import java.util.Date;
22

  
23
import org.ccc.bcccc.client.panels.EditPanel;
24

  
25
import com.smartgwt.client.widgets.form.fields.DateItem;
26
import com.smartgwt.client.widgets.form.fields.FormItem;
27
import com.smartgwt.client.widgets.form.fields.PickerIcon;
28

  
29
// TODO: Auto-generated Javadoc
30
/**
31
 * The Class DateRecordArea.
32
 */
33
public class RecordDateArea extends StringRecordField {
34

  
35
	/** The field. */
36
	FormItem field;
37
	
38
	/**
39
	 * Instantiates a new date record area.
40
	 *
41
	 * @param panel the panel
42
	 * @param name the name
43
	 * @param multiple the multiple
44
	 * @param freeField the free field
45
	 * @param values the values
46
	 */
47
	public RecordDateArea(EditPanel panel, String name, boolean multiple, boolean freeField,
48
			String[] values) {
49
		super(panel, name, multiple, freeField, values);
50
	}
51
	
52
	/* (non-Javadoc)
53
	 * @see org.ccc.bcccc.client.areas.StringRecordField#createField()
54
	 */
55
	@Override
56
	protected FormItem createField() {
57
		String lname = name.toLowerCase().replace(" ", "");
58
		field = new DateItem(lname+""+no++);
59
		return field;
60
	}
61
	
62
	/* (non-Javadoc)
63
	 * @see org.ccc.bcccc.client.areas.StringRecordField#addDefaultPickers(com.smartgwt.client.widgets.form.fields.FormItem, com.smartgwt.client.widgets.form.fields.PickerIcon)
64
	 */
65
	protected void addDefaultPickers(FormItem field, PickerIcon editPicker) {
66
		
67
	}
68

  
69
	/**
70
	 * Sets the value.
71
	 *
72
	 * @param date the new value
73
	 */
74
	public void setValue(Date date) {
75
		if (items.size() > 0 ) {
76
			FormItem field = items.get(0);
77
			((DateItem)field).setValue(date);
78
		}
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff