use of org.talend.designer.xmlmap.ui.tabs.table.OutputXmlTreeSchemaTableView in project tdi-studio-se by Talend.
the class TabFolderEditors method createComponents.
/**
* DOC amaumont Comment method "createComponents".
*/
private void createComponents() {
setSimple(false);
// TableEditorCompositeBase metaDatasDescriptorView3 = new TableEditorCompositeBase(tabFolder1);
// item.setControl(metaDatasDescriptorView3);
CTabItem item = new CTabItem(tabFolderEditors, SWT.BORDER);
//$NON-NLS-1$
item.setText(Messages.getString("TabFolderEditors.SchemaEditor.Title"));
SashForm inOutMetaEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
inOutMetaEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
item.setControl(inOutMetaEditorContainer);
// input metadata table view
inputMetaEditor = new XmlMapMetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
inputMetaEditor.initGraphicComponents();
// inputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
ILineSelectionListener metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
if (inputMetaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
if (inputMetaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
mapperManage.selectLinkedInputTableEntries(inputMetaEditor.getTableViewerCreator().getTable().getSelectionIndices(), false);
}
}
}
};
inputMetaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
addListenersToInputButtons();
// output metadata table view
outputMetaEditor = new XmlMapMetadataTableEditorView(inOutMetaEditorContainer, SWT.BORDER);
outputMetaEditor.initGraphicComponents();
// outputMetaEditor.getExtendedTableViewer().setCommandStack(commandStack);
metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
if (outputMetaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
if (outputMetaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
mapperManage.selectLinkedOutputTableEntries(outputMetaEditor.getTableViewerCreator().getTable().getSelectionIndices(), false);
}
}
}
};
outputMetaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
addListenersToOutputButtons();
item = new CTabItem(tabFolderEditors, SWT.BORDER);
//$NON-NLS-1$
item.setText(Messages.getString("TabFolderEditors.TreeSchemaEditor.Title"));
SashForm xmlTreeEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
xmlTreeEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
item.setControl(xmlTreeEditorContainer);
// input tree schema table view
inputTreeSchemaEditor = new XmlTreeSchemaTableView(xmlTreeEditorContainer, SWT.BORDER);
inputTreeSchemaEditor.initGraphicComponents();
metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
if (inputTreeSchemaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
if (inputTreeSchemaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
mapperManage.selectLinkedInputTableEntries(inputTreeSchemaEditor.getTableViewerCreator().getTable().getSelectionIndices(), true);
}
}
}
};
inputTreeSchemaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
// output tree schema table view
outputTreeSchemaEditor = new OutputXmlTreeSchemaTableView(xmlTreeEditorContainer, SWT.BORDER);
outputTreeSchemaEditor.initGraphicComponents();
metadataEditorViewerSelectionChangedListener = new ILineSelectionListener() {
@Override
public void handle(LineSelectionEvent e) {
if (outputTreeSchemaEditor.getTableViewerCreator() == e.source && mapperManage.getGraphicalViewer() != null) {
if (outputTreeSchemaEditor.getExtendedTableViewer().isExecuteSelectionEvent()) {
mapperManage.selectLinkedOutputTableEntries(outputTreeSchemaEditor.getTableViewerCreator().getTable().getSelectionIndices(), true);
}
}
}
};
outputTreeSchemaEditor.getTableViewerCreator().getSelectionHelper().addAfterSelectionListener(metadataEditorViewerSelectionChangedListener);
item = new CTabItem(tabFolderEditors, SWT.BORDER);
//$NON-NLS-1$
item.setText(Messages.getString("TabFolderEditors.ExpressionEditor.Title"));
StyledText styledText = createStyledText(item);
this.styledTextHandler = new StyledTextHandler(styledText, mapperManage);
tabFolderEditors.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
mapperManage.fireCurrentDirectEditApply();
// TDI-18185
if (styledTextHandler.getSelectedNode() != null && XmlMapUtil.DOCUMENT.equals(styledTextHandler.getSelectedNode().getType())) {
styledTextHandler.setTextWithoutNotifyListeners("");
styledTextHandler.getStyledText().setEnabled(false);
styledTextHandler.getStyledText().setEditable(false);
styledTextHandler.getStyledText().setText("");
}
lastSelectedTab = tabFolderEditors.getSelectionIndex();
}
});
tabFolderEditors.setSelection(0);
}
Aggregations