org.eclipse.compare.INavigatable Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.compare;
import org.eclipse.swt.widgets.Widget;
/**
* Interface that allow clients to navigate through the changes shown in a compare pane.
*
* This interface may be implemented by clients.
*
* @since 3.3
* @see ICompareNavigator
*/
public interface INavigatable {
/**
* Property key that can be used to associate an instance of this interface with
* an SWT widget using {@link Widget#setData(String, Object)}.
*/
static final String NAVIGATOR_PROPERTY= "org.eclipse.compare.internal.Navigator"; //$NON-NLS-1$
/**
* Change flag used to navigate to the next change.
* @see #selectChange(int)
*/
static final int NEXT_CHANGE= 1;
/**
* Change flag used to navigate to the previous change.
* @see #selectChange(int)
*/
static final int PREVIOUS_CHANGE= 2;
/**
* Change flag used to navigate to the first change.
* @see #selectChange(int)
*/
static final int FIRST_CHANGE= 3;
/**
* Change flag used to navigate to the last change.
* @see #selectChange(int)
*/
static final int LAST_CHANGE= 4;
/**
* Return the input of the compare pane being navigated or null
* if the pane does not have an input.
* @return the input of the compare pane being navigated or null
*/
Object getInput();
/**
* Starting from the current selection selectChange
selects and reveals the specified change.
* If the end (or beginning) is reached, the method returns true
.
*
* @param changeFlag the change to be selected. One of NEXT_CHANGE
, PREVIOUS_CHANGE
,
* FIRST_CHANGE
or LAST_CHANGE
.
* @return returns true
if end (beginning) is reached, false
otherwise
*/
boolean selectChange(int changeFlag);
/**
* Return whether a call to {@link #selectChange(int)} with the same parameter
* would succeed.
* @param changeFlag the change to be selected. One of NEXT_CHANGE
or PREVIOUS_CHANGE
* @return whether a call to {@link #selectChange(int)} with the same parameter
* would succeed.
*/
boolean hasChange(int changeFlag);
/**
* Request that the currently selected change be opened. Return true
* if the request resulted in the change being opened and false
if the
* currently selected change could not be opened.
* @return whether the selected change was opened.
*/
boolean openSelectedChange();
}