コード例 #1
0
 protected Viewer createMergeViewer(Composite parent, CompareConfiguration compareConfiguration) {
   compareConfiguration.setProperty(DefaultMergeEditor.PROVIDER, mergeEditorProvider);
   return new DefaultMergeViewer(
       parent,
       SWT.NULL,
       compareConfiguration,
       documentProvider,
       sourceViewerConfigurationProvider);
 }
コード例 #2
0
 /**
  * Performs the comparison described by the given input and opens a compare editor on the result.
  *
  * @param input the input on which to open the compare editor
  * @param page the workbench page on which to create a new compare editor
  * @param editor if not null the input is opened in this editor
  * @param activate if <code>true</code> the editor will be activated
  * @see IWorkbenchPage#openEditor(org.eclipse.ui.IEditorInput, String, boolean)
  * @see CompareEditorInput
  */
 public void openCompareEditor(
     final CompareEditorInput input,
     final IWorkbenchPage page,
     final IReusableEditor editor,
     final boolean activate) {
   CompareConfiguration configuration = input.getCompareConfiguration();
   if (configuration != null) {
     IPreferenceStore ps = configuration.getPreferenceStore();
     if (ps != null)
       configuration.setProperty(
           CompareConfiguration.USE_OUTLINE_VIEW,
           Boolean.valueOf(ps.getBoolean(ComparePreferencePage.USE_OUTLINE_VIEW)));
   }
   if (input.canRunAsJob()) {
     openEditorInBackground(input, page, editor, activate);
   } else {
     if (compareResultOK(input, null)) {
       internalOpenEditor(input, page, editor, activate);
     }
   }
 }