use of org.talend.commons.ui.swt.advanced.dataeditor.button.MoveUpPushButtonForExtendedTable in project tdi-studio-se by Talend.
the class HL7MetadataEmfToolbarEditor method createMoveUpPushButton.
@Override
protected MoveUpPushButton createMoveUpPushButton() {
return new MoveUpPushButtonForExtendedTable(toolbar, extendedTableViewer) {
@Override
protected void afterCommandExecution(Command executedCommand) {
MetadataEmfTableEditor tableEditorModel = (MetadataEmfTableEditor) getExtendedTableViewer().getExtendedControlModel();
IStructuredSelection selection = (IStructuredSelection) ((HL7MultiSchemaUI) linker.getMainui()).getMetaTableViewer().getSelection();
Object selectedObj = selection.getFirstElement();
if (selectedObj != null) {
String key = ((IModel) selectedObj).getDisplayName();
List<MetadataColumn> metadataColumnList = tableEditorModel.getMetadataColumnList();
Map<String, List<MetadataColumn>> schemaRelationMap = linker.getManager().getSchemaRelationMap();
if (schemaRelationMap != null) {
List<MetadataColumn> schemas = new ArrayList<MetadataColumn>();
schemas.addAll(metadataColumnList);
schemaRelationMap.put(key, schemas);
}
}
linker.getMainui().redrawLinkers();
linker.getBackgroundRefresher().refreshBackground();
}
@Override
public boolean getEnabledState() {
// 13749
return super.getEnabledState() && !isRepository;
}
};
}
Aggregations