return context == null ? false : context.contains(file);
}
private void setDiffIndex(int idx, int location) {
currentIndex = idx;
DiffController view = null;
if (currentIndex != -1) {
currentModelIndex = showingFileTable() ? fileTable.getModelIndex(currentIndex) : 0;
view = setups[currentModelIndex].getView();
// enable Select in .. action
TopComponent tc = (TopComponent) getClientProperty(TopComponent.class);
if (tc != null) {
Node node = Node.EMPTY;
File baseFile = setups[currentModelIndex].getBaseFile();
if (baseFile != null) {
FileObject fo = FileUtil.toFileObject(baseFile);
if (fo != null) {
node = new AbstractNode(Children.LEAF, Lookups.singleton(fo));
}
}
tc.setActivatedNodes(new Node[]{node});
}
diffView = null;
boolean focus = false;
if (view != null) {
if (showingFileTable()) {
fileTableSetSelectedIndexContext = true;
fileTable.setSelectedIndex(currentIndex);
fileTableSetSelectedIndexContext = false;
}
diffView = view.getJComponent();
diffView.getActionMap().put("jumpNext", nextAction); // NOI18N
diffView.getActionMap().put("jumpPrev", prevAction); // NOI18N
setBottomComponent();
if (location == -1) {
location = view.getDifferenceCount() - 1;
}
if (location >= 0 && location < view.getDifferenceCount()) {
view.setLocation(DiffController.DiffPane.Modified, DiffController.LocationType.DifferenceIndex, location);
}
Component toc = WindowManager.getDefault().getRegistry().getActivated();
if (SwingUtilities.isDescendingFrom(this, toc)) {
// focus = true;
}