本文整理汇总了Java中org.eclipse.compare.CompareConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java CompareConfiguration类的具体用法?Java CompareConfiguration怎么用?Java CompareConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CompareConfiguration类属于org.eclipse.compare包,在下文中一共展示了CompareConfiguration类的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;
}
示例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);
}
示例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);
}
示例4: SVNCompareEditorInput
import org.eclipse.compare.CompareConfiguration; //导入依赖的package包/类
/**
* Creates a new SVNCompareEditorInput.
*/
public SVNCompareEditorInput(ResourceEditionNode left, ResourceEditionNode right, ResourceEditionNode ancestor) {
super(new CompareConfiguration());
this.left = left;
this.right = right;
this.ancestor = ancestor;
if (left != null) {
this.leftImage = left.getImage();
if (left.getRemoteResource() instanceof RemoteResource) {
if (((RemoteResource)left.getRemoteResource()).getPegRevision() == null) {
((RemoteResource)left.getRemoteResource()).setPegRevision(SVNRevision.HEAD);
}
}
}
if (right != null) {
this.rightImage = right.getImage();
if (right.getRemoteResource() instanceof RemoteResource) {
if (((RemoteResource)right.getRemoteResource()).getPegRevision() == null) {
((RemoteResource)right.getRemoteResource()).setPegRevision(SVNRevision.HEAD);
}
}
}
if (ancestor != null) {
this.ancestorImage = ancestor.getImage();
}
}
示例5: SVNLocalBranchTagCompareInput
import org.eclipse.compare.CompareConfiguration; //导入依赖的package包/类
public SVNLocalBranchTagCompareInput(ISVNLocalResource[] resources, SVNUrl[] urls, SVNRevision remoteRevision, IWorkbenchPart targetPart) throws SVNException {
super(new CompareConfiguration());
this.resources = resources;
this.urls = urls;
this.remoteRevision = remoteRevision;
this.targetPart = targetPart;
localResourceNodes = new SVNLocalResourceNode[resources.length];
remoteResourceNodes = new ResourceEditionNode[resources.length];
for (int i = 0; i < resources.length; i++) {
localResourceNodes[i] = new SVNLocalResourceNode(resources[i]);
ISVNRemoteResource remoteResource;
if (resources[i] instanceof ISVNLocalFolder) {
remoteResource = new RemoteFolder(resources[i].getRepository(), urls[i], remoteRevision);
} else {
remoteResource = new RemoteFile(resources[i].getRepository(), urls[i], remoteRevision);
}
remoteResourceNodes[i] = new ResourceEditionNode(remoteResource);
remoteResourceNodes[i].setLocalResource(localResourceNodes[i]);
localResourceNodes[i].setRemoteResource(remoteResourceNodes[i]);
}
}
示例6: 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);
}
示例7: PyContentViewer
import org.eclipse.compare.CompareConfiguration; //导入依赖的package包/类
PyContentViewer(Composite parent, CompareConfiguration mp) {
fSourceViewer = new SourceViewer(parent, null, SWT.LEFT_TO_RIGHT | SWT.H_SCROLL | SWT.V_SCROLL);
IPreferenceStore store = PydevPrefs.getChainedPrefStore();
final ColorAndStyleCache c = new ColorAndStyleCache(store);
// Ideally we wouldn't pass null for the grammarVersionProvider... although
// I haven't been able to get to this code at all (is this something still needed?)
// It seems that Eclipse (in 4.5m5 at least) never gets to use the org.eclipse.compare.contentViewers
// as it seems to use what's provided by org.eclipse.compare.contentMergeViewers or the
// editor directly... if that's not the case, first we need to discover how that's still needed.
fSourceViewer.configure(new PyEditConfigurationWithoutEditor(c, store, null));
fSourceViewer.setEditable(false);
parent.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
c.dispose();
}
});
}
示例8: 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;
}
示例9: 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;
}
示例10: editConflictsInternal
import org.eclipse.compare.CompareConfiguration; //导入依赖的package包/类
private void editConflictsInternal()
throws InvocationTargetException, InterruptedException {
CompareConfiguration cc = new CompareConfiguration();
cc.setLeftEditable(true);
mergeConflictsCompareInput = new MergeConflictsCompareInput(cc, conflictDescriptor);
mergeConflictsCompareInput.setMergeResult(mergeResult);
mergeConflictsCompareInput.setResources(conflictOldFile, conflictWorkingFile,
conflictNewFile, mergedFile, fileName);
CompareUI.openCompareEditorOnPage(mergeConflictsCompareInput, getTargetPage());
}
示例11: editConflictsExternal
import org.eclipse.compare.CompareConfiguration; //导入依赖的package包/类
private void editConflictsExternal(String mergeProgramLocation, String mergeProgramParameters) throws CoreException, InvocationTargetException, InterruptedException {
try {
mergeConflictsCompareInput = new MergeConflictsCompareInput(new CompareConfiguration(), conflictDescriptor);
mergeConflictsCompareInput.setMergeResult(mergeResult);
if (mergeProgramLocation.equals("")) { //$NON-NLS-1$
throw new SVNException(Messages.MergeEditConflictsAction_noProgram);
}
File mergeProgramFile = new File(mergeProgramLocation);
if (!mergeProgramFile.exists()) {
throw new SVNException(Messages.MergeEditConflictsAction_programDoesNotExist);
}
Command command = new Command(mergeProgramLocation);
String[] parameters = mergeProgramParameters.split(" "); //$NON-NLS-1$
for (int i = 0; i < parameters.length; i++) {
parameters[i] = replaceParameter(parameters[i], "${theirs}", //$NON-NLS-1$
conflictNewFile.getAbsolutePath());
parameters[i] = replaceParameter(parameters[i], "${yours}", //$NON-NLS-1$
conflictWorkingFile.getAbsolutePath());
parameters[i] = replaceParameter(parameters[i], "${base}", //$NON-NLS-1$
conflictOldFile.getAbsolutePath());
parameters[i] = replaceParameter(parameters[i], "${merged}", //$NON-NLS-1$
mergedFile.getAbsolutePath());
}
command.setParameters(parameters);
command.exec();
command.waitFor();
mergeConflictsCompareInput.handleExternalDispose();
} catch (IOException e) {
throw new SVNException(Messages.MergeEditConflictsAction_0 + e.getMessage(), e);
}
}
示例12: editConflictsInternal
import org.eclipse.compare.CompareConfiguration; //导入依赖的package包/类
/**
* edit the conflicts using built-in merger
*
* @param resource
* @param conflictOldFile
* @param conflictWorkingFile
* @param conflictNewFile
* @throws InvocationTargetException
*/
private void editConflictsInternal(IFile resource, IFile conflictOldFile,
IFile conflictWorkingFile, IFile conflictNewFile)
throws InvocationTargetException, InterruptedException {
CompareConfiguration cc = new CompareConfiguration();
ConflictsCompareInput fInput = new ConflictsCompareInput(cc);
fInput.setResources(conflictOldFile, conflictWorkingFile,
conflictNewFile, (IFile) resource);
CompareUI.openCompareEditorOnPage(fInput, getTargetPage());
}
示例13: editConflictsInternal
import org.eclipse.compare.CompareConfiguration; //导入依赖的package包/类
/**
* edit the conflicts using built-in merger
*
* @param resource
* @param conflictOldFile
* @param conflictWorkingFile
* @param conflictNewFile
* @throws InvocationTargetException
*/
private void editConflictsInternal(IFile resource, IFile conflictOldFile,
IFile conflictWorkingFile, IFile conflictNewFile)
throws InvocationTargetException, InterruptedException {
CompareConfiguration cc = new CompareConfiguration();
final ConflictsCompareInput fInput = new ConflictsCompareInput(cc);
fInput.setResources(conflictOldFile, conflictWorkingFile,
conflictNewFile, (IFile) resource);
getShell().getDisplay().syncExec(new Runnable() {
public void run() {
CompareUI.openCompareEditorOnPage(fInput, getPart().getSite().getPage());
}
});
}
示例14: SVNLocalCompareInput
import org.eclipse.compare.CompareConfiguration; //导入依赖的package包/类
/**
* @throws SVNException
* creates a SVNLocalCompareInput, allows setting whether the current local resource is read only or not.
*/
public SVNLocalCompareInput(ISVNLocalResource resource, SVNRevision revision, boolean readOnly) throws SVNException, SVNClientException {
super(new CompareConfiguration());
this.remoteRevision = revision;
this.readOnly = readOnly;
this.resource = resource;
LocalResourceStatus status = resource.getStatus();
if (status != null && status.isCopied()) {
ISVNClientAdapter svnClient = null;
try {
svnClient = resource.getRepository().getSVNClient();
ISVNInfo info = svnClient.getInfoFromWorkingCopy(resource.getFile());
SVNUrl copiedFromUrl = info.getCopyUrl();
if (copiedFromUrl != null) {
GetRemoteResourceCommand getRemoteResourceCommand = new GetRemoteResourceCommand(resource.getRepository(), copiedFromUrl, SVNRevision.HEAD);
getRemoteResourceCommand.run(null);
this.remoteResource = getRemoteResourceCommand.getRemoteResource();
}
}
finally {
resource.getRepository().returnSVNClient(svnClient);
}
}
// SVNRevision can be any valid revision : BASE, HEAD, number ...
if (this.remoteResource == null) this.remoteResource = resource.getRemoteResource(revision);
// remoteResouce can be null if there is no corresponding remote resource
// (for example no base because resource has just been added)
}
示例15: 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());
}