Class HistoryPageCompareEditorInput

    • Constructor Detail

      • HistoryPageCompareEditorInput

        public HistoryPageCompareEditorInput​(CompareConfiguration configuration,
                                             IHistoryPageSource pageSource,
                                             Object object)
        Create a history page compare editor input for the given page and object.
        Parameters:
        configuration - the compare configuration
        pageSource - the page source
        object - the object whose history is to be displayed
    • Method Detail

      • prepareInput

        protected Object prepareInput​(IProgressMonitor monitor)
                               throws InvocationTargetException,
                                      InterruptedException
        Description copied from class: CompareEditorInput
        Runs the compare operation and returns the compare result. If null is returned no differences were found and no compare editor needs to be opened. Progress should be reported to the given progress monitor. A request to cancel the operation should be honored and acknowledged by throwing InterruptedException.

        Note: this method is typically called in a modal context thread which doesn't have a Display assigned. Implementors of this method shouldn't therefore allocated any SWT resources in this method.

        Specified by:
        prepareInput in class CompareEditorInput
        Parameters:
        monitor - the progress monitor to use to display progress and receive requests for cancellation
        Returns:
        the result of the compare operation, or null if there are no differences
        Throws:
        InvocationTargetException - if the prepareInput method must propagate a checked exception, it should wrap it inside an InvocationTargetException; runtime exceptions are automatically wrapped in an InvocationTargetException by the calling context
        InterruptedException - if the operation detects a request to cancel, using IProgressMonitor.isCanceled(), it should exit by throwing InterruptedException
      • asCompareInput

        protected ICompareInput asCompareInput​(ISelection selection)
        Description copied from class: PageCompareEditorInput
        Return a compare input that represents the selection. This input is used to feed the structure and content viewers. By default, a compare input is returned if the selection is of size 1 and the selected element implements ICompareInput. Subclasses may override.
        Overrides:
        asCompareInput in class PageCompareEditorInput
        Parameters:
        selection - the selection
        Returns:
        a compare input representing the selection
      • getHistoryPage

        public final IHistoryPage getHistoryPage()
        Return the history page for this input or null if the page hasn't been created yet.
        Returns:
        the history page for this input
      • handlePropertyChange

        protected void handlePropertyChange​(PropertyChangeEvent event)
        Handle a property change event from the history page.
        Parameters:
        event - the change event
      • isReplaceDialog

        protected boolean isReplaceDialog()
        Return whether this compare editor input is being used in a replace dialog.
        Returns:
        whether this compare editor input is being used in a replace dialog
      • setReplace

        public void setReplace​(boolean isReplace)
        Set whether this compare editor input is being used in a replace dialog.
        Parameters:
        isReplace - whether this compare editor input is being used in a replace dialog
      • okPressed

        public boolean okPressed()
        Description copied from class: CompareEditorInput
        The OK button was pressed in a dialog. If one or both of the sides of the input is editable then any changes will be saved. If the input is for edition selection (see CompareEditorInput.isEditionSelectionDialog()), it is up to subclasses to override this method in order to perform the appropriate operation on the selected edition.
        Overrides:
        okPressed in class CompareEditorInput
        Returns:
        whether the dialog should be closed or not.
      • performReplace

        protected void performReplace​(Object selectedObject)
                               throws CoreException
        A replace has been requested. This method will be invoked if isReplaceDialog() is true and the user has clicked the "Replace" button. By default, this method does nothing. Subclasses may override.
        Parameters:
        selectedObject - the selected object
        Throws:
        CoreException - if an error occurs performing the replace