OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 174 Rev 177
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.action;
14
 package org.openconcerto.erp.action;
15
 
15
 
16
import org.openconcerto.erp.utils.TM;
16
import static org.openconcerto.erp.utils.TM.getERP_TM;
-
 
17
 
17
import org.openconcerto.sql.PropsConfiguration;
18
import org.openconcerto.sql.PropsConfiguration;
18
import org.openconcerto.sql.element.SQLElement;
19
import org.openconcerto.sql.element.SQLElement;
19
import org.openconcerto.sql.view.EditFrame;
20
import org.openconcerto.sql.view.EditFrame;
20
import org.openconcerto.sql.view.EditPanel;
21
import org.openconcerto.sql.view.EditPanel;
21
import org.openconcerto.utils.StringUtils;
22
import org.openconcerto.utils.StringUtils;
Line 32... Line 33...
32
        this(conf, conf.getDirectory().getElementOfClass(clazz, true));
33
        this(conf, conf.getDirectory().getElementOfClass(clazz, true));
33
    }
34
    }
34
 
35
 
35
    protected CreateEditFrameAbstractAction(final PropsConfiguration conf, final E elem) {
36
    protected CreateEditFrameAbstractAction(final PropsConfiguration conf, final E elem) {
36
        super(elem);
37
        super(elem);
37
        // TODO use conf to find TM
-
 
38
        final NounClass nounClass = this.getElem().getName().getNounClass();
38
        final NounClass nounClass = this.getElem().getName().getNounClass();
39
        final String[] translationKeys = nounClass == null ? TRANSLATION_KEY_ARRAY : new String[] { TRANSLATION_KEY + '.' + nounClass.getName(), TRANSLATION_KEY };
39
        final String[] translationKeys = nounClass == null ? TRANSLATION_KEY_ARRAY : new String[] { TRANSLATION_KEY + '.' + nounClass.getName(), TRANSLATION_KEY };
40
        this.putValue(NAME, StringUtils.firstUp(TM.getTM().translateFirst(MissingMode.NULL, MessageArgs.create("elem", this.getElem().getName()), translationKeys)));
40
        this.putValue(NAME, StringUtils.firstUp(getERP_TM(conf.getLocale()).translateFirst(MissingMode.STRING, MessageArgs.create("elem", this.getElem().getName()), translationKeys)));
41
    }
41
    }
42
 
42
 
43
    @Override
43
    @Override
44
    protected final EditFrame instantiateFrame() {
44
    protected final EditFrame instantiateFrame() {
45
        return new EditFrame(getElem().createComponent(getComponentID()), EditPanel.CREATION);
45
        return new EditFrame(getElem().createComponent(getComponentID()), EditPanel.CREATION);