You can use the Eclipse compare editor to compare models in your IBM® WebSphere® Portlet Factory project.
The model compare editor is launched when a model file is compared with another model file, or with a different version of the same model from the local workspace history or from a repository. The model compare editor functions in the same manner as the standard Eclipse compare editor.
The compare editor uses settings from the Compare/Patch preference page. Click Window
to view and change your settings.
The comparison uses the Eclipse structure viewer and compare editor to display the differences between two models in your project.
- In the Project Explorer or Model Navigator, select the models to be compared.
- Right-click the selection and click Compare With -> Each Other.
When model files are compared, the model compare editor opens in the editor area. The model compare editor consists of the Model Structure Compare view and the Model Compare editor.
The Model Structure Compare view shows a tree that represents the differences in the models in the following levels of detail.
- The top level node of the tree corresponds to the model itself.
- The second level nodes of the tree represent the builder calls that are different between the two models.
- The third level nodes of the tree represent the differences between the builder inputs for each builder call.
You can double click any node in the Model Structure Compare view to zoom in on the changes represented by the node of the tree.
When you select the top level node in the Model Structure Compare view, the Model Compare editor shows a comparison of builder calls similar to the Outline view when the model editor is active. If you select a builder call node or a builder input node in the tree, the Model Compare editor shows a comparison of the selected nodes as XML text.
In the Model Compare editor, you can browse through all the differences in the builder call lists and copy highlighted differences between the compared resources. You can save changes to resources that are made in the model compare editor. Using the toolbar of the compare editor, you have available the following commands in the toolbar buttons.
Control Visibility of Ancestor Pane
Copy All from Left to Right
Displays a common ancestor of two differing models. If you use the Team version management support, a three way compare occurs under the following conditions.
- If you compare a file that is in conflict.
- If you compare a file that is being merged from a branch.
The system determines a common ancestor in the repository against which to compare the conflict or to merge the changes. This command determines the visibility of the third editor. By default, the ancestor pane is not visible.
Copies all the builder calls in the left pane into the file in the right pane, making the contents of the two models identical. Copy All Non-Conflicting Changes from Right to Left
Copies all the nonconflicting builder calls from the right pane into the left pane. You must copy conflicting builder calls individually. Copy Current Change from Left to Right
Merges changes in two files by copying the highlighted builder call in the left pane into the highlighted location on the right pane. This action overwrites or inserts the builder call into the model in the right pane as appropriate. Copy Current Change from Right to Left
Merges changes in two files by copying the highlighted builder call in the right pane into the highlighted location on the left pane. This action overwrites or inserts the builder call into the model in the left pane as appropriate. Select Next Difference
Highlights the next different builder call that is found between the compared resources. Select Previous Difference
Highlights the previous different builder call that is found between the compared resources.
Parent topic: Creating and opening models