use of org.talend.repository.json.ui.wizards.extraction.JSONExtractorFieldModel in project tdi-studio-se by Talend.
the class JSONFileStep2Form method addGroupSchemaTarget.
private void addGroupSchemaTarget(final Composite mainComposite, final int width, final int height) {
// Group Schema Viewer
schemaTargetGroup = Form.createGroup(mainComposite, 1, "Target Schema", height);
// to correct graphic bug under Linux-GTK when the wizard is opened the first time
if (WindowSystem.isGTK() && firstTimeWizardOpened.equals(Boolean.TRUE)) {
schemaTargetGroup.addListener(SWT.Paint, new Listener() {
@Override
public void handleEvent(Event event) {
Point offsetPoint = event.display.map(linker.getBgDrawableComposite(), schemaTargetGroup, new Point(0, 0));
linker.setOffset(offsetPoint);
linker.drawBackground(event.gc);
}
});
}
// ///////////////////////////////////////////
schemaTargetGroup.setBackgroundMode(SWT.INHERIT_FORCE);
CommandStackForComposite commandStack = new CommandStackForComposite(schemaTargetGroup);
loopModel = new JSONExtractorLoopModel("Path loop expression");
loopTableEditorView = new ExtractionLoopWithJSONXPathEditorView(loopModel, schemaTargetGroup);
loopTableEditorView.getExtendedTableViewer().setCommandStack(commandStack);
GridData data2 = new GridData(GridData.FILL_HORIZONTAL);
data2.heightHint = 90;
final Composite loopTableEditorComposite = loopTableEditorView.getMainComposite();
loopTableEditorComposite.setLayoutData(data2);
loopTableEditorComposite.setBackground(null);
// to correct graphic bug under Linux-GTK when the wizard is opened the first time
if (WindowSystem.isGTK() && firstTimeWizardOpened.equals(Boolean.TRUE)) {
loopTableEditorComposite.addListener(SWT.Paint, new Listener() {
@Override
public void handleEvent(Event event) {
Point offsetPoint = event.display.map(linker.getBgDrawableComposite(), loopTableEditorComposite, new Point(0, 0));
linker.setOffset(offsetPoint);
linker.drawBackground(event.gc);
}
});
}
// ///////////////////////////////////////////
// Messages.getString("FileStep3.metadataDescription")
fieldsModel = new JSONExtractorFieldModel("Fields to extract");
fieldsTableEditorView = new ExtractionFieldsWithJSONXPathEditorView(fieldsModel, schemaTargetGroup);
fieldsTableEditorView.getExtendedTableViewer().setCommandStack(commandStack);
final Composite fieldTableEditorComposite = fieldsTableEditorView.getMainComposite();
data2 = new GridData(GridData.FILL_BOTH);
data2.heightHint = 180;
fieldTableEditorComposite.setLayoutData(data2);
fieldTableEditorComposite.setBackground(null);
// to correct graphic bug under Linux-GTK when the wizard is opened the first time
if (WindowSystem.isGTK() && firstTimeWizardOpened.equals(Boolean.TRUE)) {
fieldTableEditorComposite.addListener(SWT.Paint, new Listener() {
@Override
public void handleEvent(Event event) {
Point offsetPoint = event.display.map(linker.getBgDrawableComposite(), fieldTableEditorComposite, new Point(0, 0));
linker.setOffset(offsetPoint);
linker.drawBackground(event.gc);
}
});
}
// ///////////////////////////////////////////
}
Aggregations