Lines 175-185
Link Here
|
175 |
|
175 |
|
176 |
INavigatable nav= new INavigatable() { |
176 |
INavigatable nav= new INavigatable() { |
177 |
public boolean gotoDifference(boolean next) { |
177 |
public boolean gotoDifference(boolean next) { |
178 |
return internalNavigate(next); |
178 |
return internalNavigate(next, true); |
179 |
} |
179 |
} |
180 |
}; |
180 |
}; |
181 |
tree.setData(INavigatable.NAVIGATOR_PROPERTY, nav); |
181 |
tree.setData(INavigatable.NAVIGATOR_PROPERTY, nav); |
182 |
|
182 |
|
|
|
183 |
IOpenable openable= new IOpenable() { |
184 |
public void openSelected() { |
185 |
internalOpen(); |
186 |
} |
187 |
}; |
188 |
tree.setData(IOpenable.OPENABLE_PROPERTY, openable); |
189 |
|
183 |
fLeftIsLocal= Utilities.getBoolean(configuration, "LEFT_IS_LOCAL", false); //$NON-NLS-1$ |
190 |
fLeftIsLocal= Utilities.getBoolean(configuration, "LEFT_IS_LOCAL", false); //$NON-NLS-1$ |
184 |
|
191 |
|
185 |
tree.setData(CompareUI.COMPARE_VIEWER_TITLE, getTitle()); |
192 |
tree.setData(CompareUI.COMPARE_VIEWER_TITLE, getTitle()); |
Lines 498-504
Link Here
|
498 |
* @param next if <code>true</code> the next node is selected, otherwise the previous node |
505 |
* @param next if <code>true</code> the next node is selected, otherwise the previous node |
499 |
*/ |
506 |
*/ |
500 |
protected void navigate(boolean next) { |
507 |
protected void navigate(boolean next) { |
501 |
internalNavigate(next); |
508 |
internalNavigate(next, false); |
502 |
} |
509 |
} |
503 |
|
510 |
|
504 |
//---- private |
511 |
//---- private |
Lines 512-518
Link Here
|
512 |
* @param next if <code>true</code> the next node is selected, otherwise the previous node |
519 |
* @param next if <code>true</code> the next node is selected, otherwise the previous node |
513 |
* @return <code>true</code> if at end (or beginning) |
520 |
* @return <code>true</code> if at end (or beginning) |
514 |
*/ |
521 |
*/ |
515 |
private boolean internalNavigate(boolean next) { |
522 |
private boolean internalNavigate(boolean next, boolean open) { |
516 |
|
523 |
|
517 |
Control c= getControl(); |
524 |
Control c= getControl(); |
518 |
if (!(c instanceof Tree)) |
525 |
if (!(c instanceof Tree)) |
Lines 528-534
Link Here
|
528 |
if (children != null && children.length > 0) { |
535 |
if (children != null && children.length > 0) { |
529 |
item= children[0]; |
536 |
item= children[0]; |
530 |
if (item != null && item.getItemCount() <= 0) { |
537 |
if (item != null && item.getItemCount() <= 0) { |
531 |
internalSetSelection(item); |
538 |
internalSetSelection(item, open); |
532 |
return false; |
539 |
return false; |
533 |
} |
540 |
} |
534 |
} |
541 |
} |
Lines 543-549
Link Here
|
543 |
} |
550 |
} |
544 |
|
551 |
|
545 |
if (item != null) { |
552 |
if (item != null) { |
546 |
internalSetSelection(item); |
553 |
internalSetSelection(item, open); |
547 |
return false; |
554 |
return false; |
548 |
} |
555 |
} |
549 |
return true; |
556 |
return true; |
Lines 632-642
Link Here
|
632 |
return item; |
639 |
return item; |
633 |
} |
640 |
} |
634 |
|
641 |
|
635 |
private void internalSetSelection(TreeItem ti) { |
642 |
private void internalSetSelection(TreeItem ti, boolean open) { |
636 |
if (ti != null) { |
643 |
if (ti != null) { |
637 |
Object data= ti.getData(); |
644 |
Object data= ti.getData(); |
638 |
if (data != null) |
645 |
if (data != null) { |
639 |
setSelection(new StructuredSelection(data), true); |
646 |
ISelection selection= new StructuredSelection(data); |
|
|
647 |
setSelection(selection, true); |
648 |
if (open && selection.equals(getSelection())) { |
649 |
fireOpen(new OpenEvent(this, selection)); |
650 |
} |
651 |
} |
640 |
} |
652 |
} |
641 |
} |
653 |
} |
642 |
|
654 |
|
Lines 703-708
Link Here
|
703 |
fCopyLeftToRightAction.setEnabled(leftToRight > 0); |
715 |
fCopyLeftToRightAction.setEnabled(leftToRight > 0); |
704 |
if (fCopyRightToLeftAction != null) |
716 |
if (fCopyRightToLeftAction != null) |
705 |
fCopyRightToLeftAction.setEnabled(rightToLeft > 0); |
717 |
fCopyRightToLeftAction.setEnabled(rightToLeft > 0); |
|
|
718 |
} |
719 |
|
720 |
private void internalOpen() { |
721 |
ISelection selection= getSelection(); |
722 |
if (selection != null && !selection.isEmpty()) { |
723 |
fireOpen(new OpenEvent(this, selection)); |
724 |
} |
706 |
} |
725 |
} |
707 |
} |
726 |
} |
708 |
|
727 |
|