@Override public void setInput(Object input) { if (input instanceof ICompareInput) { IJavaProject project= getJavaProject((ICompareInput)input); if (project != null) { setPreferenceStore(createChainedPreferenceStore(project)); } } super.setInput(input); }
@Override public void setInput(Object input) { if (input instanceof ICompareInput) { IJavaProject project= getJavaProject((ICompareInput)input); if (project != null) { setPreferenceStore(createChainedPreferenceStore(project)); } } super.setInput(input); }
public void setInput(Object input) { if (input instanceof ICompareInput) { IJavaProject project= getJavaProject((ICompareInput)input); if (project != null) { setPreferenceStore(createChainedPreferenceStore(project)); if (fSourceViewer != null) { Iterator iterator= fSourceViewer.iterator(); while (iterator.hasNext()) { SourceViewer sourceViewer= (SourceViewer) iterator.next(); sourceViewer.unconfigure(); sourceViewer.configure(getSourceViewerConfiguration()); } } } } super.setInput(input); }
private Control createPreviewer(Composite parent) { final CompareConfiguration compareConfiguration = new CompareConfiguration(); compareConfiguration.setLeftLabel(ResourceUtil.getString("CompareResultDialog.expectedLabel")); //$NON-NLS-1$ compareConfiguration.setLeftEditable(false); compareConfiguration.setRightLabel(ResourceUtil.getString("CompareResultDialog.actualLabel")); //$NON-NLS-1$ compareConfiguration.setRightEditable(false); compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.FALSE); fViewer = new CompareResultMergeViewer(parent, SWT.NONE, compareConfiguration); fViewer.setInput(new DiffNode(new CompareElement(fExpected), new CompareElement(fActual))); Control control = fViewer.getControl(); control.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if(compareConfiguration != null) { compareConfiguration.dispose(); } } }); return control; }
fPreviewViewer.setInput( new DiffNode(Differencer.CONFLICTING, new FakeInput("ComparePreferencePage.previewAncestor"), //$NON-NLS-1$
private Control createPreviewer(Composite parent) { fCompareConfiguration= new CompareConfiguration(fOverlayStore); fCompareConfiguration.setAncestorLabel(Utilities.getString("ComparePreferencePage.ancestor.label")); //$NON-NLS-1$ fCompareConfiguration.setLeftLabel(Utilities.getString("ComparePreferencePage.left.label")); //$NON-NLS-1$ fCompareConfiguration.setLeftEditable(false); fCompareConfiguration.setRightLabel(Utilities.getString("ComparePreferencePage.right.label")); //$NON-NLS-1$ fCompareConfiguration.setRightEditable(false); TextMergeViewer fPreviewViewer= new TextMergeViewer(parent, SWT.BORDER, fCompareConfiguration); fPreviewViewer.setInput( new DiffNode(Differencer.CONFLICTING, new FakeInput("ComparePreferencePage.previewAncestor"), //$NON-NLS-1$ new FakeInput("ComparePreferencePage.previewLeft"), //$NON-NLS-1$ new FakeInput("ComparePreferencePage.previewRight") //$NON-NLS-1$ ) ); Control c= fPreviewViewer.getControl(); c.addDisposeListener(e -> { if (fCompareConfiguration != null) fCompareConfiguration.dispose(); }); return c; }