Search in sources :

Example 1 with ListenableList

use of org.talend.commons.utils.data.list.ListenableList in project tdi-studio-se by Talend.

the class MetadataImportXmlCommand method execute.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.core.ui.metadata.extended.command.MetadataImportXmlCommand#execute()
     */
@Override
public void execute() {
    try {
        removed = new ArrayList<IMetadataColumn>(extendedTableModel.getBeansList());
        extendedTableModel.removeAll(removed);
        added = MetadataSchema.initializeColumns(file);
        extendedTableModel.addAll(added, true, false);
        if (extendedTableModel.getBeansList() instanceof ListenableList) {
            ListenableList beanList = (ListenableList) extendedTableModel.getBeansList();
            beanList.fireReplacedEvent(0, removed, added, false);
        }
    } catch (Exception e) {
        new ErrorDialogWidthDetailArea(null, XmlMapPlugin.PLUGIN_ID, "Can not import schema from invalid xml", ExceptionUtils.getFullStackTrace(e));
        ExceptionHandler.process(e);
    }
}
Also used : ListenableList(org.talend.commons.utils.data.list.ListenableList) ErrorDialogWidthDetailArea(org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea) IMetadataColumn(org.talend.core.model.metadata.IMetadataColumn)

Aggregations

ErrorDialogWidthDetailArea (org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea)1 ListenableList (org.talend.commons.utils.data.list.ListenableList)1 IMetadataColumn (org.talend.core.model.metadata.IMetadataColumn)1