1 11 package org.eclipse.compare.internal; 12 13 import java.lang.reflect.InvocationTargetException ; 14 15 import org.eclipse.compare.ICompareContainer; 16 import org.eclipse.compare.ICompareNavigator; 17 import org.eclipse.compare.structuremergeviewer.ICompareInput; 18 import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener; 19 import org.eclipse.jface.action.MenuManager; 20 import org.eclipse.jface.operation.IRunnableWithProgress; 21 import org.eclipse.jface.viewers.ISelectionProvider; 22 import org.eclipse.ui.*; 23 import org.eclipse.ui.services.IServiceLocator; 24 25 public class CompareContainer implements ICompareContainer { 26 27 private WorkerJob worker; 28 29 32 public void setStatusMessage(String message) { 33 } 35 36 39 public void addCompareInputChangeListener(ICompareInput input, 40 ICompareInputChangeListener listener) { 41 input.addCompareInputChangeListener(listener); 42 } 43 44 47 public void removeCompareInputChangeListener(ICompareInput input, 48 ICompareInputChangeListener listener) { 49 input.removeCompareInputChangeListener(listener); 50 } 51 52 55 public void registerContextMenu(MenuManager menu, 56 ISelectionProvider selectionProvider) { 57 } 59 60 63 public IServiceLocator getServiceLocator() { 64 return null; 65 } 66 67 70 public IActionBars getActionBars() { 71 return null; 72 } 73 74 77 public void run(boolean fork, boolean cancelable, 78 IRunnableWithProgress runnable) 79 throws InvocationTargetException , InterruptedException { 80 PlatformUI.getWorkbench().getProgressService().run(fork, cancelable, runnable); 81 } 82 83 86 public ICompareNavigator getNavigator() { 87 return null; 88 } 89 90 93 public synchronized void runAsynchronously(IRunnableWithProgress runnable) { 94 if (worker == null) 95 worker = createWorkerJob(); 96 worker.add(runnable); 97 } 98 99 protected WorkerJob createWorkerJob() { 100 WorkerJob workerJob = new WorkerJob(getWorkerJobName()); 101 return workerJob; 102 } 103 104 protected String getWorkerJobName() { 105 return CompareMessages.CompareContainer_0; 106 } 107 108 public IWorkbenchPart getWorkbenchPart() { 109 return null; 110 } 111 112 } 113 | Popular Tags |