Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Package oracle.jdeveloper.compare

contains classes nbsp;that can be used to invoke and control the integrated compare (diff) viewer in JDeveloper and hook into the Compare With menu.

See:
          Description

Class Summary
CompareContext Provides typesafe getter and setter methods for Context properties specific to the compare viewer.
CompareViewer Public API to the standalone compare viewer.

 

Package oracle.jdeveloper.compare Description

contains classes nbsp;that can be used to invoke and control the integrated compare (diff) viewer in JDeveloper and hook into the Compare With menu.

To use most of the functionality in this package, you need to obtain an instance of CompareViewer. The easiest way to do this is using the static CompareViewer#get() method. Alternatively, you can retrieve the CompareViewer using the JNDI namespace "jdeveloper/compareviewer" as follows:

    import javax.naming.InitialContext;
    ...
    InitialContext ic = new InitialContext();
    CompareViewer viewer = (CompareViewer) ic.lookup( "jdeveloper/compareviewer" );
  

Once you have obtained an instance of CompareViewer, you can use its APIs to install menu items into the Compare With submenu or programmatically display the compare viewer.

Installing Items into the "Compare With" Menu

To install a menu item into the Compare With submenu, call CompareViewer#getMainCompareMenu() or CompareViewer#getContextCompareMenu()

You can use the constant float values defined on CompareViewer to position menu items relative to the default ones using JDeveloper's standard menu APIs in Ide.getMenubar().

Overriding Compare Items

You can override the default behavior of the three pre-installed compare menu items by installing a chained controller for these actions using setController(). To obtain the actions, use the three constants CompareViewer#COMPARE_FILE_ON_DISK_COMMAND, CompareViewer#COMPARE_OTHER_FILE_COMMAND or CompareViewer#COMPARE_EACH_OTHER_COMMAND.

Programmatically Displaying Compare

To programmatically display compare, use the CompareViewer.show( URL, URL ) method. A new compare viewer will be opened for the two specified URLs. The CompareViewer.show( Resource, Resource) method is intended only for use by version control extensions distributed by Oracle, and its use in third party extensions is currently unsupported.


Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.