Java Code Examples for org.eclipse.compare.CompareConfiguration#setAncestorLabel()

The following examples show how to use org.eclipse.compare.CompareConfiguration#setAncestorLabel() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: N4IDEXpectCompareEditorInput.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
@SuppressWarnings("javadoc")
protected static CompareConfiguration createConfiguration(IFile file) {
	CompareConfiguration configuration = new CompareConfiguration();
	configuration.setLeftEditable(true);
	configuration.setLeftLabel("Expected Test Result" + (file != null ? " - " + file.getName() : ""));
	configuration.setRightLabel("Actual Test Result");
	configuration.setAncestorLabel("File on Disk");
	configuration.setProperty(ICompareUIConstants.PROP_ANCESTOR_VISIBLE, Boolean.FALSE);
	return configuration;
}
 
Example 2
Source File: SVNFolderCompareEditorInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private void initLabels() {
	CompareConfiguration cc = getCompareConfiguration();

       ITypedElement left = this.left;
       ITypedElement right = this.right;
       ITypedElement ancestor = this.ancestor;
       
       if (left != null) {
           cc.setLeftLabel(getLabel(left));
           cc.setLeftImage(leftImage);
       }
   
       if (right != null) {
           cc.setRightLabel(getLabel(right));
           cc.setRightImage(rightImage);
       }
       
       if (ancestor != null) {
           cc.setAncestorLabel(getLabel(ancestor));
           cc.setAncestorImage(ancestorImage);
       }
	
	String title;
	if (ancestor != null) {
		title = Policy.bind("SVNCompareEditorInput.titleAncestor", new Object[] {guessResourceName(), getVersionLabel(ancestor), getVersionLabel(left), getVersionLabel(right)} ); //$NON-NLS-1$
	} else {
		String leftName = null;
		if (left != null) leftName = left.getName();
		String rightName = null;
		if (right != null) rightName = right.getName();
		
		if (leftName != null && !leftName.equals(rightName)) {
			title = Policy.bind("SVNCompareEditorInput.titleNoAncestorDifferent", new Object[] {leftName, getVersionLabel(left), rightName, getVersionLabel(right)} );  //$NON-NLS-1$
		} else {
			title = Policy.bind("SVNCompareEditorInput.titleNoAncestor", new Object[] {guessResourceName(), getVersionLabel(left), getVersionLabel(right)} ); //$NON-NLS-1$
		}
	}
	setTitle(title);
}
 
Example 3
Source File: ConflictsCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Initializes the labels in the compare configuration.
 */
private void initializeCompareConfiguration() {
    CompareConfiguration cc = getCompareConfiguration();

    String leftLabel = "Merged - " + fDestinationResource.getName(); //$NON-NLS-1$
    String rightLabel = "Theirs - " + fTheirsResource.getName(); //$NON-NLS-1$
    String ancestorLabel = "Ancestor -" + fAncestorResource.getName(); //$NON-NLS-1$

    cc.setLeftLabel(leftLabel);

    cc.setRightLabel(rightLabel);

    cc.setAncestorLabel(ancestorLabel);
}
 
Example 4
Source File: PyContentMergeViewerCreator.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates a new configuration with the pydev preference store so that the colors appear correctly when using
 * Aptana themes.
 * 
 * Also copies the available data from the original compare configuration to the new configuration.
 */
private CompareConfiguration createNewCompareConfiguration(CompareConfiguration mp) {
    List<IPreferenceStore> stores = PyDevUiPrefs.getDefaultStores(false);
    IPreferenceStore prefs = mp.getPreferenceStore();
    if (prefs != null) {
        //Note, we could use the CompareUIPlugin.getDefault().getPreferenceStore() directly, but it's access
        //is restricted, so, we go to the preferences of the previously created compare configuration.
        stores.add(prefs);
    }

    CompareConfiguration cc = new CompareConfiguration(new ChainedPreferenceStore(
            stores.toArray(new IPreferenceStore[stores.size()])));
    cc.setAncestorImage(mp.getAncestorImage(null));
    cc.setAncestorLabel(mp.getAncestorLabel(null));

    cc.setLeftImage(mp.getLeftImage(null));
    cc.setLeftLabel(mp.getLeftLabel(null));
    cc.setLeftEditable(mp.isLeftEditable());

    cc.setRightImage(mp.getRightImage(null));
    cc.setRightLabel(mp.getRightLabel(null));
    cc.setRightEditable(mp.isRightEditable());

    try {
        cc.setContainer(mp.getContainer());
    } catch (Throwable e) {
        //Ignore: not available in Eclipse 3.2.
    }

    return cc;
}
 
Example 5
Source File: SVNCompareEditorInput.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Sets up the title and pane labels for the comparison view.
 */
private void initLabels() {
	CompareConfiguration cc = getCompareConfiguration();

       ITypedElement left = this.left;
       ITypedElement right = this.right;
       ITypedElement ancestor = this.ancestor;
       
       if (left != null) {
       	leftLabel = getLabel(left);
           cc.setLeftLabel(leftLabel);
           cc.setLeftImage(leftImage);
       }
   
       if (right != null) {
       	rightLabel = getLabel(right);
           cc.setRightLabel(rightLabel);
           cc.setRightImage(rightImage);
       }
       
       if (ancestor != null) {
           cc.setAncestorLabel(getLabel(ancestor));
           cc.setAncestorImage(ancestorImage);
       }
	
	String title;
	if (ancestor != null) {
		title = Policy.bind("SVNCompareEditorInput.titleAncestor", new Object[] {guessResourceName(), getVersionLabel(ancestor), getVersionLabel(left), getVersionLabel(right)} ); //$NON-NLS-1$
	} else {
		String leftName = null;
		if (left != null) leftName = left.getName();
		String rightName = null;
		if (right != null) rightName = right.getName();
		
		if (leftName != null && !leftName.equals(rightName)) {
			title = Policy.bind("SVNCompareEditorInput.titleNoAncestorDifferent", new Object[] {leftName, getVersionLabel(left), rightName, getVersionLabel(right)} );  //$NON-NLS-1$
		} else {
			title = Policy.bind("SVNCompareEditorInput.titleNoAncestor", new Object[] {guessResourceName(), getVersionLabel(left), getVersionLabel(right)} ); //$NON-NLS-1$
		}
	}
	setTitle(title);
}
 
Example 6
Source File: BuiltInConflictsCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 3 votes vote down vote up
private void initializeCompareConfiguration() {
    CompareConfiguration cc = getCompareConfiguration();
    
    cc.setLeftEditable(true);

    String leftLabel = "Merged - " + fileName; //$NON-NLS-1$
    String rightLabel = "Theirs - " + fileName; //$NON-NLS-1$
    String ancestorLabel = "Ancestor -" + fileName; //$NON-NLS-1$

    cc.setLeftLabel(leftLabel);

    cc.setRightLabel(rightLabel);

    cc.setAncestorLabel(ancestorLabel);
}