use of org.talend.designer.rowgenerator.ui.editor.MetadataTableEditorViewExt in project tdi-studio-se by Talend.
the class RowGeneratorUI method createSchemaComposite.
/**
* qzhang Comment method "createSchemaComposite".
*/
private void createSchemaComposite() {
outputMetaTable = externalNode.getMetadataList().get(0);
uiManager.convert(externalNode, outputMetaTable, functionManager);
//$NON-NLS-1$
metadataTableEditor = new MetadataTableEditorExt(outputMetaTable, "", this.functionManager);
metadataTableEditor.setRowGenUI(this);
inputReadOnly = this.externalNode.getProcess().isReadOnly();
if (this.externalNode.getOriginalNode().getJobletNode() != null) {
inputReadOnly = this.externalNode.getOriginalNode().isReadOnly();
} else if (this.externalNode.getOriginalNode().getJunitNode() != null) {
inputReadOnly = true;
}
dataTableView = new MetadataTableEditorViewExt(datasFlowViewSashForm, SWT.BORDER, metadataTableEditor, inputReadOnly, !inputReadOnly, externalNode, functionManager);
dataTableView.getExtendedTableViewer().setCommandStack(generatorManager.getCommandStack());
dataTableView.setGeneratorUI(this);
dataTableView.setShowDbTypeColumn(true, true, false);
dataTableView.setShowDbColumnName(false, false);
metadataTableEditor.setModifiedBeanListenable(dataTableView.getTableViewerCreator());
// see bug 7471,record the modification of the column value.
metadataTableEditor.addModifiedBeanListener(new IModifiedBeanListener<IMetadataColumn>() {
@Override
public void handleEvent(ModifiedBeanEvent<IMetadataColumn> event) {
if (AbstractMetadataTableEditorView.ID_COLUMN_NAME.equals(event.column.getId())) {
IMetadataColumn modifiedObject = event.bean;
if (modifiedObject != null) {
String originalLabel = changedNameColumns.get(modifiedObject);
if (originalLabel == null) {
changedNameColumns.put(modifiedObject.getLabel(), (String) event.previousValue);
}
}
}
}
});
// resize all the columns but not the table
for (int i = 0; i < dataTableView.getTable().getColumnCount(); i++) {
dataTableView.getTable().getColumn(i).pack();
}
dataTableView.getTable().getColumn(0).setWidth(0);
}
use of org.talend.designer.rowgenerator.ui.editor.MetadataTableEditorViewExt in project tdi-studio-se by Talend.
the class RowGenMain method addAllControlForKeyListener.
/**
* qzhang Comment method "addAllControlForKeyListener".
*
* @param parent
* @param keyAdapter
* @return
*/
private void addAllControlForKeyListener(Control parent) {
KeyAdapter keyAdapter = new KeyAdapter() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.KeyAdapter#keyReleased(org.eclipse.swt.events.KeyEvent)
*/
@Override
public void keyReleased(KeyEvent e) {
if (e.keyCode == SWT.F5) {
MetadataTableEditorViewExt viewExt = generatorUI.getDataTableView();
viewExt.refreshPreviewColumn();
}
}
};
parent.addKeyListener(keyAdapter);
if (parent instanceof Composite) {
Control[] children = ((Composite) parent).getChildren();
for (Control control : children) {
if (control != null && !control.isDisposed()) {
addAllControlForKeyListener(control);
}
}
}
}
use of org.talend.designer.rowgenerator.ui.editor.MetadataTableEditorViewExt in project tdi-studio-se by Talend.
the class TabFolderEditors method refreshPreview.
/**
* qzhang Comment method "refreshPreview".
*/
public void refreshPreview(String number) {
MetadataTableEditorViewExt editor2 = (MetadataTableEditorViewExt) generatorUI.getDataTableView();
processPreview.refreshTablePreview(editor2.getMetadataTableEditor().getMetadataColumnList(), getItemsByRunJob(number), true);
}
Aggregations