当前位置: 首页>>代码示例>>Java>>正文


Java CompareConfiguration.setLeftLabel方法代码示例

本文整理汇总了Java中org.eclipse.compare.CompareConfiguration.setLeftLabel方法的典型用法代码示例。如果您正苦于以下问题:Java CompareConfiguration.setLeftLabel方法的具体用法?Java CompareConfiguration.setLeftLabel怎么用?Java CompareConfiguration.setLeftLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.compare.CompareConfiguration的用法示例。


在下文中一共展示了CompareConfiguration.setLeftLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPreviewer

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
private Control createPreviewer(Composite parent) {
	final CompareConfiguration compareConfiguration = new CompareConfiguration();
	compareConfiguration.setLeftLabel("Original " + docTypeName);
	compareConfiguration.setLeftEditable(false);
	compareConfiguration.setRightLabel("Updated " + docTypeName);
	compareConfiguration.setRightEditable(false);
	compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.FALSE);
	compareConfiguration.setProperty(PREFIX_SUFFIX_PROPERTY, fPrefixSuffix);

	fViewer = new TextMergeViewer(parent, SWT.NONE, compareConfiguration);
	// add initial input in order to avoid problems when disposing the viewer later:
	fViewer.setInput(new DiffNode(new TargetElementFromString(""), new TargetElementFromString("")));

	Control control = fViewer.getControl();
	control.addDisposeListener(new DisposeListener() {
		@Override
		public void widgetDisposed(DisposeEvent e) {
			compareConfiguration.dispose();
		}
	});
	return control;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:23,代码来源:SpecComparePage.java

示例2: initLabels

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
/**
 * initialize the labels : the title, the lft label and the right one
 */
private void initLabels() {
	CompareConfiguration cc = getCompareConfiguration();
	String resourceName = resource.getName();	
	setTitle(Policy.bind("SVNCompareRevisionsInput.compareResourceAndVersions", new Object[] {resourceName})); //$NON-NLS-1$
	cc.setLeftEditable(! readOnly);
	cc.setRightEditable(false);
	
	String leftLabel = Policy.bind("SVNCompareRevisionsInput.workspace", new Object[] {resourceName}); //$NON-NLS-1$
	cc.setLeftLabel(leftLabel);
	String remoteResourceName = null;
	if (remoteResource != null) {
		remoteResourceName = remoteResource.getName();
	} else {
		remoteResourceName = resourceName;
	}
	String rightLabel = Policy.bind("SVNCompareRevisionsInput.repository", new Object[] {remoteResourceName}); //$NON-NLS-1$
	cc.setRightLabel(rightLabel);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:22,代码来源:SVNLocalCompareInput.java

示例3: initLabels

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
private void initLabels() {
	CompareConfiguration cc = getCompareConfiguration();
	cc.setLeftEditable(! readOnly);
	cc.setRightEditable(false);
	String title;
	String leftLabel;
	String rightLabel;
	if (localResourceNodes.length > 1) {
		title = Policy.bind("SVNLocalBaseCompareInput.0") + remoteRevision; //$NON-NLS-1$
		leftLabel = Policy.bind("SVNLocalBaseCompareInput.1"); //$NON-NLS-1$
		rightLabel = remoteRevision.toString();
	} else {
		title = Policy.bind("SVNCompareRevisionsInput.compareResourceAndVersions", new Object[] {localResourceNodes[0].getName()}); //$NON-NLS-1$
		leftLabel = Policy.bind("SVNCompareRevisionsInput.workspace", new Object[] {localResourceNodes[0].getName()}); //$NON-NLS-1$
		rightLabel = Policy.bind("SVNCompareRevisionsInput.repository", new Object[] {localResourceNodes[0].getName()}); //$NON-NLS-1$
	}
	setTitle(title);			
	cc.setLeftLabel(leftLabel);		
	cc.setRightLabel(rightLabel);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:21,代码来源:SVNLocalBaseCompareInput.java

示例4: initLabels

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
/**
 * initialize the labels : the title, the lft label and the right one
 */
private void initLabels() {
	CompareConfiguration cc = getCompareConfiguration();
	cc.setLeftEditable(! readOnly);
	cc.setRightEditable(false);
	String title;
	String leftLabel;
	String rightLabel;
	if (resources.length > 1) {
		title = Policy.bind("SVNLocalBaseCompareInput.0") + remoteRevision; //$NON-NLS-1$
		leftLabel = Policy.bind("SVNLocalBaseCompareInput.1"); //$NON-NLS-1$
		rightLabel = remoteRevision.toString();			
	} else {
		title = Policy.bind("SVNCompareRevisionsInput.compareResourceAndVersions", new Object[] {resources[0].getName()}); //$NON-NLS-1$
		leftLabel = Policy.bind("SVNCompareRevisionsInput.workspace", new Object[] {resources[0].getName()}); //$NON-NLS-1$
		rightLabel = Policy.bind("SVNCompareRevisionsInput.repository", new Object[] {resources[0].getName()}); //$NON-NLS-1$
	}
	setTitle(title);		
	cc.setLeftLabel(leftLabel);
	cc.setRightLabel(rightLabel);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:24,代码来源:SVNLocalCompareSummaryInput.java

示例5: createConfiguration

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
@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;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:11,代码来源:N4IDEXpectCompareEditorInput.java

示例6: createPreviewer

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
private Control createPreviewer(Composite parent) {
	final CompareConfiguration compareConfiguration = new CompareConfiguration();
	compareConfiguration.setLeftLabel("Original package.json");
	compareConfiguration.setLeftEditable(false);
	compareConfiguration.setRightLabel("Merged package.json");
	compareConfiguration.setRightEditable(false);
	compareConfiguration.setProperty(CompareConfiguration.IGNORE_WHITESPACE, Boolean.FALSE);

	fViewer = new TextMergeViewer(parent, SWT.NONE, compareConfiguration);
	// add initial input in order to avoid problems when disposing the viewer later:
	fViewer.setInput(new DiffNode(new DiffElementFromString(""), new DiffElementFromString("")));

	Control control = fViewer.getControl();
	control.addDisposeListener(new DisposeListener() {
		@Override
		public void widgetDisposed(DisposeEvent e) {
			compareConfiguration.dispose();
		}
	});
	return control;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:22,代码来源:PackageJsonComparePage.java

示例7: initLabels

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
private void initLabels() {
	CompareConfiguration cc = getCompareConfiguration();
	setTitle(Policy.bind("PropertyCompareInput.2")); //$NON-NLS-1$
	cc.setLeftEditable(left.isEditable());
	cc.setRightEditable(right.isEditable());
	cc.setLeftLabel(left.getLabel());
	cc.setRightLabel(right.getLabel());
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:9,代码来源:PropertyCompareInput.java

示例8: initLabels

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
private void initLabels() {
	CompareConfiguration cc = getCompareConfiguration();	
	setTitle("Compare <workspace> and versions");
	cc.setLeftEditable(true);
	cc.setRightEditable(false);		
	String leftLabel = "<workspace>";
	cc.setLeftLabel(leftLabel);
	String rightLabel = "Repository";
	cc.setRightLabel(rightLabel);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:11,代码来源:SVNLocalBranchTagCompareInput.java

示例9: initLabels

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
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);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:40,代码来源:SVNFolderCompareEditorInput.java

示例10: initLabels

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
/**
    * initialize the labels : the title, the lft label and the right one
    */
private void initLabels() {
	CompareConfiguration cc = getCompareConfiguration();
	String resourceName = resource.getName();	
	setTitle(Policy.bind("SVNCompareRevisionsInput.compareResourceAndVersions", new Object[] {resourceName})); //$NON-NLS-1$
	cc.setLeftEditable(true);
	cc.setRightEditable(false);
	
	String leftLabel = Policy.bind("SVNCompareRevisionsInput.workspace", new Object[] {resourceName}); //$NON-NLS-1$
	cc.setLeftLabel(leftLabel);
	String rightLabel = Policy.bind("SVNCompareRevisionsInput.repository", new Object[] {resourceName}); //$NON-NLS-1$
	cc.setRightLabel(rightLabel);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:16,代码来源:SVNCompareRevisionsInput.java

示例11: initializeCompareConfiguration

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:17,代码来源:ConflictsCompareInput.java

示例12: prepareInput

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
@Override
   protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
   {
CompareConfiguration cc = getCompareConfiguration();
cc.setRightEditable(false);
cc.setLeftEditable(false);
cc.setLeftLabel("original");
cc.setRightLabel("formatted Text");
 return new DiffNode(left, right);
   }
 
开发者ID:ninneko,项目名称:velocity-edit,代码行数:11,代码来源:VelocityCompare.java

示例13: createNewCompareConfiguration

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
/**
 * 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 = PydevPrefs.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;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:37,代码来源:PyContentMergeViewerCreator.java

示例14: initLabels

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:45,代码来源:SVNCompareEditorInput.java

示例15: initializeCompareConfiguration

import org.eclipse.compare.CompareConfiguration; //导入方法依赖的package包/类
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);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:16,代码来源:MergeConflictsCompareInput.java


注:本文中的org.eclipse.compare.CompareConfiguration.setLeftLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。