use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.
the class DropContextAnalyzer method init.
/**
* DOC amaumont Comment method "init".
*/
private void init() {
DropTarget dropTarget = (DropTarget) event.widget;
Control controlTarget = dropTarget.getControl();
dataMapTableViewTarget = mapperManager.retrieveDataMapTableView(controlTarget);
if (controlTarget instanceof Table) {
currentTableTarget = (Table) dropTarget.getControl();
} else if (controlTarget instanceof StyledText) {
currentStyledTextTarget = (StyledText) dropTarget.getControl();
} else {
//$NON-NLS-1$
throw new IllegalArgumentException(Messages.getString("DropContextAnalyzer.0", controlTarget.toString()));
}
zoneTarget = dataMapTableViewTarget.getZone();
draggedData = TableEntriesTransfer.getInstance().getDraggedData();
dataMapTableViewSource = (DataMapTableView) draggedData.getDataMapTableViewSource();
tableItemSource = draggedData.getTableItemSource();
zoneSource = dataMapTableViewSource.getZone();
if (currentTableTarget != null) {
analyzeCursorOverExpressionCell();
}
invalidKeyPressed = hasInvalidKeyPressed();
isDropValid = checkDropIsValid();
analyzeForFeedback();
analyzeForDetail();
// System.out.println("isCursorOverExpressionCell="+isCursorOverExpressionCell);
}
use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.
the class DropContextAnalyzer method dropVarsEntryIsValid.
private boolean dropVarsEntryIsValid(TableItem tableItemTarget) {
Table table = tableItemTarget.getParent();
TableItem[] tableItems = table.getItems();
for (TableItem tableItem : tableItems) {
if (tableItemTarget == tableItem) {
break;
}
if (tableItemSource == tableItem) {
return true;
}
}
return false;
}
use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.
the class JobVMArgumentsComposite method getTableControl.
/**
* Returns this field editor's list control.
*
* @param parent the parent control
* @return the list control
*/
protected TableViewer getTableControl(Composite parent) {
if (viewer == null) {
Table table = createTable(parent);
viewer = new TableViewer(table);
viewer.setContentProvider(createContentProvider());
viewer.setLabelProvider(createLabelProvider());
table.setFont(parent.getFont());
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
JobVMArgumentsComposite.this.selectionChanged();
}
});
viewer.addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
editItem(event.getSelection());
}
});
}
// doLoadDefault();
return viewer;
}
use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.
the class OperationsTab method configureTable.
/**
* Configure the table adding columns.
*/
private void configureTable() {
Table table = tableViewer.getTable();
if (table.isDisposed()) {
return;
}
table.setLinesVisible(true);
table.setHeaderVisible(true);
TableColumn column = new TableColumn(table, SWT.NONE);
column.setText(Messages.operationColumnLabel);
column.setWidth(300);
column.setToolTipText(Messages.operationColumnToolTip);
}
use of org.eclipse.swt.widgets.Table 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);
}
Aggregations