use of org.talend.core.ui.metadata.editor.MetadataEmfTableEditor in project tdi-studio-se by Talend.
the class JSONFileOutputStep3Form method addFields.
@Override
protected void addFields() {
Composite mainComposite = Form.startNewDimensionnedGridLayout(this, 2, WIDTH_GRIDDATA_PIXEL, 60);
metadataNameText = new LabelledText(mainComposite, "Name");
metadataCommentText = new LabelledText(mainComposite, "Comment");
Group groupMetaData = Form.createGroup(this, 1, "Schema", 280);
Composite compositeMetaData = Form.startNewGridLayout(groupMetaData, 1);
Composite compositeTable = Form.startNewDimensionnedGridLayout(compositeMetaData, 1, WIDTH_GRIDDATA_PIXEL, 200);
compositeTable.setLayout(new FillLayout());
metadataEditor = new MetadataEmfTableEditor("Description of the Schema");
tableEditorView = new MetadataEmfTableEditorView(compositeTable, SWT.NONE);
}
use of org.talend.core.ui.metadata.editor.MetadataEmfTableEditor in project tdi-studio-se by Talend.
the class BRMSSchemaOutputDialog method createDialogArea.
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
applyDialogFont(composite);
// Composite composite = (Composite) super.createDialogArea(parent);
composite.setLayout(new FillLayout());
tableEditor = new MetadataEmfTableEditor("");
MetadataTable metadataTable = form.getMetadataOutputTable();
tableEditor.setMetadataTable(metadataTable);
tableEditor.removeAll();
// List<MetadataColumn> list = (List<MetadataColumn>) metadataTable.getColumns();
// tableEditor.addAll(list);
// if (list.size() > 0) {
// for (MetadataColumn column : list) {
// boolean toAdd = true;
// for (int i = 0; i < list.size(); i++) {
// String label = column.getLabel();
// String curLabel = list.get(i).getLabel();
// if (label.equals(curLabel)) {
// toAdd = false;
// break;
// }
// }
// if (toAdd) {
// tableEditor.add(column);
// }
// }
// }
tableEditorView = new MetadataEmfTableEditorView(composite, SWT.NONE);
tableEditorView.setMetadataEditor(tableEditor);
addListeners();
return composite;
}
use of org.talend.core.ui.metadata.editor.MetadataEmfTableEditor in project tdi-studio-se by Talend.
the class JSONFileMetadataEmfToolbarEditor method createAddPushButton.
@Override
protected AddPushButton createAddPushButton() {
return new AddPushButtonForExtendedTable(this.toolbar, getExtendedTableViewer()) {
@Override
protected Object getObjectToAdd() {
MetadataEmfTableEditor tableEditorModel = (MetadataEmfTableEditor) getExtendedTableViewer().getExtendedControlModel();
if (tableEditorModel.getMetadataTable() == null) {
tableEditorModel.setMetadataTable(ConnectionFactory.eINSTANCE.createMetadataTable());
}
MetadataColumn metadatacolumn = tableEditorModel.createNewMetadataColumn(dbmsId);
return metadatacolumn;
}
};
}
use of org.talend.core.ui.metadata.editor.MetadataEmfTableEditor in project tdi-studio-se by Talend.
the class JSONTree2SchemaDragAndDropHandler method addColumn.
private void addColumn(String label, FOXTreeNode node, EList columnList) {
if (StringUtils.isEmpty(label)) {
return;
}
MetadataEmfTableEditor editor = new MetadataEmfTableEditor();
String columnName = label;
if (columnName.contains(":")) {
//$NON-NLS-1$
//$NON-NLS-1$
columnName = columnName.split(":")[1];
}
//$NON-NLS-1$
columnName = columnName.replaceAll("[^a-zA-Z0-9]", "_");
String dataType = node.getDataType();
MetadataColumn metadataColumn = ConnectionFactory.eINSTANCE.createMetadataColumn();
metadataColumn.setLabel(editor.getNextGeneratedColumnName(columnName, columnList));
metadataColumn.setOriginalField(label);
metadataColumn.setTalendType(dataType);
columnList.add(metadataColumn);
node.setColumn(ConvertionHelper.convertToIMetaDataColumn(metadataColumn));
}
use of org.talend.core.ui.metadata.editor.MetadataEmfTableEditor in project tdi-studio-se by Talend.
the class HL7UI method createContent.
/**
* Comment method "createContent".
*
* @param child
*/
private void createContent(Composite mainComposite) {
judgeRepository();
header = new HeaderComposite(mainComposite, SWT.NONE, this.filePath, startChar, endChar, hl7Manager, this.isRepository);
MsgToSchemaSash = new SashForm(mainComposite, SWT.HORIZONTAL | SWT.SMOOTH);
MsgToSchemaSash.setLayoutData(new GridData(GridData.FILL_BOTH));
MsgToSchemaSash.setBackgroundMode(SWT.INHERIT_FORCE);
addMessageViewer(MsgToSchemaSash, 300, 110);
addSchemaViewer(MsgToSchemaSash, 400, 110);
MsgToSchemaSash.setWeights(new int[] { 40, 60 });
linker = new HL7Tree2SchemaLinker(this.MsgToSchemaSash, this.isRepository);
linker.setMainui(this);
hl7SchemaEditorView.setLinker(linker);
GridData data2 = new GridData(GridData.FILL_HORIZONTAL);
data2.heightHint = 300;
hl7SchemaEditorView.initGraphicComponents();
final Composite tableEditorComposite = hl7SchemaEditorView.getMainComposite();
tableEditorComposite.setLayoutData(data2);
tableEditorComposite.setBackground(null);
//$NON-NLS-1$
metadataEditor = new MetadataEmfTableEditor("");
//$NON-NLS-1$
metadataEditor.setDefaultLabel("newColumn");
metadataEditor.registerDataList(new ArrayList());
hl7SchemaEditorView.setMetadataEditor(metadataEditor);
linker.init(messageViewer, hl7SchemaEditorView);
linker.setManager(hl7Manager);
initMessageTree();
new FooterComposite(mainComposite, SWT.NONE, hl7Manager);
initSchemaCombo(externalNode.getMetadataList());
initTableViewer();
initlinkers();
boolean jobReadOnly = externalNode.getProcess().isReadOnly();
if (externalNode.getOriginalNode().getJobletNode() != null) {
jobReadOnly = externalNode.getOriginalNode().isReadOnly();
}
if (jobReadOnly || isRepository) {
hl7SchemaEditorView.setReadOnly(true);
}
addModifylistener();
}
Aggregations