use of org.talend.commons.ui.runtime.swt.tableviewer.selection.SelectionHelper in project tdi-studio-se by Talend.
the class JSONToXPathLinker method removeFieldsListeners.
private void removeFieldsListeners() {
JSONExtractorFieldModel schemaModel = this.fieldsTableEditorView.getModel();
schemaModel.removeModifiedBeanListener(schemaModelModifiedBeanListener);
schemaModel.removeModifiedListListener(schemaModelBeforeListenableListListener);
schemaModel.removeModifiedListListener(schemaModelAfterListenableListListener);
SelectionHelper selectionHelper = this.fieldsTableEditorView.getTableViewerCreator().getSelectionHelper();
selectionHelper.removeAfterSelectionListener(fieldsTableLineSelectionListener);
}
use of org.talend.commons.ui.runtime.swt.tableviewer.selection.SelectionHelper in project tdi-studio-se by Talend.
the class JSONToXPathLinker method initFieldsListeners.
/**
* DOC amaumont Comment method "initListeners".
*/
private void initFieldsListeners() {
JSONExtractorFieldModel schemaModel = this.fieldsTableEditorView.getModel();
final Table fieldsTable = this.fieldsTableEditorView.getTable();
schemaModelModifiedBeanListener = new IModifiedBeanListener<SchemaTarget>() {
@Override
public void handleEvent(ModifiedBeanEvent<SchemaTarget> event) {
handleModifiedBeanEvent(event);
}
private void handleModifiedBeanEvent(ModifiedBeanEvent<SchemaTarget> event) {
if (event.column == fieldsTableEditorView.getXPathColumn()) {
onXPathValueChanged(fieldsTable, (String) event.newValue, event.index);
}
}
};
schemaModel.addModifiedBeanListener(schemaModelModifiedBeanListener);
schemaModelBeforeListenableListListener = new IListenableListListener<SchemaTarget>() {
@Override
public void handleEvent(ListenableListEvent<SchemaTarget> event) {
handleListenableListBeforeTableViewerRefreshedEvent(event);
}
};
schemaModel.addBeforeOperationListListener(-50, schemaModelBeforeListenableListListener);
schemaModelAfterListenableListListener = new IListenableListListener<SchemaTarget>() {
@Override
public void handleEvent(ListenableListEvent<SchemaTarget> event) {
handleListenableListAfterTableViewerRefreshedEvent(event);
}
};
schemaModel.addAfterOperationListListener(schemaModelAfterListenableListListener);
SelectionHelper selectionHelper = this.fieldsTableEditorView.getTableViewerCreator().getSelectionHelper();
fieldsTableLineSelectionListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
updateLinksStyleAndControlsSelection(e.source.getTable(), true);
}
};
selectionHelper.addAfterSelectionListener(fieldsTableLineSelectionListener);
}
use of org.talend.commons.ui.runtime.swt.tableviewer.selection.SelectionHelper 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);
}
use of org.talend.commons.ui.runtime.swt.tableviewer.selection.SelectionHelper in project tdi-studio-se by Talend.
the class JSONToXPathLinker method removeLoopListeners.
private void removeLoopListeners() {
JSONExtractorLoopModel loopModel = this.loopTableEditorView.getModel();
loopModel.removeModifiedBeanListener(loopModelModifiedBeanListener);
this.loopTableEditorView.getExtendedTableViewer().removeListener(loopTableExtendedControlListener);
SelectionHelper selectionHelper = this.loopTableEditorView.getTableViewerCreator().getSelectionHelper();
selectionHelper.removeAfterSelectionListener(afterLineSelectionListener);
}
Aggregations