CompareDialog(Shell parent, ResourceBundle bundle) { super(parent, bundle); fCompareConfiguration= new CompareConfiguration(); fCompareConfiguration.setLeftEditable(false); fCompareConfiguration.setRightEditable(false); }
CompareDialog(Shell parent, ResourceBundle bundle) { super(parent, bundle); fCompareConfiguration= new CompareConfiguration(); fCompareConfiguration.setLeftEditable(false); fCompareConfiguration.setRightEditable(false); }
CompareDialog(Shell parent, ResourceBundle bundle) { super(parent, bundle); fCompareConfiguration= new CompareConfiguration(); fCompareConfiguration.setLeftEditable(false); fCompareConfiguration.setRightEditable(false); }
private CompareConfiguration getCompareConfiguration() { if (fCompareConfiguration == null) { fCompareConfiguration= new CompareConfiguration(); fCompareConfiguration.setLeftEditable(false); fCompareConfiguration.setRightEditable(false); fCompareConfiguration.setContainer(new CompareContainer() { public void setStatusMessage(String message) { if (statusLabel != null && !statusLabel.isDisposed()) { if (message == null) { statusLabel.setText(""); //$NON-NLS-1$ } else { statusLabel.setText(message); } } } }); } return fCompareConfiguration; }
private CompareConfiguration getCompareConfiguration() { if (fCompareConfiguration == null) { fCompareConfiguration= new CompareConfiguration(); fCompareConfiguration.setLeftEditable(false); fCompareConfiguration.setRightEditable(false); fCompareConfiguration.setContainer(new CompareContainer() { @Override public void setStatusMessage(String message) { if (statusLabel != null && !statusLabel.isDisposed()) { if (message == null) { statusLabel.setText(""); //$NON-NLS-1$ } else { statusLabel.setText(message); } } } }); } return fCompareConfiguration; }
@Override protected ICompareInput prepareCompareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.beginTask(TeamUIMessages.SyncInfoCompareInput_3, 100); monitor.setTaskName(TeamUIMessages.SyncInfoCompareInput_3); getCompareConfiguration().setLeftEditable(isLeftEditable(input)); getCompareConfiguration().setRightEditable(false); try { ISynchronizationCompareInput adapter = asModelCompareInput(input); if (adapter != null) { adapter.prepareInput(getCompareConfiguration(), Policy.subMonitorFor(monitor, 100)); } } catch (CoreException e) { throw new InvocationTargetException(e); } finally { monitor.done(); } return input; }
public ComparePreviewer(Composite parent) { super(parent, SWT.BORDER | SWT.FLAT, true); fCompareConfiguration= new CompareConfiguration(); fCompareConfiguration.setLeftEditable(false); fCompareConfiguration.setLeftLabel(RefactoringUIMessages.ComparePreviewer_original_source); fCompareConfiguration.setRightEditable(false); fCompareConfiguration.setRightLabel(RefactoringUIMessages.ComparePreviewer_refactored_source); addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { if (fImage != null && !fImage.isDisposed()) fImage.dispose(); } }); Dialog.applyDialogFont(this); } public void setLabel(String label) {
protected ICompareInput prepareCompareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ICompareInput input = createCompareInput(); getCompareConfiguration().setLeftEditable(isLeftEditable(input)); getCompareConfiguration().setRightEditable(false); ensureContentsCached(getLeftRevision(), getRightRevision(), monitor); initLabels(input); return input; }
@Override protected ICompareInput prepareCompareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ICompareInput input = createCompareInput(); getCompareConfiguration().setLeftEditable(isLeftEditable(input)); getCompareConfiguration().setRightEditable(false); ensureContentsCached(getLeftRevision(), getRightRevision(), monitor); initLabels(input); return input; }
private void initLabels() { CompareConfiguration cc = getCompareConfiguration(); cc.setLeftEditable(false); cc.setRightEditable(false); cc.setLeftLabel(l.getName()); cc.setLeftImage(l.getImage()); cc.setRightLabel(r.getName()); cc.setRightImage(r.getImage()); }
/** * Method called from {@link #prepareInput(IProgressMonitor)} to obtain the input. Its purpose * is to ensure that the input is an instance of {@link ICompareInput}. * * @param monitor a progress monitor * @return the compare input * @throws InvocationTargetException * @throws InterruptedException */ protected ICompareInput prepareCompareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ICompareInput input = createCompareInput(); getCompareConfiguration().setLeftEditable(isEditable(input.getLeft())); getCompareConfiguration() .setRightEditable(isEditable(input.getRight())); initLabels(); return input; }
@Override protected ICompareInput prepareCompareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ICompareInput input = createCompareInput(); getCompareConfiguration().setLeftEditable(isLeftEditable(input)); getCompareConfiguration().setRightEditable(isRightEditable(input)); ensureContentsCached(getLeftRevision(), getRightRevision(), getAncestorRevision(), monitor); initLabels(input); setTitle(NLS.bind(UIText.GitCompareFileRevisionEditorInput_CompareInputTitle, new String[] { input.getName() })); // The compare editor (Structure Compare) will show the diff filenames // with their project relative path. So, no need to also show directory entries. DiffNode flatDiffNode = new NotifiableDiffNode(null, ancestor != null ? Differencer.CONFLICTING : Differencer.CHANGE, ancestor, left, right); flatDiffView(flatDiffNode, (DiffNode) input); return flatDiffNode; }
private void initLabels() { CompareConfiguration cc = getCompareConfiguration(); // set left editable so that unmatched hunks can be edited cc.setLeftEditable(true); cc.setRightEditable(false); //cc.setProperty(CompareEditor.CONFIRM_SAVE_PROPERTY, new Boolean(false)); cc.setLeftLabel(getCompareConfiguration().getLeftLabel(root)); cc.setLeftImage(getCompareConfiguration().getLeftImage(root)); cc.setRightLabel(getCompareConfiguration().getRightLabel(root)); cc.setRightImage(getCompareConfiguration().getRightImage(root)); }
/** * Show the history for the object in a dialog. The history will only be * shown if an {@link IHistoryPageSource} can be found for the object. * @param shell the parent sell * @param object the object * @return whether the object had an {@link IHistoryPageSource} available or not */ public static boolean showHistoryInDialog(Shell shell, Object object) { IHistoryPageSource pageSource = HistoryPageSource.getHistoryPageSource(object); if (pageSource != null && pageSource.canShowHistoryFor(object)) { CompareConfiguration cc = new CompareConfiguration(); cc.setLeftEditable(isFile(object)); cc.setRightEditable(false); HistoryPageSaveablePart input = new HistoryPageSaveablePart(shell, cc, pageSource, object); try { SaveablePartDialog cd = new SaveablePartDialog(shell, input); cd.setBlockOnOpen(true); cd.open(); } finally { input.dispose(); } return true; } return false; }
private void initLabels() { CompareConfiguration cc = getCompareConfiguration(); // set left editable so that unmatched hunks can be edited cc.setLeftEditable(true); cc.setRightEditable(false); //cc.setProperty(CompareEditor.CONFIRM_SAVE_PROPERTY, Boolean.FALSE); cc.setLeftLabel(getCompareConfiguration().getLeftLabel(root)); cc.setLeftImage(getCompareConfiguration().getLeftImage(root)); cc.setRightLabel(getCompareConfiguration().getRightLabel(root)); cc.setRightImage(getCompareConfiguration().getRightImage(root)); }
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; }
@Override public void run(ISelection selection) { IMember input= getEditionElement(selection); if (input == null) { MessageDialog.openInformation(getShell(), CompareMessages.CompareWithHistory_title, CompareMessages.CompareWithHistory_invalidSelectionMessage); return; } JavaElementHistoryPageSource pageSource = JavaElementHistoryPageSource.getInstance(); final IFile file= pageSource.getFile(input); if (file == null) { MessageDialog.openError(getShell(), CompareMessages.CompareWithHistory_title, CompareMessages.CompareWithHistory_internalErrorMessage); return; } if (USE_MODAL_COMPARE) { CompareConfiguration cc = new CompareConfiguration(); cc.setLeftEditable(false); cc.setRightEditable(false); HistoryPageCompareEditorInput ci = new HistoryPageCompareEditorInput(cc, pageSource, input); ci.setTitle(CompareMessages.JavaCompareWithEditionActionImpl_0); ci.setHelpContextId(IJavaHelpContextIds.COMPARE_ELEMENT_WITH_HISTORY_DIALOG); CompareUI.openCompareDialog(ci); } else { TeamUI.showHistoryFor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), input, pageSource); } } }
public void run(ISelection selection) { IMember input= getEditionElement(selection); if (input == null) { MessageDialog.openInformation(getShell(), CompareMessages.CompareWithHistory_title, CompareMessages.CompareWithHistory_invalidSelectionMessage); return; } JavaElementHistoryPageSource pageSource = JavaElementHistoryPageSource.getInstance(); final IFile file= pageSource.getFile(input); if (file == null) { MessageDialog.openError(getShell(), CompareMessages.CompareWithHistory_title, CompareMessages.CompareWithHistory_internalErrorMessage); return; } if (USE_MODAL_COMPARE) { CompareConfiguration cc = new CompareConfiguration(); cc.setLeftEditable(false); cc.setRightEditable(false); HistoryPageCompareEditorInput ci = new HistoryPageCompareEditorInput(cc, pageSource, input); ci.setTitle(CompareMessages.JavaCompareWithEditionActionImpl_0); ci.setHelpContextId(IJavaHelpContextIds.COMPARE_ELEMENT_WITH_HISTORY_DIALOG); CompareUI.openCompareDialog(ci); } else { TeamUI.showHistoryFor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), input, pageSource); } } }
fCompareConfiguration.setRightEditable(false);
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; }