OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 74 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.openconcerto.modules.extensionbuilder.translation.field;

import javax.swing.JPanel;
import javax.swing.JScrollPane;

import org.openconcerto.modules.extensionbuilder.Extension;
import org.openconcerto.modules.extensionbuilder.list.EditableListPanel;

public class AllTableListPanel extends EditableListPanel {

    private TableTranslationPanel tableTranslationPanel;
    private Extension extension;

    public AllTableListPanel(Extension extension, TableTranslationPanel tableTranslationPanel) {
        super(new AllKnownTableNameListModel(extension), "Tables", "", false, false);
        this.extension = extension;
        this.tableTranslationPanel = tableTranslationPanel;
    }

    @Override
    public void addNewItem() {
    }

    @Override
    public void renameItem(Object item) {
    }

    @Override
    public void removeItem(Object item) {
    }

    @Override
    public void itemSelected(Object item) {
        if (item != null) {
            this.tableTranslationPanel.setRightPanel(new JScrollPane(new TableTranslationEditorPanel(this.extension, (String) item)));
        } else {
            this.tableTranslationPanel.setRightPanel(new JPanel());
        }

    }

}