Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.javatools.compare.view
Class BaseCompareView

java.lang.Object
  extended by oracle.javatools.compare.view.BaseCompareView
All Implemented Interfaces:
CompareView, ActionMenuView, CustomHorizontalScrollView, EditableView, NavigableConflictsView, NavigableView, SplitPanelView, StatusView, ToolTipView
Direct Known Subclasses:
IdeBaseCompareView, SequenceCompareView

public abstract class BaseCompareView
extends java.lang.Object
implements CompareView, NavigableView, NavigableConflictsView, StatusView, EditableView, ToolTipView, SplitPanelView, CustomHorizontalScrollView, ActionMenuView

Since:
11.0

Nested Class Summary
protected  class BaseCompareView.CentralGutterMouseHandler
           
static class BaseCompareView.ContributorBias
           
protected  class BaseCompareView.CustomFocusTraversalPolicy
           
 class BaseCompareView.PositionListener
           
 
Field Summary
protected  javax.swing.JScrollPane _centerScrollPane
           
protected  javax.swing.JLabel _centerTitle
           
protected  DiffGutter _leftDiffGutter
           
protected  BaseOverview _leftOverview
           
protected  javax.swing.JScrollPane _leftScrollPane
           
protected  javax.swing.JLabel _leftTitle
           
protected  DiffGutter _rightDiffGutter
           
protected  BaseOverview _rightOverview
           
protected  javax.swing.JScrollPane _rightScrollPane
           
protected  javax.swing.JLabel _rightTitle
           
static java.lang.String GUI_VERTICAL_SCROLLBAR
           
static java.lang.String GUI_VERTICAL_SPACER
           
protected static int OVERVIEW_WIDTH
          Ugh: Make the overview the same width as the scroll bar.
 
Constructor Summary
protected BaseCompareView()
           
protected BaseCompareView(CompareMode compareMode)
           
protected BaseCompareView(CompareMode compareMode, CompareViewBias compareViewBias)
           
 
Method Summary
 void addPopupManager(ComparePopupManager popupManager)
          Add a popup manager to this view.
 void addPositionListener(javax.swing.event.ChangeListener l)
          Adds a listener for changes to the current navigable view position.
 void addStatusListener(javax.swing.event.ChangeListener l)
          Adds a listener for events which change editor pane status.
 void addViewEditListener(ViewEditListener l)
           
protected  void attachContributorChangeListeners()
           
static int calculateRightEditorInset()
           
protected  boolean canReadElement(CompareDifference difference, ContributorKind contributorKind)
           
protected  boolean canWriteElement(CompareDifference difference, ContributorKind contributorKind)
           
protected  javax.swing.Action createDeleteBlockAction(oracle.javatools.compare.algorithm.BaseCompareDifference difference, ContributorKind contributor, ContributorKind adjacentContributor)
           
protected  java.awt.FocusTraversalPolicy createFocusTraversalPolicy()
           
protected  javax.swing.JScrollPane createHorizontalScrollPane(java.awt.Component view)
           
protected  javax.swing.Action createInsertBlockAction(oracle.javatools.compare.algorithm.BaseCompareDifference difference, ContributorKind contributor, ContributorKind adjacentContributor)
           
protected  javax.swing.Action createMarkAllResolvedAction(CompareModel compareModel)
           
protected  javax.swing.Action createMarkResolvedAction(CompareDifference difference)
           
protected  ViewMemento createMemento()
           
protected  CompareModel createModel(CompareDifference[] differences)
           
protected abstract  CompareModel createModel(CompareModel compareModel, CompareDifference[] differences)
           
protected  CompareModel createMutableModel(CompareModel compareModel)
           
protected  void createOverviews()
           
protected  javax.swing.Action createReplaceBlockAction(oracle.javatools.compare.algorithm.BaseCompareDifference difference, ContributorKind contributor, ContributorKind adjacentContributor)
           
protected abstract  void deleteBlock(oracle.javatools.compare.algorithm.BaseCompareDifference block, ContributorKind contributor)
          Remove the specified difference block from the specified contributor.
protected  void detachContributorChangeListeners()
           
 void dispose()
           
protected  void firePositionChanged()
           
protected  void fireStatusChanged()
           
protected  void fireViewEditEvent(ViewEditEvent vee)
           
protected  ContributorKind getAdjacentContributorKind(ContributorKind contributorKind)
           
protected  ContributorKind getAdjacentContributorKind(ContributorKind contributorKind, BaseCompareView.ContributorBias bias)
           
protected  CompareViewBias getBias()
           
 java.util.ResourceBundle getBundle()
          Utility to get the resource bundle for this class.
protected  javax.swing.JScrollPane getCenterScrollPane()
           
protected  javax.swing.JLabel getCenterTitle()
           
 CompareMode getCompareMode()
           
 CompareModel getCompareModel()
           
protected  CompareContributor getContributor(ContributorKind contributorKind)
           
protected abstract  ContributorKind getCurrentContributorKind()
           
protected abstract  CompareDifference getCurrentDifference()
           
protected  javax.swing.Action getDefaultEditAction(CompareDifference difference, ContributorKind contributor, ContributorKind adjacentContributor)
          Get the default edit action for the specified difference.
 javax.swing.Icon getDefaultEditActionIcon(oracle.javatools.compare.algorithm.BaseCompareDifference difference, ContributorKind contributor, ContributorKind adjacentContributor, boolean isAncestor)
           
 javax.swing.Action[] getEditActions()
          Get the contextual edit actions for the view.
protected  javax.swing.Action[] getEditActions(CompareDifference difference, ContributorKind contributor, ContributorKind adjacentContributor)
          Get edit actions for the specified difference.
protected  java.awt.Component getFocusableCenterEditor()
           
 java.awt.Component getFocusComponent()
           
 java.awt.Component getGUI()
          Get the GUI for this compare view.
protected  java.util.Collection getHorizontalScrollBars()
           
 java.awt.Component getHorizontalScrollComponent()
          Get the horizontal scrollbar component for this compare view.
 DiffGutter getLeftDiffGutter()
           
 java.awt.Component getLeftOrCenterSplitter()
           
protected  BaseOverview getLeftOverview()
           
protected  javax.swing.JScrollPane getLeftScrollPane()
           
protected  javax.swing.JLabel getLeftTitle()
           
 CompareModel getModel()
          Get the model for this view.
protected abstract  CompareDifference getNextConflict()
           
protected abstract  CompareDifference getNextDifference()
           
protected  java.awt.Component getOverviewLeftEditor()
           
protected  java.awt.Component getOverviewRightEditor()
           
protected  ComparePopupManager getPopupManager()
           
protected abstract  CompareDifference getPreviousConflict()
           
protected abstract  CompareDifference getPreviousDifference()
           
protected  DiffGutter getRightDiffGutter()
           
protected  BaseOverview getRightOverview()
           
protected  javax.swing.JScrollPane getRightScrollPane()
           
 java.awt.Component getRightSplitter()
           
protected  javax.swing.JLabel getRightTitle()
           
 SplitPanel getSplitPanel()
           
 int getSplitterLocation(java.awt.Component splitter)
           
protected  CompareToolTipProvider getToolTipProvider()
           
protected  java.util.Collection getUndoableEditListeners()
           
 javax.swing.JScrollBar getVerticalScrollbar()
           
protected  javax.swing.JScrollBar getVerticalScrollBar()
           
protected  java.awt.CardLayout getVerticalScrollCardLayout()
           
protected  javax.swing.JPanel getVerticalScrollPanel()
           
protected  ViewEditListener[] getViewEditListeners()
           
protected  void goToDifference(CompareDifference block)
           
protected abstract  void goToDifference(CompareDifference differenceBlock, boolean requestFocus)
           
 boolean goToFirstConflict()
          Navigate to the first conflict in this view.
 boolean goToFirstDifference()
          Navigate to the first difference in this view.
 boolean goToInitialDifference()
          Navigate to the initial difference in this view, without requesting focus
 boolean goToLastConflict()
          Navigate to the last conflict in this view.
 boolean goToLastDifference()
          Navigate to the last difference in this view.
 boolean goToNextConflict()
          Navigate to the next conflict in this view.
 boolean goToNextDifference()
          Navigate to the next difference in this view.
 boolean goToPreviousConflict()
          Navigate to the previous conflict in this view.
 boolean goToPreviousDifference()
          Navigate to the previous difference in this view.
protected  boolean hasDefaultEditAction(CompareDifference difference, ContributorKind contributor, ContributorKind adjacentContributor)
          Return whether there is a default edit action
 boolean hasNavigableConflicts()
          Asks whether the view has navigable conflicts.
 boolean hasNavigableDifferences()
          Asks whether the view has navigable differences.
 boolean hasNextConflict()
          Asks whether there is a next conflict based on the position.
 boolean hasNextDifference()
          Asks whether there is a next difference based on the position.
 boolean hasPreviousConflict()
          Asks whether there is a previous conflict based on the position.
 boolean hasPreviousDifference()
          Asks whether there is a previous difference based on the position.
protected  void horizontalScrollTo(java.lang.Object source, int value)
           
protected  void initializeOverview(BaseOverview overview)
           
protected  void initializeView(CompareModel compareModel)
           
protected  void initScrollPane(javax.swing.JScrollPane scrollPane)
           
protected abstract  void insertBlockCopy(oracle.javatools.compare.algorithm.BaseCompareDifference block, ContributorKind fromContributor, ContributorKind toContributor)
          Take a copy of the block from the specified contributor and insert it into the other contributor after the change.
protected  boolean isAddition(oracle.javatools.compare.algorithm.BaseCompareDifference difference, ContributorKind firstContributor, ContributorKind secondContributor)
           
protected  boolean isEditable(ContributorKind contributor)
           
protected  boolean isEditLocked()
          Get whether this compare view is locked against editing.
protected  boolean isOverviewFocusOwner()
           
protected  boolean isRemoval(oracle.javatools.compare.algorithm.BaseCompareDifference difference, ContributorKind firstContributor, ContributorKind secondContributor)
           
protected  boolean isViewFocusOwner()
           
protected  void markAllResolved(CompareModel compareModel)
          Mark all differences in the given model as resolved.
protected  void markResolved(CompareDifference difference)
          Mark the given difference block as resolved.
static void registerViewDecoration(java.lang.Class<? extends CompareViewDecoration> decorationClass)
           
 void removePopupManager(ComparePopupManager popupManager)
          Remove a popup manager from this view.
 void removePositionListener(javax.swing.event.ChangeListener l)
          Removes a listener for changes to the current navigable view position.
 void removeStatusListener(javax.swing.event.ChangeListener l)
          Removes a listener for events which change editor pane status.
 void removeViewEditListener(ViewEditListener l)
           
protected  void repaintDiffGutters()
           
protected abstract  void replaceBlock(oracle.javatools.compare.algorithm.BaseCompareDifference block, ContributorKind fromContributor, ContributorKind toContributor)
          Take a copy of the block from the specified contributor and replace the text of the adjacent contributor with the text.
protected  void resetGUI()
           
protected  void setCenterScrollPane(javax.swing.JScrollPane centerScrollPane)
           
protected  void setCompareModel(CompareModel compareModel)
           
protected  void setEditLocked(boolean editLocked)
           
protected  void setLeftDiffGutter(DiffGutter leftDiffGutter)
           
protected  void setLeftScrollPane(javax.swing.JScrollPane leftScrollPane)
           
 void setMemento(ViewMemento memento)
           
 void setModel(CompareModel compareModel)
          Set the model for this view.
protected  void setRightDiffGutter(DiffGutter rightDiffGutter)
           
protected  void setRightScrollPane(javax.swing.JScrollPane rightScrollPane)
           
protected  void setSplitPanel(SplitPanel splitPanel)
           
 void setSplitterLocation(java.awt.Component splitter, int location)
           
 void setSplitterLocation(java.awt.Component splitter, int location, java.awt.Component parent)
           
 void setToolTipProvider(CompareToolTipProvider toolTipProvider)
           
protected  void updateModel(CompareModel model)
           
protected abstract  void updateModelImpl()
          Reapplies the specified model to the view.
protected  void updateOnEdit()
          Triggered when the compare model needs to be rebuilt following an edit.
protected  void updateTitles()
          Update the titles above each compare pane based on the contributors.
protected abstract  void verticalScrollTo(int virtualLine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_leftOverview

protected BaseOverview _leftOverview

_rightOverview

protected BaseOverview _rightOverview

OVERVIEW_WIDTH

protected static final int OVERVIEW_WIDTH
Ugh: Make the overview the same width as the scroll bar.


GUI_VERTICAL_SCROLLBAR

public static final java.lang.String GUI_VERTICAL_SCROLLBAR
See Also:
Constant Field Values

GUI_VERTICAL_SPACER

public static final java.lang.String GUI_VERTICAL_SPACER
See Also:
Constant Field Values

_leftScrollPane

protected javax.swing.JScrollPane _leftScrollPane

_rightScrollPane

protected javax.swing.JScrollPane _rightScrollPane

_centerScrollPane

protected javax.swing.JScrollPane _centerScrollPane

_leftTitle

protected final javax.swing.JLabel _leftTitle

_rightTitle

protected final javax.swing.JLabel _rightTitle

_centerTitle

protected final javax.swing.JLabel _centerTitle

_leftDiffGutter

protected DiffGutter _leftDiffGutter

_rightDiffGutter

protected DiffGutter _rightDiffGutter
Constructor Detail

BaseCompareView

protected BaseCompareView()

BaseCompareView

protected BaseCompareView(CompareMode compareMode)

BaseCompareView

protected BaseCompareView(CompareMode compareMode,
                          CompareViewBias compareViewBias)
Method Detail

getFocusComponent

public java.awt.Component getFocusComponent()

getLeftOverview

protected BaseOverview getLeftOverview()

getRightOverview

protected BaseOverview getRightOverview()

getOverviewLeftEditor

protected java.awt.Component getOverviewLeftEditor()

getOverviewRightEditor

protected java.awt.Component getOverviewRightEditor()

getFocusableCenterEditor

protected java.awt.Component getFocusableCenterEditor()

createOverviews

protected void createOverviews()

initializeOverview

protected void initializeOverview(BaseOverview overview)

registerViewDecoration

public static final void registerViewDecoration(java.lang.Class<? extends CompareViewDecoration> decorationClass)

resetGUI

protected final void resetGUI()

getBias

protected CompareViewBias getBias()

isAddition

protected boolean isAddition(oracle.javatools.compare.algorithm.BaseCompareDifference difference,
                             ContributorKind firstContributor,
                             ContributorKind secondContributor)

isRemoval

protected boolean isRemoval(oracle.javatools.compare.algorithm.BaseCompareDifference difference,
                            ContributorKind firstContributor,
                            ContributorKind secondContributor)

getLeftScrollPane

protected javax.swing.JScrollPane getLeftScrollPane()

setLeftScrollPane

protected void setLeftScrollPane(javax.swing.JScrollPane leftScrollPane)

getRightScrollPane

protected javax.swing.JScrollPane getRightScrollPane()

setRightScrollPane

protected void setRightScrollPane(javax.swing.JScrollPane rightScrollPane)

getCenterScrollPane

protected javax.swing.JScrollPane getCenterScrollPane()

setCenterScrollPane

protected void setCenterScrollPane(javax.swing.JScrollPane centerScrollPane)

getVerticalScrollBar

protected javax.swing.JScrollBar getVerticalScrollBar()

getVerticalScrollCardLayout

protected java.awt.CardLayout getVerticalScrollCardLayout()

getVerticalScrollPanel

protected javax.swing.JPanel getVerticalScrollPanel()

getLeftTitle

protected javax.swing.JLabel getLeftTitle()

getRightTitle

protected javax.swing.JLabel getRightTitle()

getCenterTitle

protected javax.swing.JLabel getCenterTitle()

isEditLocked

protected boolean isEditLocked()
Get whether this compare view is locked against editing.

Returns:
true if no edits are allowed from this compare view. false if the editability of the underlying buffers is used to determine whether editing is allowed.

setEditLocked

protected void setEditLocked(boolean editLocked)

getUndoableEditListeners

protected java.util.Collection getUndoableEditListeners()

getLeftDiffGutter

public DiffGutter getLeftDiffGutter()

setLeftDiffGutter

protected void setLeftDiffGutter(DiffGutter leftDiffGutter)

getRightDiffGutter

protected DiffGutter getRightDiffGutter()

setRightDiffGutter

protected void setRightDiffGutter(DiffGutter rightDiffGutter)

calculateRightEditorInset

public static final int calculateRightEditorInset()

setModel

public void setModel(CompareModel compareModel)
Description copied from interface: CompareView
Set the model for this view.

Specified by:
setModel in interface CompareView
Parameters:
compareModel - the compare model to render in this view.

attachContributorChangeListeners

protected void attachContributorChangeListeners()

detachContributorChangeListeners

protected void detachContributorChangeListeners()

initializeView

protected void initializeView(CompareModel compareModel)

getSplitPanel

public SplitPanel getSplitPanel()

createFocusTraversalPolicy

protected java.awt.FocusTraversalPolicy createFocusTraversalPolicy()

setSplitPanel

protected void setSplitPanel(SplitPanel splitPanel)

getGUI

public java.awt.Component getGUI()
Description copied from interface: CompareView
Get the GUI for this compare view.

Specified by:
getGUI in interface CompareView
Returns:
a Component.

getLeftOrCenterSplitter

public java.awt.Component getLeftOrCenterSplitter()
Specified by:
getLeftOrCenterSplitter in interface SplitPanelView

getRightSplitter

public java.awt.Component getRightSplitter()
Specified by:
getRightSplitter in interface SplitPanelView

setSplitterLocation

public void setSplitterLocation(java.awt.Component splitter,
                                int location)
Specified by:
setSplitterLocation in interface SplitPanelView

setSplitterLocation

public void setSplitterLocation(java.awt.Component splitter,
                                int location,
                                java.awt.Component parent)

getSplitterLocation

public int getSplitterLocation(java.awt.Component splitter)
Specified by:
getSplitterLocation in interface SplitPanelView

updateTitles

protected void updateTitles()
Update the titles above each compare pane based on the contributors.


getCompareMode

public CompareMode getCompareMode()

createMutableModel

protected CompareModel createMutableModel(CompareModel compareModel)

addViewEditListener

public void addViewEditListener(ViewEditListener l)
Specified by:
addViewEditListener in interface EditableView

removeViewEditListener

public void removeViewEditListener(ViewEditListener l)
Specified by:
removeViewEditListener in interface EditableView

getViewEditListeners

protected ViewEditListener[] getViewEditListeners()

fireViewEditEvent

protected void fireViewEditEvent(ViewEditEvent vee)

setToolTipProvider

public void setToolTipProvider(CompareToolTipProvider toolTipProvider)
Specified by:
setToolTipProvider in interface ToolTipView

getToolTipProvider

protected CompareToolTipProvider getToolTipProvider()

updateModel

protected void updateModel(CompareModel model)

repaintDiffGutters

protected void repaintDiffGutters()

updateModelImpl

protected abstract void updateModelImpl()
Reapplies the specified model to the view. This is used when the contributors are the same but the model has changed, mainly for performance (it does less work than setModel( model )).


createMemento

protected ViewMemento createMemento()

setMemento

public void setMemento(ViewMemento memento)
Specified by:
setMemento in interface EditableView

createModel

protected CompareModel createModel(CompareDifference[] differences)

createModel

protected abstract CompareModel createModel(CompareModel compareModel,
                                            CompareDifference[] differences)

getBundle

public java.util.ResourceBundle getBundle()
Utility to get the resource bundle for this class.

Returns:
the resource bundle.

createHorizontalScrollPane

protected javax.swing.JScrollPane createHorizontalScrollPane(java.awt.Component view)

initScrollPane

protected void initScrollPane(javax.swing.JScrollPane scrollPane)

getHorizontalScrollBars

protected java.util.Collection getHorizontalScrollBars()

getVerticalScrollbar

public javax.swing.JScrollBar getVerticalScrollbar()

horizontalScrollTo

protected void horizontalScrollTo(java.lang.Object source,
                                  int value)

verticalScrollTo

protected abstract void verticalScrollTo(int virtualLine)

getModel

public CompareModel getModel()
Description copied from interface: CompareView
Get the model for this view.

Specified by:
getModel in interface CompareView
Returns:
a CompareModel instance.

setCompareModel

protected void setCompareModel(CompareModel compareModel)

getCompareModel

public CompareModel getCompareModel()

addPositionListener

public void addPositionListener(javax.swing.event.ChangeListener l)
Description copied from interface: NavigableView
Adds a listener for changes to the current navigable view position.

Specified by:
addPositionListener in interface NavigableView
Parameters:
l - the listener to add.

removePositionListener

public void removePositionListener(javax.swing.event.ChangeListener l)
Description copied from interface: NavigableView
Removes a listener for changes to the current navigable view position.

Specified by:
removePositionListener in interface NavigableView
Parameters:
l - the listener to remove.

firePositionChanged

protected void firePositionChanged()

hasNavigableDifferences

public boolean hasNavigableDifferences()
Description copied from interface: NavigableView
Asks whether the view has navigable differences.

Specified by:
hasNavigableDifferences in interface NavigableView
Returns:
true if the view has differences which can be navigated.

hasNavigableConflicts

public boolean hasNavigableConflicts()
Description copied from interface: NavigableConflictsView
Asks whether the view has navigable conflicts.

Specified by:
hasNavigableConflicts in interface NavigableConflictsView
Returns:
true if the view has conflicts which can be navigated.

addStatusListener

public void addStatusListener(javax.swing.event.ChangeListener l)
Description copied from interface: StatusView
Adds a listener for events which change editor pane status.

Specified by:
addStatusListener in interface StatusView
Parameters:
l - the listener.

removeStatusListener

public void removeStatusListener(javax.swing.event.ChangeListener l)
Description copied from interface: StatusView
Removes a listener for events which change editor pane status.

Specified by:
removeStatusListener in interface StatusView
Parameters:
l - the listener.

fireStatusChanged

protected void fireStatusChanged()

isViewFocusOwner

protected boolean isViewFocusOwner()

getEditActions

public javax.swing.Action[] getEditActions()
Description copied from interface: ActionMenuView
Get the contextual edit actions for the view.

Specified by:
getEditActions in interface ActionMenuView
Returns:
the edit actions available for the view context.

getCurrentDifference

protected abstract CompareDifference getCurrentDifference()

getCurrentContributorKind

protected abstract ContributorKind getCurrentContributorKind()

getAdjacentContributorKind

protected ContributorKind getAdjacentContributorKind(ContributorKind contributorKind)

getAdjacentContributorKind

protected ContributorKind getAdjacentContributorKind(ContributorKind contributorKind,
                                                     BaseCompareView.ContributorBias bias)

getContributor

protected CompareContributor getContributor(ContributorKind contributorKind)

updateOnEdit

protected void updateOnEdit()
Triggered when the compare model needs to be rebuilt following an edit.


markResolved

protected void markResolved(CompareDifference difference)
Mark the given difference block as resolved.

Parameters:
difference - the block to mark as resolved.

markAllResolved

protected void markAllResolved(CompareModel compareModel)
Mark all differences in the given model as resolved.

Parameters:
compareModel - the compare model to mark as fully resolved.

createMarkResolvedAction

protected javax.swing.Action createMarkResolvedAction(CompareDifference difference)

createMarkAllResolvedAction

protected javax.swing.Action createMarkAllResolvedAction(CompareModel compareModel)

goToInitialDifference

public boolean goToInitialDifference()
Description copied from interface: NavigableView
Navigate to the initial difference in this view, without requesting focus

Specified by:
goToInitialDifference in interface NavigableView
Returns:
true if there was at least one difference in this view and navigation was successful.

hasPreviousDifference

public boolean hasPreviousDifference()
Description copied from interface: NavigableView
Asks whether there is a previous difference based on the position.

Specified by:
hasPreviousDifference in interface NavigableView
Returns:
true if a previous difference can be reached from the current position in the navigable view.

hasNextDifference

public boolean hasNextDifference()
Description copied from interface: NavigableView
Asks whether there is a next difference based on the position.

Specified by:
hasNextDifference in interface NavigableView
Returns:
true if a successive difference can be reached from the current position in the navigable view.

goToFirstDifference

public boolean goToFirstDifference()
Description copied from interface: NavigableView
Navigate to the first difference in this view.

Specified by:
goToFirstDifference in interface NavigableView
Returns:
true if there was at least one difference in this view and navigation was successful.

goToLastDifference

public boolean goToLastDifference()
Description copied from interface: NavigableView
Navigate to the last difference in this view.

Specified by:
goToLastDifference in interface NavigableView
Returns:
true if there was at least one difference in this view and navigation was successful.

goToPreviousDifference

public boolean goToPreviousDifference()
Description copied from interface: NavigableView
Navigate to the previous difference in this view.

Specified by:
goToPreviousDifference in interface NavigableView
Returns:
true if there was at least one difference between the current difference and the start of the view. If false is returned and you want to wrap navigation, you can call NavigableView.goToLastDifference().

goToNextDifference

public boolean goToNextDifference()
Description copied from interface: NavigableView
Navigate to the next difference in this view.

Specified by:
goToNextDifference in interface NavigableView
Returns:
true if there was at least one difference between the current difference and the end of the view. If false is returned and you want to wrap navigation, you can call NavigableView.goToFirstDifference().

goToDifference

protected void goToDifference(CompareDifference block)

isOverviewFocusOwner

protected boolean isOverviewFocusOwner()

getPreviousDifference

protected abstract CompareDifference getPreviousDifference()

getNextDifference

protected abstract CompareDifference getNextDifference()

goToDifference

protected abstract void goToDifference(CompareDifference differenceBlock,
                                       boolean requestFocus)

hasPreviousConflict

public boolean hasPreviousConflict()
Description copied from interface: NavigableConflictsView
Asks whether there is a previous conflict based on the position.

Specified by:
hasPreviousConflict in interface NavigableConflictsView
Returns:
true if a previous conflict can be reached from the current position in the navigable view.

hasNextConflict

public boolean hasNextConflict()
Description copied from interface: NavigableConflictsView
Asks whether there is a next conflict based on the position.

Specified by:
hasNextConflict in interface NavigableConflictsView
Returns:
true if a successive conflict can be reached from the current position in the navigable view.

goToFirstConflict

public boolean goToFirstConflict()
Description copied from interface: NavigableConflictsView
Navigate to the first conflict in this view.

Specified by:
goToFirstConflict in interface NavigableConflictsView
Returns:
true if there was at least one conflict in this view and navigation was successful.

goToLastConflict

public boolean goToLastConflict()
Description copied from interface: NavigableConflictsView
Navigate to the last conflict in this view.

Specified by:
goToLastConflict in interface NavigableConflictsView
Returns:
true if there was at least one conflict in this view and navigation was successful.

goToPreviousConflict

public boolean goToPreviousConflict()
Description copied from interface: NavigableConflictsView
Navigate to the previous conflict in this view.

Specified by:
goToPreviousConflict in interface NavigableConflictsView
Returns:
true if there was at least one conflict between the current conflict and the start of the view. If false is returned and you want to wrap navigation, you can call NavigableConflictsView.goToLastConflict().

goToNextConflict

public boolean goToNextConflict()
Description copied from interface: NavigableConflictsView
Navigate to the next conflict in this view.

Specified by:
goToNextConflict in interface NavigableConflictsView
Returns:
true if there was at least one conflict between the current conflict and the end of the view. If false is returned and you want to wrap navigation, you can call NavigableConflictsView.goToFirstConflict().

getPreviousConflict

protected abstract CompareDifference getPreviousConflict()

getNextConflict

protected abstract CompareDifference getNextConflict()

isEditable

protected boolean isEditable(ContributorKind contributor)

canReadElement

protected boolean canReadElement(CompareDifference difference,
                                 ContributorKind contributorKind)

canWriteElement

protected boolean canWriteElement(CompareDifference difference,
                                  ContributorKind contributorKind)

hasDefaultEditAction

protected boolean hasDefaultEditAction(CompareDifference difference,
                                       ContributorKind contributor,
                                       ContributorKind adjacentContributor)
Return whether there is a default edit action

Parameters:
difference - the difference
contributor - the contributor
adjacentContributor - the contributor sharing a gutter with this one.
Returns:
a single action, or null

getDefaultEditAction

protected javax.swing.Action getDefaultEditAction(CompareDifference difference,
                                                  ContributorKind contributor,
                                                  ContributorKind adjacentContributor)
Get the default edit action for the specified difference.

Parameters:
difference - the difference
contributor - the contributor
adjacentContributor - the contributor sharing a gutter with this one.
Returns:
a single action, or null

createReplaceBlockAction

protected javax.swing.Action createReplaceBlockAction(oracle.javatools.compare.algorithm.BaseCompareDifference difference,
                                                      ContributorKind contributor,
                                                      ContributorKind adjacentContributor)

createInsertBlockAction

protected javax.swing.Action createInsertBlockAction(oracle.javatools.compare.algorithm.BaseCompareDifference difference,
                                                     ContributorKind contributor,
                                                     ContributorKind adjacentContributor)

createDeleteBlockAction

protected javax.swing.Action createDeleteBlockAction(oracle.javatools.compare.algorithm.BaseCompareDifference difference,
                                                     ContributorKind contributor,
                                                     ContributorKind adjacentContributor)

replaceBlock

protected abstract void replaceBlock(oracle.javatools.compare.algorithm.BaseCompareDifference block,
                                     ContributorKind fromContributor,
                                     ContributorKind toContributor)
Take a copy of the block from the specified contributor and replace the text of the adjacent contributor with the text. It only really makes sense to do this if the block is a change on both sides, i.e. block.getLength() for both contributors > 0.

Parameters:
block - the block to change
fromContributor - the contributor to copy from
toContributor - the contributor whose block will be replaced.

insertBlockCopy

protected abstract void insertBlockCopy(oracle.javatools.compare.algorithm.BaseCompareDifference block,
                                        ContributorKind fromContributor,
                                        ContributorKind toContributor)
Take a copy of the block from the specified contributor and insert it into the other contributor after the change.

Parameters:
block - the block to copy
fromContributor - the contributor to copy from
toContributor - the contributor to copy to

deleteBlock

protected abstract void deleteBlock(oracle.javatools.compare.algorithm.BaseCompareDifference block,
                                    ContributorKind contributor)
Remove the specified difference block from the specified contributor.

Parameters:
block - the block to remove
contributor - the contributor to remove the block from

getEditActions

protected javax.swing.Action[] getEditActions(CompareDifference difference,
                                              ContributorKind contributor,
                                              ContributorKind adjacentContributor)
Get edit actions for the specified difference.

Parameters:
difference - the difference
contributor - the contributor
adjacentContributor - the contributor sharing a gutter with this one.
Returns:
an array of actions for editing the block in this contributor, or null

getDefaultEditActionIcon

public javax.swing.Icon getDefaultEditActionIcon(oracle.javatools.compare.algorithm.BaseCompareDifference difference,
                                                 ContributorKind contributor,
                                                 ContributorKind adjacentContributor,
                                                 boolean isAncestor)

getHorizontalScrollComponent

public java.awt.Component getHorizontalScrollComponent()
Description copied from interface: CustomHorizontalScrollView
Get the horizontal scrollbar component for this compare view.

Specified by:
getHorizontalScrollComponent in interface CustomHorizontalScrollView
Returns:
a component that controls horizontal scrolling in this compare view.

dispose

public void dispose()

addPopupManager

public void addPopupManager(ComparePopupManager popupManager)
Description copied from interface: ActionMenuView
Add a popup manager to this view. The popup manager will be attached to all editor panes that make up the view.

Specified by:
addPopupManager in interface ActionMenuView
Parameters:
popupManager - the popup manager to attach

removePopupManager

public void removePopupManager(ComparePopupManager popupManager)
Description copied from interface: ActionMenuView
Remove a popup manager from this view. The popup manager will be removed from all editor panes that make up this view.

Specified by:
removePopupManager in interface ActionMenuView
Parameters:
popupManager - the popup manager to remove

getPopupManager

protected final ComparePopupManager getPopupManager()

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

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