OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 142 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 142 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 12... Line 12...
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.sql.view.list;
14
 package org.openconcerto.sql.view.list;
15
 
15
 
16
import org.openconcerto.sql.element.SQLElement;
16
import org.openconcerto.sql.element.SQLElement;
-
 
17
import org.openconcerto.sql.request.ComboSQLRequest.KeepMode;
17
import org.openconcerto.sql.request.ListSQLRequest;
18
import org.openconcerto.sql.request.ListSQLRequest;
18
 
19
 
19
/**
20
/**
20
 * A SQLTableModelSource directly tied to the database. Any changes to its lines are propagated to
21
 * A SQLTableModelSource directly tied to the database. Any changes to its lines are propagated to
21
 * the database without any delay.
22
 * the database without any delay.
22
 * 
23
 * 
23
 * @author Sylvain
24
 * @author Sylvain
24
 */
25
 */
25
public class SQLTableModelSourceOnline extends SQLTableModelSource {
26
public class SQLTableModelSourceOnline extends SQLTableModelSource {
26
 
27
 
-
 
28
    private final KeepMode keepMode;
-
 
29
 
27
    public SQLTableModelSourceOnline(final ListSQLRequest req, final SQLElement elem) {
30
    public SQLTableModelSourceOnline(final ListSQLRequest req, final SQLElement elem) {
-
 
31
        this(req, elem, KeepMode.GRAPH);
-
 
32
    }
-
 
33
 
-
 
34
    public SQLTableModelSourceOnline(final ListSQLRequest req, final SQLElement elem, final KeepMode keepMode) {
28
        super(req, elem);
35
        super(req, elem);
-
 
36
        if (keepMode == null || keepMode == KeepMode.NONE)
-
 
37
            throw new IllegalArgumentException("Invalid mode : " + keepMode);
-
 
38
        this.keepMode = keepMode;
29
    }
39
    }
30
 
40
 
31
    public SQLTableModelSourceOnline(SQLTableModelSourceOnline src) {
41
    public SQLTableModelSourceOnline(SQLTableModelSourceOnline src) {
32
        super(src);
42
        super(src);
-
 
43
        this.keepMode = src.keepMode;
-
 
44
    }
-
 
45
 
-
 
46
    @Override
-
 
47
    public final KeepMode getKeepMode() {
-
 
48
        return this.keepMode;
33
    }
49
    }
34
 
50
 
35
    @Override
51
    @Override
36
    protected boolean allowBiggerGraph() {
52
    protected boolean allowBiggerGraph() {
37
        return true;
53
        return true;