org.talend.repository.ui.wizards.metadata.connection.files.xml.extraction
Class XmlToXPathLinker

java.lang.Object
  extended by org.talend.commons.ui.swt.linking.BgDrawableComposite
      extended by org.talend.commons.ui.swt.linking.TreeToTablesLinker<java.lang.Object,java.lang.Object>
          extended by org.talend.repository.ui.wizards.metadata.connection.files.xml.extraction.XmlToXPathLinker
All Implemented Interfaces:
IBgDrawableComposite, IControlsLinker

public class XmlToXPathLinker
extends TreeToTablesLinker<java.lang.Object,java.lang.Object>

DOC amaumont class global comment. Detailled comment
$Id$


Field Summary
 
Fields inherited from class org.talend.commons.ui.swt.linking.TreeToTablesLinker
linksManager
 
Constructor Summary
XmlToXPathLinker(org.eclipse.swt.widgets.Composite commonParent)
          DOC amaumont XmlToMetadataTableLinker constructor comment.
 
Method Summary
 void addFieldLink(org.eclipse.swt.widgets.TreeItem treeItem, java.lang.Object dataItem1, org.eclipse.swt.widgets.Table table, SchemaTarget dataItem2)
          DOC amaumont Comment method "addLink".
 void addLoopLink(org.eclipse.swt.widgets.TreeItem treeItem, java.lang.Object dataItem1, org.eclipse.swt.widgets.Table table, XmlXPathLoopDescriptor dataItem2)
          DOC amaumont Comment method "addLink".
 void createLinks()
          DOC amaumont Comment method "createLinks".
 void drawBackground(org.eclipse.swt.graphics.GC gc)
           
 java.lang.String getAbsoluteXPath(org.eclipse.swt.widgets.TreeItem treeItem)
           
 java.util.ArrayList<org.w3c.dom.Node> getAllLoopNodes()
          Getter for allLoopNodes.
 java.lang.String getCurrentLoopXPath()
           
protected  java.util.Comparator<LinkDescriptor<org.eclipse.swt.widgets.TreeItem,java.lang.Object,org.eclipse.swt.widgets.Table,java.lang.Object>> getDrawingLinksComparator()
          Define a comparator to draw links.
 ExtractionFieldsWithXPathEditorView getFieldsTableEditorView()
          Getter for tableEditorView.
 ExtractionLoopWithXPathEditorView getLoopTableEditorView()
          Getter for loopTableEditorView.
 java.util.ArrayList<java.lang.String> getLoopXpathNodes()
          Getter for loopXpathNodes.
 SchemaTarget getNewSchemaTargetEntry(java.lang.String relativeXPathValue)
           
 NodeRetriever getNodeRetriever()
          Getter for nodeRetriever.
 StyleLink getSelectedLoopStyleLink()
           
 java.util.ArrayList<org.w3c.dom.Node> getUniqueLoopNodes()
          Getter for uniqueLoopNodes.
 void handleListenableListAfterTableViewerRefreshedEvent(ListenableListEvent<SchemaTarget> event)
           
 void init(org.eclipse.swt.widgets.Tree tree, ExtractionLoopWithXPathEditorView loopTableEditorView, ExtractionFieldsWithXPathEditorView fieldsTableEditorView, TreePopulator treePopulator)
           
 boolean isFieldsTable(org.eclipse.swt.widgets.Table table)
          DOC amaumont Comment method "isFieldsTable".
 boolean isLoopTable(org.eclipse.swt.widgets.Table table)
          DOC amaumont Comment method "isLoopTable".
 void onXPathValueChanged(org.eclipse.swt.widgets.Table table, java.lang.String newValue, int itemIndex)
          DOC amaumont Comment method "onXPathValueChanged".
 void parseAllFieldsXPathExpressions()
           
 void removeAllLinks()
          DOC amaumont Comment method "removeAllLinks".
 boolean removeLinksFromTableEntry(SchemaTarget schemaTarget)
           
 void updateLinksStyleAndControlsSelection(org.eclipse.swt.widgets.Control currentControl)
           
 java.lang.String validateXPathExpression(java.lang.String xpathExpression)
          DOC amaumont Comment method "validateXPathExpression".
 
Methods inherited from class org.talend.commons.ui.swt.linking.TreeToTablesLinker
createLinksComparators, getBackgroundRefresher, getDefaultStyleLink, getLinksManager, getSelectedStyleLink, getTables, getTree, getUnselectedStyleLink, init, setBackgroundRefresher, setSelectedStyleLink, setUnselectedStyleLink
 
Methods inherited from class org.talend.commons.ui.swt.linking.BgDrawableComposite
getBgDrawableComposite, getOffset, setOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.talend.commons.ui.swt.drawing.background.IBgDrawableComposite
getBgDrawableComposite, getOffset, setOffset
 

Constructor Detail

XmlToXPathLinker

public XmlToXPathLinker(org.eclipse.swt.widgets.Composite commonParent)
DOC amaumont XmlToMetadataTableLinker constructor comment.

Parameters:
commonParent - common main parent of tree and table, it and its children should have backgoundMode configured with SWT.INHERIT_FORCE, same configuration for parents of tree and table.
tree -
loopTableEditorView -
table -
Method Detail

init

public void init(org.eclipse.swt.widgets.Tree tree,
                 ExtractionLoopWithXPathEditorView loopTableEditorView,
                 ExtractionFieldsWithXPathEditorView fieldsTableEditorView,
                 TreePopulator treePopulator)

getAbsoluteXPath

public java.lang.String getAbsoluteXPath(org.eclipse.swt.widgets.TreeItem treeItem)

createLinks

public void createLinks()
DOC amaumont Comment method "createLinks".


drawBackground

public void drawBackground(org.eclipse.swt.graphics.GC gc)
Specified by:
drawBackground in interface IBgDrawableComposite
Overrides:
drawBackground in class TreeToTablesLinker<java.lang.Object,java.lang.Object>

handleListenableListAfterTableViewerRefreshedEvent

public void handleListenableListAfterTableViewerRefreshedEvent(ListenableListEvent<SchemaTarget> event)

addLoopLink

public void addLoopLink(org.eclipse.swt.widgets.TreeItem treeItem,
                        java.lang.Object dataItem1,
                        org.eclipse.swt.widgets.Table table,
                        XmlXPathLoopDescriptor dataItem2)
DOC amaumont Comment method "addLink".

Parameters:
treeItem -
dataItem1 -
table -
dataItem2 -

addFieldLink

public void addFieldLink(org.eclipse.swt.widgets.TreeItem treeItem,
                         java.lang.Object dataItem1,
                         org.eclipse.swt.widgets.Table table,
                         SchemaTarget dataItem2)
DOC amaumont Comment method "addLink".

Parameters:
treeItem -
dataItem1 -
table -
dataItem2 -

removeAllLinks

public void removeAllLinks()
DOC amaumont Comment method "removeAllLinks".


removeLinksFromTableEntry

public boolean removeLinksFromTableEntry(SchemaTarget schemaTarget)

onXPathValueChanged

public void onXPathValueChanged(org.eclipse.swt.widgets.Table table,
                                java.lang.String newValue,
                                int itemIndex)
DOC amaumont Comment method "onXPathValueChanged".

Parameters:
table -
newValue -
itemIndex -

isLoopTable

public boolean isLoopTable(org.eclipse.swt.widgets.Table table)
DOC amaumont Comment method "isLoopTable".

Parameters:
table -
Returns:

getNewSchemaTargetEntry

public SchemaTarget getNewSchemaTargetEntry(java.lang.String relativeXPathValue)

getFieldsTableEditorView

public ExtractionFieldsWithXPathEditorView getFieldsTableEditorView()
Getter for tableEditorView.

Returns:
the tableEditorView

getLoopTableEditorView

public ExtractionLoopWithXPathEditorView getLoopTableEditorView()
Getter for loopTableEditorView.

Returns:
the loopTableEditorView

updateLinksStyleAndControlsSelection

public void updateLinksStyleAndControlsSelection(org.eclipse.swt.widgets.Control currentControl)
Specified by:
updateLinksStyleAndControlsSelection in interface IControlsLinker
Overrides:
updateLinksStyleAndControlsSelection in class TreeToTablesLinker<java.lang.Object,java.lang.Object>

isFieldsTable

public boolean isFieldsTable(org.eclipse.swt.widgets.Table table)
DOC amaumont Comment method "isFieldsTable".

Parameters:
table -
Returns:

getSelectedLoopStyleLink

public StyleLink getSelectedLoopStyleLink()

getCurrentLoopXPath

public java.lang.String getCurrentLoopXPath()

parseAllFieldsXPathExpressions

public void parseAllFieldsXPathExpressions()

getLoopXpathNodes

public java.util.ArrayList<java.lang.String> getLoopXpathNodes()
Getter for loopXpathNodes.

Returns:
the loopXpathNodes

validateXPathExpression

public java.lang.String validateXPathExpression(java.lang.String xpathExpression)
DOC amaumont Comment method "validateXPathExpression".

Parameters:
newValue -
Returns:
null if expression is valid, else return the error message.

getDrawingLinksComparator

protected java.util.Comparator<LinkDescriptor<org.eclipse.swt.widgets.TreeItem,java.lang.Object,org.eclipse.swt.widgets.Table,java.lang.Object>> getDrawingLinksComparator()
Description copied from class: TreeToTablesLinker
Define a comparator to draw links.

Overrides:
getDrawingLinksComparator in class TreeToTablesLinker<java.lang.Object,java.lang.Object>

getAllLoopNodes

public java.util.ArrayList<org.w3c.dom.Node> getAllLoopNodes()
Getter for allLoopNodes.

Returns:
the allLoopNodes

getUniqueLoopNodes

public java.util.ArrayList<org.w3c.dom.Node> getUniqueLoopNodes()
Getter for uniqueLoopNodes.

Returns:
the uniqueLoopNodes

getNodeRetriever

public NodeRetriever getNodeRetriever()
Getter for nodeRetriever.

Returns:
the nodeRetriever