1 11 package org.eclipse.ltk.internal.ui.refactoring.history; 12 13 import java.util.Arrays ; 14 import java.util.Collection ; 15 import java.util.HashSet ; 16 import java.util.Iterator ; 17 import java.util.Set ; 18 19 import org.eclipse.core.runtime.Assert; 20 import org.eclipse.core.runtime.IProgressMonitor; 21 import org.eclipse.core.runtime.IStatus; 22 import org.eclipse.core.runtime.Status; 23 import org.eclipse.core.runtime.jobs.Job; 24 25 import org.eclipse.core.resources.IProject; 26 27 import org.eclipse.ltk.core.refactoring.RefactoringCore; 28 import org.eclipse.ltk.core.refactoring.RefactoringDescriptor; 29 import org.eclipse.ltk.core.refactoring.RefactoringDescriptorProxy; 30 import org.eclipse.ltk.core.refactoring.history.RefactoringHistory; 31 32 import org.eclipse.ltk.internal.ui.refactoring.Messages; 33 import org.eclipse.ltk.internal.ui.refactoring.RefactoringUIMessages; 34 35 import org.eclipse.swt.SWT; 36 import org.eclipse.swt.custom.BusyIndicator; 37 import org.eclipse.swt.custom.CLabel; 38 import org.eclipse.swt.custom.ViewForm; 39 import org.eclipse.swt.events.MouseAdapter; 40 import org.eclipse.swt.events.MouseEvent; 41 import org.eclipse.swt.graphics.Color; 42 import org.eclipse.swt.graphics.Point; 43 import org.eclipse.swt.layout.GridData; 44 import org.eclipse.swt.layout.GridLayout; 45 import org.eclipse.swt.widgets.Composite; 46 import org.eclipse.swt.widgets.Control; 47 import org.eclipse.swt.widgets.Label; 48 import org.eclipse.swt.widgets.Text; 49 import org.eclipse.swt.widgets.TreeItem; 50 import org.eclipse.swt.widgets.Widget; 51 52 import org.eclipse.jface.dialogs.Dialog; 53 import org.eclipse.jface.viewers.AbstractTreeViewer; 54 import org.eclipse.jface.viewers.CheckStateChangedEvent; 55 import org.eclipse.jface.viewers.CheckboxTreeViewer; 56 import org.eclipse.jface.viewers.ICheckStateListener; 57 import org.eclipse.jface.viewers.ISelection; 58 import org.eclipse.jface.viewers.ISelectionChangedListener; 59 import org.eclipse.jface.viewers.IStructuredSelection; 60 import org.eclipse.jface.viewers.ITreeViewerListener; 61 import org.eclipse.jface.viewers.SelectionChangedEvent; 62 import org.eclipse.jface.viewers.StructuredSelection; 63 import org.eclipse.jface.viewers.TreeExpansionEvent; 64 import org.eclipse.jface.viewers.TreeViewer; 65 66 import org.eclipse.ui.progress.UIJob; 67 68 import org.eclipse.compare.CompareViewerPane; 69 import org.eclipse.compare.Splitter; 70 71 import org.eclipse.ltk.ui.refactoring.history.IRefactoringHistoryControl; 72 import org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryContentProvider; 73 import org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryControlConfiguration; 74 import org.eclipse.ltk.ui.refactoring.history.RefactoringHistoryLabelProvider; 75 76 81 public class RefactoringHistoryControl extends Composite implements IRefactoringHistoryControl { 82 83 84 protected final class RefactoringHistoryLabel extends CLabel { 85 86 94 public RefactoringHistoryLabel(final Composite parent, final int style) { 95 super(parent, style); 96 } 97 98 101 public Point computeSize(final int wHint, final int hHint, final boolean changed) { 102 return super.computeSize(wHint, Math.max(24, hHint), changed); 103 } 104 105 108 public Color getForeground() { 109 if (isEnabled()) 110 return super.getForeground(); 111 return getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW); 112 } 113 } 114 115 116 protected final class RefactoringHistoryTreeViewer extends CheckboxTreeViewer { 117 118 126 public RefactoringHistoryTreeViewer(final Composite parent, final int style) { 127 super(parent, style); 128 addCheckStateListener(new ICheckStateListener() { 129 130 133 public final void checkStateChanged(final CheckStateChangedEvent event) { 134 reconcileCheckState(event.getElement(), event.getChecked()); 135 handleCheckStateChanged(); 136 } 137 }); 138 addTreeListener(new ITreeViewerListener() { 139 140 143 public final void treeCollapsed(final TreeExpansionEvent event) { 144 } 146 147 150 public final void treeExpanded(final TreeExpansionEvent event) { 151 BusyIndicator.showWhile(getDisplay(), new Runnable () { 152 153 public final void run() { 154 final Object element= event.getElement(); 155 if (getGrayed(element)) { 156 final RefactoringHistory history= RefactoringHistoryControl.this.getInput(); 157 if (history != null) 158 reconcileCheckState(history); 159 } else if (getChecked(element)) { 160 setSubTreeGrayed(element, false); 161 setSubtreeChecked(element, true); 162 } 163 } 164 }); 165 } 166 }); 167 } 168 169 176 private Object [] getChildren(final Object element) { 177 return ((RefactoringHistoryContentProvider) getContentProvider()).getChildren(element); 178 } 179 180 186 private void reconcileCheckState(final Object element) { 187 final Object [] children= getChildren(element); 188 for (int index= 0; index < children.length; index++) { 189 reconcileCheckState(children[index]); 190 } 191 int checkCount= 0; 192 final Collection collection= getCoveredDescriptors(element); 193 for (final Iterator iterator= collection.iterator(); iterator.hasNext();) { 194 final RefactoringDescriptorProxy proxy= (RefactoringDescriptorProxy) iterator.next(); 195 if (fCheckedDescriptors.contains(proxy)) 196 checkCount++; 197 } 198 setElementChecked(element, checkCount > 0); 199 setElementGrayed(element, checkCount != 0 && checkCount != collection.size()); 200 } 201 202 211 private void reconcileCheckState(final Object element, final boolean checked) { 212 if (element instanceof RefactoringHistoryEntry) { 213 final RefactoringHistoryEntry entry= (RefactoringHistoryEntry) element; 214 final RefactoringDescriptorProxy proxy= entry.getDescriptor(); 215 if (checked) 216 fCheckedDescriptors.add(proxy); 217 else 218 fCheckedDescriptors.remove(proxy); 219 } else if (element instanceof RefactoringHistoryNode) { 220 final Collection collection= getCoveredDescriptors(element); 221 if (checked) 222 fCheckedDescriptors.addAll(collection); 223 else 224 fCheckedDescriptors.removeAll(collection); 225 } 226 RefactoringHistoryControl.this.reconcileCheckState(); 227 } 228 229 238 private void setElementChecked(final Object element, final boolean checked) { 239 final Widget widget= RefactoringHistoryTreeViewer.this.findItem(element); 240 if (widget instanceof TreeItem) { 241 final TreeItem item= (TreeItem) widget; 242 item.setChecked(checked); 243 } 244 } 245 246 255 private void setElementGrayed(final Object element, final boolean grayed) { 256 final Widget widget= RefactoringHistoryTreeViewer.this.findItem(element); 257 if (widget instanceof TreeItem) { 258 final TreeItem item= (TreeItem) widget; 259 item.setGrayed(grayed); 260 } 261 } 262 263 273 private void setSubTreeGrayed(final Object element, final boolean grayed) { 274 setElementGrayed(element, grayed); 275 final Object [] children= getChildren(element); 276 for (int index= 0; index < children.length; index++) { 277 setSubTreeGrayed(children[index], grayed); 278 } 279 } 280 } 281 282 286 private final Set fCheckedDescriptors= new HashSet (); 287 288 289 protected final RefactoringHistoryControlConfiguration fControlConfiguration; 290 291 292 private Text fDetailField= null; 293 294 295 private Label fDetailLabel= null; 296 297 298 protected CompareViewerPane fHistoryPane= null; 299 300 301 protected TreeViewer fHistoryViewer= null; 302 303 307 private final Set fSelectedDescriptors= new HashSet (); 308 309 310 private Label fSelectionLabel= null; 311 312 313 private Splitter fSplitterControl= null; 314 315 323 public RefactoringHistoryControl(final Composite parent, final RefactoringHistoryControlConfiguration configuration) { 324 super(parent, SWT.NONE); 325 Assert.isNotNull(configuration); 326 fControlConfiguration= configuration; 327 } 328 329 332 public final void addCheckStateListener(final ICheckStateListener listener) { 333 Assert.isNotNull(listener); 334 if (fHistoryViewer instanceof RefactoringHistoryTreeViewer) { 335 final RefactoringHistoryTreeViewer viewer= (RefactoringHistoryTreeViewer) fHistoryViewer; 336 viewer.addCheckStateListener(listener); 337 } 338 } 339 340 343 public final void addSelectionChangedListener(final ISelectionChangedListener listener) { 344 Assert.isNotNull(listener); 345 if (fHistoryViewer != null) 346 fHistoryViewer.addSelectionChangedListener(listener); 347 } 348 349 355 protected void createBottomButtonBar(final Composite parent) { 356 } 358 359 362 public void createControl() { 363 RefactoringCore.getHistoryService().connect(); 364 GridLayout layout= new GridLayout(getContainerColumns(), false); 365 layout.marginHeight= 0; 366 layout.marginWidth= 0; 367 layout.horizontalSpacing= 0; 368 layout.verticalSpacing= 0; 369 setLayout(layout); 370 setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL)); 371 fSplitterControl= new Splitter(this, SWT.VERTICAL); 372 fSplitterControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL)); 373 createRightButtonBar(this); 374 final Composite leftPane= new Composite(fSplitterControl, SWT.NONE); 375 layout= new GridLayout(); 376 layout.marginWidth= 0; 377 layout.marginHeight= 2; 378 layout.verticalSpacing= 2; 379 leftPane.setLayout(layout); 380 fHistoryPane= new CompareViewerPane(leftPane, SWT.BORDER | SWT.FLAT); 381 fHistoryPane.setTopLeft(new RefactoringHistoryLabel(fHistoryPane, SWT.NONE)); 382 fHistoryPane.setText(getHistoryPaneText()); 383 fHistoryPane.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL)); 384 fHistoryViewer= createHistoryViewer(fHistoryPane); 385 if (!fControlConfiguration.isTimeDisplayed()) 386 fHistoryViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS); 387 fHistoryViewer.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL)); 388 fHistoryViewer.setUseHashlookup(true); 389 fHistoryViewer.setContentProvider(getContentProvider()); 390 fHistoryViewer.setLabelProvider(getLabelProvider()); 391 fHistoryViewer.addSelectionChangedListener(new ISelectionChangedListener() { 392 393 public final void selectionChanged(final SelectionChangedEvent event) { 394 final ISelection selection= event.getSelection(); 395 if (selection instanceof IStructuredSelection) 396 handleSelectionChanged((IStructuredSelection) selection); 397 } 398 }); 399 fHistoryPane.setContent(fHistoryViewer.getControl()); 400 createToolBar(fHistoryPane); 401 createDetailPane(fSplitterControl); 402 final MouseAdapter listener= new MouseAdapter() { 403 404 public void mouseDoubleClick(final MouseEvent event) { 405 final Control content= fHistoryPane.getContent(); 406 if (content != null && content.getBounds().contains(event.x, event.y)) 407 return; 408 final Control control= fHistoryPane.getParent().getParent(); 409 if (control instanceof Splitter) 410 ((Splitter) control).setMaximizedControl(fHistoryPane.getParent()); 411 } 412 }; 413 addMouseListener(listener); 414 fHistoryPane.getTopLeft().addMouseListener(listener); 415 fSplitterControl.setWeights(new int[] { 65, 35}); 416 createBottomButtonBar(this); 417 Dialog.applyDialogFont(this); 418 } 419 420 426 protected void createDetailLabel(final Composite parent) { 427 Assert.isNotNull(parent); 428 fDetailLabel= new Label(parent, SWT.HORIZONTAL | SWT.LEFT | SWT.WRAP); 429 fDetailLabel.setText(RefactoringUIMessages.RefactoringHistoryControl_comment_viewer_label); 430 final GridData data= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); 431 data.horizontalSpan= 1; 432 fDetailLabel.setLayoutData(data); 433 } 434 435 442 protected Composite createDetailPane(final Composite parent) { 443 Assert.isNotNull(parent); 444 final Composite composite= new Composite(parent, SWT.NONE); 445 final GridLayout layout= new GridLayout(getDetailColumns(), true); 446 layout.horizontalSpacing= 0; 447 layout.marginHeight= 0; 448 layout.marginWidth= 0; 449 composite.setLayout(layout); 450 createDetailLabel(composite); 451 createSelectionLabel(composite); 452 fDetailField= new Text(composite, SWT.BORDER | SWT.FLAT | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL); 453 fDetailField.setText(fControlConfiguration.getCommentCaption()); 454 final GridData data= new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); 455 data.horizontalSpan= getDetailColumns(); 456 fDetailField.setLayoutData(data); 457 return composite; 458 } 459 460 467 protected TreeViewer createHistoryViewer(final Composite parent) { 468 Assert.isNotNull(parent); 469 if (fControlConfiguration.isCheckableViewer()) 470 return new RefactoringHistoryTreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL); 471 else 472 return new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL); 473 } 474 475 481 protected void createRightButtonBar(final Composite parent) { 482 } 484 485 491 protected void createSelectionLabel(final Composite parent) { 492 Assert.isNotNull(parent); 493 fSelectionLabel= new Label(parent, SWT.HORIZONTAL | SWT.RIGHT | SWT.WRAP); 494 final GridData data= new GridData(GridData.HORIZONTAL_ALIGN_END); 495 data.horizontalSpan= 1; 496 fSelectionLabel.setLayoutData(data); 497 } 498 499 505 protected void createToolBar(final ViewForm parent) { 506 } 508 509 512 public final void dispose() { 513 RefactoringCore.getHistoryService().disconnect(); 514 super.dispose(); 515 } 516 517 520 public final RefactoringDescriptorProxy[] getCheckedDescriptors() { 521 if (fHistoryViewer instanceof RefactoringHistoryTreeViewer) 522 return (RefactoringDescriptorProxy[]) fCheckedDescriptors.toArray(new RefactoringDescriptorProxy[fCheckedDescriptors.size()]); 523 return getSelectedDescriptors(); 524 } 525 526 531 protected int getContainerColumns() { 532 return 2; 533 } 534 535 540 protected RefactoringHistoryContentProvider getContentProvider() { 541 return fControlConfiguration.getContentProvider(); 542 } 543 544 547 public final Control getControl() { 548 return this; 549 } 550 551 558 private Collection getCoveredDescriptors(final Object element) { 559 Assert.isNotNull(element); 560 final Set set= new HashSet (); 561 getCoveredDescriptors(element, set); 562 return set; 563 } 564 565 573 private void getCoveredDescriptors(final Object element, final Set set) { 574 Assert.isNotNull(element); 575 Assert.isNotNull(set); 576 final RefactoringHistoryContentProvider provider= (RefactoringHistoryContentProvider) fHistoryViewer.getContentProvider(); 577 if (provider != null) { 578 if (element instanceof RefactoringHistoryEntry) { 579 final RefactoringHistoryEntry entry= (RefactoringHistoryEntry) element; 580 final RefactoringDescriptorProxy proxy= entry.getDescriptor(); 581 set.add(proxy); 582 } else { 583 final Object [] children= provider.getChildren(element); 584 for (int index= 0; index < children.length; index++) { 585 final Object child= children[index]; 586 if (child instanceof RefactoringHistoryNode) 587 getCoveredDescriptors(child, set); 588 } 589 } 590 } 591 } 592 593 598 protected int getDetailColumns() { 599 return 2; 600 } 601 602 607 private String getHistoryPaneText() { 608 String text= null; 609 final IProject project= fControlConfiguration.getProject(); 610 if (project != null) 611 text= Messages.format(fControlConfiguration.getProjectPattern(), project.getName()); 612 else 613 text= fControlConfiguration.getWorkspaceCaption(); 614 return text; 615 } 616 617 622 public final RefactoringHistory getInput() { 623 return (RefactoringHistory) fHistoryViewer.getInput(); 624 } 625 626 631 protected RefactoringHistoryLabelProvider getLabelProvider() { 632 return fControlConfiguration.getLabelProvider(); 633 } 634 635 638 public final RefactoringDescriptorProxy[] getSelectedDescriptors() { 639 return (RefactoringDescriptorProxy[]) fSelectedDescriptors.toArray(new RefactoringDescriptorProxy[fSelectedDescriptors.size()]); 640 } 641 642 645 protected void handleCheckStateChanged() { 646 if (fSelectionLabel != null) { 647 final RefactoringHistory history= getInput(); 648 if (history != null) { 649 final int total= history.getDescriptors().length; 650 final int checked= fCheckedDescriptors.size(); 651 if (fSelectionLabel.isEnabled()) { 652 if (total > 0 && fControlConfiguration.isCheckableViewer()) 653 fSelectionLabel.setText(Messages.format(RefactoringUIMessages.RefactoringHistoryControl_selection_pattern, new String [] { String.valueOf(checked), String.valueOf(total)})); 654 else 655 fSelectionLabel.setText(RefactoringUIMessages.RefactoringHistoryControl_no_selection); 656 } else 657 fSelectionLabel.setText(""); } 659 } 660 } 661 662 668 protected void handleSelectionChanged(final IStructuredSelection selection) { 669 Assert.isNotNull(selection); 670 fSelectedDescriptors.clear(); 671 final Object [] elements= selection.toArray(); 672 for (int index= 0; index < elements.length; index++) { 673 final Object element= elements[index]; 674 if (element instanceof RefactoringHistoryEntry) { 675 final RefactoringHistoryEntry entry= (RefactoringHistoryEntry) element; 676 final RefactoringDescriptorProxy proxy= entry.getDescriptor(); 677 fSelectedDescriptors.add(proxy); 678 } else if (element instanceof RefactoringHistoryNode) { 679 final RefactoringHistoryNode node= (RefactoringHistoryNode) element; 680 fSelectedDescriptors.addAll(getCoveredDescriptors(node)); 681 } 682 } 683 if (elements.length == 1 && elements[0] instanceof RefactoringHistoryEntry) { 684 final RefactoringHistoryEntry entry= (RefactoringHistoryEntry) elements[0]; 685 final RefactoringDescriptorProxy proxy= entry.getDescriptor(); 686 final Job job= new UIJob(RefactoringUIMessages.RefactoringHistoryControl_resolving_information) { 687 688 public final IStatus runInUIThread(final IProgressMonitor monitor) { 689 final RefactoringDescriptor descriptor= proxy.requestDescriptor(monitor); 690 if (descriptor != null) { 691 String comment= descriptor.getComment(); 692 if ("".equals(comment)) comment= RefactoringUIMessages.RefactoringHistoryControl_no_comment; 694 fDetailField.setText(comment); 695 } 696 return Status.OK_STATUS; 697 } 698 }; 699 job.setSystem(true); 700 job.schedule(); 701 } else 702 fDetailField.setText(fControlConfiguration.getCommentCaption()); 703 } 704 705 708 public void reconcileCheckState() { 709 final RefactoringHistory history= getInput(); 710 if (history != null && fHistoryViewer instanceof RefactoringHistoryTreeViewer) 711 ((RefactoringHistoryTreeViewer) fHistoryViewer).reconcileCheckState(history); 712 } 713 714 717 public void reconcileSelectionState() { 718 final RefactoringHistoryNode[] nodes= new RefactoringHistoryNode[fSelectedDescriptors.size()]; 719 int index= 0; 720 for (final Iterator iterator= fSelectedDescriptors.iterator(); iterator.hasNext(); index++) { 721 final RefactoringDescriptorProxy descriptor= (RefactoringDescriptorProxy) iterator.next(); 722 nodes[index]= new RefactoringHistoryEntry(null, descriptor); 723 fHistoryViewer.expandToLevel(nodes[index], AbstractTreeViewer.ALL_LEVELS); 724 } 725 fHistoryViewer.setSelection(new StructuredSelection(nodes), true); 726 } 727 728 731 public final void removeCheckStateListener(final ICheckStateListener listener) { 732 Assert.isNotNull(listener); 733 Assert.isNotNull(listener); 734 if (fHistoryViewer instanceof RefactoringHistoryTreeViewer) { 735 final RefactoringHistoryTreeViewer viewer= (RefactoringHistoryTreeViewer) fHistoryViewer; 736 viewer.removeCheckStateListener(listener); 737 } 738 } 739 740 743 public final void removeSelectionChangedListener(final ISelectionChangedListener listener) { 744 Assert.isNotNull(listener); 745 if (fHistoryViewer != null) 746 fHistoryViewer.removeSelectionChangedListener(listener); 747 } 748 749 752 public final void setCheckedDescriptors(final RefactoringDescriptorProxy[] descriptors) { 753 Assert.isNotNull(descriptors); 754 if (fHistoryViewer instanceof RefactoringHistoryTreeViewer) { 755 fCheckedDescriptors.clear(); 756 fCheckedDescriptors.addAll(Arrays.asList(descriptors)); 757 final RefactoringHistoryTreeViewer viewer= (RefactoringHistoryTreeViewer) fHistoryViewer; 758 final RefactoringHistory history= RefactoringHistoryControl.this.getInput(); 759 if (history != null) 760 viewer.reconcileCheckState(history); 761 handleCheckStateChanged(); 762 } else 763 setSelectedDescriptors(descriptors); 764 } 765 766 769 protected void setExpandedState() { 770 final RefactoringHistoryContentProvider provider= (RefactoringHistoryContentProvider) fHistoryViewer.getContentProvider(); 771 if (provider != null) { 772 handleCheckStateChanged(); 773 final Object [] roots= provider.getRootElements(); 774 if (roots != null) { 775 for (int index= 0; index < roots.length; index++) { 776 if (!(roots[index] instanceof RefactoringHistoryEntry)) { 777 fHistoryViewer.setExpandedState(roots[index], true); 778 return; 779 } 780 } 781 } 782 } 783 } 784 785 788 protected void setHistoryControlEnablement() { 789 boolean enable= false; 790 final RefactoringHistory history= (RefactoringHistory) fHistoryViewer.getInput(); 791 if (history != null) { 792 final RefactoringDescriptorProxy[] proxies= history.getDescriptors(); 793 if (proxies.length > 0) 794 enable= true; 795 } 796 if (fDetailField != null) 797 fDetailField.setEnabled(enable); 798 if (fDetailLabel != null) 799 fDetailLabel.setEnabled(enable); 800 if (fHistoryPane != null) 801 fHistoryPane.setEnabled(enable); 802 if (fSelectionLabel != null) 803 fSelectionLabel.setEnabled(enable); 804 if (enable) { 805 fDetailField.setText(fControlConfiguration.getCommentCaption()); 806 if (fSelectionLabel != null) 807 fSelectionLabel.setText(RefactoringUIMessages.RefactoringHistoryControl_no_selection); 808 } else { 809 fDetailField.setText(""); if (fSelectionLabel != null) 811 fSelectionLabel.setText(""); } 813 } 814 815 818 public void setInput(final RefactoringHistory history) { 819 fHistoryViewer.setInput(history); 820 fSelectedDescriptors.clear(); 821 fCheckedDescriptors.clear(); 822 if (history != null) { 823 final RefactoringHistoryContentProvider provider= (RefactoringHistoryContentProvider) fHistoryViewer.getContentProvider(); 824 if (provider != null) { 825 provider.inputChanged(fHistoryViewer, null, history); 826 setExpandedState(); 827 setHistoryControlEnablement(); 828 } 829 } 830 } 831 832 835 public final void setSelectedDescriptors(final RefactoringDescriptorProxy[] descriptors) { 836 Assert.isNotNull(descriptors); 837 if (fHistoryViewer != null) { 838 fSelectedDescriptors.clear(); 839 fSelectedDescriptors.addAll(Arrays.asList(descriptors)); 840 final RefactoringHistoryNode[] nodes= new RefactoringHistoryNode[descriptors.length]; 841 for (int index= 0; index < descriptors.length; index++) 842 nodes[index]= new RefactoringHistoryEntry(null, descriptors[index]); 843 fHistoryViewer.setSelection(new StructuredSelection(nodes)); 844 } 845 } 846 } | Popular Tags |