public static void updateLabels(SyncInfo sync, CompareConfiguration config) { final IResourceVariant remote = sync.getRemote(); final IResourceVariant base = sync.getBase(); String localContentId = sync.getLocalContentIdentifier(); if (localContentId != null) { config.setLeftLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_localLabelExists, new String[] { localContentId })); } else { config.setLeftLabel(TeamUIMessages.SyncInfoCompareInput_localLabel); } if (remote != null) { config.setRightLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_remoteLabelExists, new String[] { remote.getContentIdentifier() })); } else { config.setRightLabel(TeamUIMessages.SyncInfoCompareInput_remoteLabel); } if (base != null) { config.setAncestorLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelExists, new String[] { base.getContentIdentifier() })); } else { config.setAncestorLabel(TeamUIMessages.SyncInfoCompareInput_baseLabel); } }
config.setAncestorLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelAuthorExists, new String[] { baseContentId, baseAuthor })); } else { config.setAncestorLabel(NLS.bind(TeamUIMessages.SyncInfoCompareInput_baseLabelExists, new String[] { baseContentId })); config.setAncestorLabel(TeamUIMessages.SyncInfoCompareInput_baseLabel);
private void initLabels() { CompareConfiguration cc = getCompareConfiguration(); IResource ancestorResource = getResource(fAncestorElement); IResource leftResource = getResource(fLeftElement); IResource rightResource = getResource(fRightElement); if (ancestorResource != null) { String ancestorLabel = ancestorResource.getFullPath() .makeRelative().toString(); cc.setAncestorLabel(ancestorLabel); } if (leftResource != null && rightResource != null) { String leftLabel = leftResource.getFullPath().makeRelative() .toString(); String rightLabel = rightResource.getFullPath().makeRelative() .toString(); cc.setLeftLabel(leftLabel); cc.setRightLabel(rightLabel); } }
config.setAncestorLabel(NLS.bind(LABELPATTERN, ancestorCommit .getShortMessage(), CompareUtils.truncatedRevision(ancestorCommit.name())));
/** * Initializes the images in the compare configuration. */ void initializeCompareConfiguration() { CompareConfiguration cc= getCompareConfiguration(); if (fLeftResource != null) { cc.setLeftLabel(buildLabel(fLeftResource)); cc.setLeftImage(CompareUIPlugin.getImage(fLeftResource)); } if (fRightResource != null) { cc.setRightLabel(buildLabel(fRightResource)); cc.setRightImage(CompareUIPlugin.getImage(fRightResource)); } if (fThreeWay && fAncestorResource != null) { cc.setAncestorLabel(buildLabel(fAncestorResource)); cc.setAncestorImage(CompareUIPlugin.getImage(fAncestorResource)); } }
/** * Initializes the images in the compare configuration. */ void initializeCompareConfiguration() { CompareConfiguration cc= getCompareConfiguration(); if (fLeftResource != null) { cc.setLeftLabel(buildLabel(fLeftResource)); cc.setLeftImage(CompareUIPlugin.getImage(fLeftResource)); } if (fRightResource != null) { cc.setRightLabel(buildLabel(fRightResource)); cc.setRightImage(CompareUIPlugin.getImage(fRightResource)); } if (fThreeWay && fAncestorResource != null) { cc.setAncestorLabel(buildLabel(fAncestorResource)); cc.setAncestorImage(CompareUIPlugin.getImage(fAncestorResource)); } }
private void initLabels(ICompareInput input) { CompareConfiguration cc = getCompareConfiguration(); if (getLeftRevision() != null) { String leftLabel = getFileRevisionLabel(getLeftRevision()); cc.setLeftLabel(leftLabel); } else if (getResource() != null) { String label = NLS.bind(UIText.GitCompareFileRevisionEditorInput_LocalLabel, new Object[]{ input.getLeft().getName() }); cc.setLeftLabel(label); } else { cc.setLeftLabel(left.getName()); } if (getRightRevision() != null) { String rightLabel = getFileRevisionLabel(getRightRevision()); cc.setRightLabel(rightLabel); } else { cc.setRightLabel(right.getName()); } if (getAncestorRevision() != null) { String ancestorLabel = getFileRevisionLabel(getAncestorRevision()); cc.setAncestorLabel(ancestorLabel); } }
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; }
private Control createPreviewer(Composite parent) { fCompareConfiguration.setAncestorLabel(Utilities.getString("ComparePreferencePage.ancestor.label")); //$NON-NLS-1$