use of org.talend.commons.ui.swt.extended.table.IExtendedControlListener in project tdi-studio-se by Talend.
the class JSONToXPathLinker method initLoopListeners.
/**
* DOC amaumont Comment method "initListeners".
*/
private void initLoopListeners() {
JSONExtractorLoopModel loopModel = this.loopTableEditorView.getModel();
final Table loopTable = this.loopTableEditorView.getTableViewerCreator().getTable();
loopModelModifiedBeanListener = new IModifiedBeanListener<JSONXPathLoopDescriptor>() {
@Override
public void handleEvent(ModifiedBeanEvent<JSONXPathLoopDescriptor> event) {
handleModifiedBeanEvent(event);
}
private void handleModifiedBeanEvent(ModifiedBeanEvent<JSONXPathLoopDescriptor> event) {
if (event.column == loopTableEditorView.getXPathColumn()) {
onXPathValueChanged(loopTable, (String) event.newValue, event.index);
}
}
};
loopModel.addModifiedBeanListener(loopModelModifiedBeanListener);
loopTableExtendedControlListener = new IExtendedControlListener() {
@Override
public void handleEvent(ExtendedControlEvent event) {
if (event.getType() == EVENT_TYPE.MODEL_CHANGED) {
nodeRetriever.setCurrentLoopXPath(getCurrentLoopXPath());
}
}
};
this.loopTableEditorView.getExtendedTableViewer().addListener(loopTableExtendedControlListener);
SelectionHelper selectionHelper = this.loopTableEditorView.getTableViewerCreator().getSelectionHelper();
afterLineSelectionListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
updateLinksStyleAndControlsSelection(e.source.getTable(), true);
}
};
selectionHelper.addAfterSelectionListener(afterLineSelectionListener);
}
Aggregations