OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 144 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 144 Rev 156
Line 43... Line 43...
43
    private Class<?> valueClass;
43
    private Class<?> valueClass;
44
 
44
 
45
    // Default value (to add a new line)
45
    // Default value (to add a new line)
46
    private Object defaultValue;
46
    private Object defaultValue;
47
 
47
 
48
    private Integer horizontalAlignment = null;
48
    private Integer horizontalAlignment = LightUIElement.HALIGN_LEFT;
49
 
49
 
50
    private double width;
50
    private double width;
51
    private double maxWidth;
51
    private double maxWidth;
52
    private double minWidth;
52
    private double minWidth;
53
 
53
 
Line 117... Line 117...
117
 
117
 
118
    public int getHorizontalAlignment() {
118
    public int getHorizontalAlignment() {
119
        return this.horizontalAlignment;
119
        return this.horizontalAlignment;
120
    }
120
    }
121
 
121
 
-
 
122
    /**
-
 
123
     * 
-
 
124
     * @param horizontalAlignment LightUIElement.HALIGN_LEFT, LightUIElement.HALIGN_RIGHT or
-
 
125
     *        LightUIElement.HALIGN_CENTER
-
 
126
     */
122
    public void setHorizontalAlignment(final int horizontalAlignment) {
127
    public void setHorizontalAlignment(final int horizontalAlignment) {
123
        this.horizontalAlignment = horizontalAlignment;
128
        this.horizontalAlignment = horizontalAlignment;
124
    }
129
    }
125
 
130
 
126
    public String getColumnName() {
131
    public String getColumnName() {
Line 182... Line 187...
182
    private void setDefaultPrefs() {
187
    private void setDefaultPrefs() {
183
        // TODO : Faire varier en fonction du type;
188
        // TODO : Faire varier en fonction du type;
184
        this.width = 200;
189
        this.width = 200;
185
        this.maxWidth = 500;
190
        this.maxWidth = 500;
186
        this.minWidth = 50;
191
        this.minWidth = 50;
-
 
192
        this.horizontalAlignment = LightUIElement.HALIGN_LEFT;
187
    }
193
    }
188
 
194
 
189
    public Element createXmlColumnPref() {
195
    public Element createXmlColumnPref() {
190
        final Element columnElement = new Element("column");
196
        final Element columnElement = new Element("column");
191
        columnElement.setAttribute(ID, this.getId());
197
        columnElement.setAttribute(ID, this.getId());
Line 241... Line 247...
241
        if (this.editors != null) {
247
        if (this.editors != null) {
242
            result.put(EDITORS, JSONConverter.getJSON(this.editors));
248
            result.put(EDITORS, JSONConverter.getJSON(this.editors));
243
        }
249
        }
244
        result.put(VALUE_CLASS, JSONConverter.getJSON(this.valueClass));
250
        result.put(VALUE_CLASS, JSONConverter.getJSON(this.valueClass));
245
 
251
 
246
        if (this.horizontalAlignment != null) {
252
        if (this.horizontalAlignment != LightUIElement.HALIGN_LEFT) {
247
            result.put(HORIZONTAL_ALIGNMENT, this.horizontalAlignment);
253
            result.put(HORIZONTAL_ALIGNMENT, this.horizontalAlignment);
248
        }
254
        }
249
        return result;
255
        return result;
250
    }
256
    }
251
 
257
 
Line 269... Line 275...
269
        }
275
        }
270
        /************************************************************/
276
        /************************************************************/
271
 
277
 
272
        this.editable = JSONConverter.getParameterFromJSON(json, EDITABLE, Boolean.class, Boolean.FALSE);
278
        this.editable = JSONConverter.getParameterFromJSON(json, EDITABLE, Boolean.class, Boolean.FALSE);
273
        this.horizontalAlignment = JSONConverter.getParameterFromJSON(json, HORIZONTAL_ALIGNMENT, Integer.class);
279
        this.horizontalAlignment = JSONConverter.getParameterFromJSON(json, HORIZONTAL_ALIGNMENT, Integer.class);
-
 
280
        if (this.horizontalAlignment == null) {
-
 
281
            this.horizontalAlignment = LightUIElement.HALIGN_LEFT;
274
 
282
        }
275
        final JSONObject jsonDefaultValue = JSONConverter.getParameterFromJSON(json, DEFAULT_VALUE, JSONObject.class);
283
        final JSONObject jsonDefaultValue = JSONConverter.getParameterFromJSON(json, DEFAULT_VALUE, JSONObject.class);
276
        // TODO: implement default value
284
        // TODO: implement default value
277
 
285
 
278
        final JSONObject jsonEditors = JSONConverter.getParameterFromJSON(json, EDITORS, JSONObject.class);
286
        final JSONObject jsonEditors = JSONConverter.getParameterFromJSON(json, EDITORS, JSONObject.class);
279
        if (jsonEditors != null) {
287
        if (jsonEditors != null) {