org.eclipse.compare.CompareConfiguration Java Examples

The following examples show how to use org.eclipse.compare.CompareConfiguration. 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: PyContentViewer.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
PyContentViewer(Composite parent, CompareConfiguration mp) {
    fSourceViewer = new SourceViewer(parent, null, SWT.LEFT_TO_RIGHT | SWT.H_SCROLL | SWT.V_SCROLL);
    IPreferenceStore store = PyDevUiPrefs.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();
        }
    });
}
 
Example #2
Source File: SVNLocalBaseCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
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);
}
 
Example #3
Source File: SVNCompareEditorInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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();
	}
}
 
Example #4
Source File: SVNLocalBranchTagCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
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]);
       }
}
 
Example #5
Source File: ScriptRefactoringAction.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
private BonitaCompareEditorInput createCompareEditorInput() {
    final CompareConfiguration config = new CompareConfiguration();
    config.setRightEditable(true);
    config.setLeftEditable(false);
    config.setLeftLabel(Messages.currentScript);
    config.setRightLabel(Messages.refactoredScript);
    config.setProperty(CompareConfiguration.USE_OUTLINE_VIEW, true);
    String oldNames = "";
    String newNames = "";
    boolean canBeContainedInscript = true;
    for (final RefactorPair<?, ?> pairRefactor : pairsToRefactor) {
        oldNames += oldNames.isEmpty() ? pairRefactor.getOldValueName() : "," + pairRefactor.getOldValueName();
        newNames += newNames.isEmpty() ? pairRefactor.getNewValueName() : "," + pairRefactor.getNewValueName();
        canBeContainedInscript = canBeContainedInscript && pairRefactor.canBeContainedInScript();
    }
    return new BonitaCompareEditorInput(config, scriptExpressions, operationType, oldNames,
            newNames, canBeContainedInscript);
}
 
Example #6
Source File: SVNLocalCompareSummaryInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #7
Source File: SpecComparePage.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
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;
}
 
Example #8
Source File: JavaCompareWithEditionActionImpl.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@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);
	}
}
 
Example #9
Source File: BonitaCompareEditorInput.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public BonitaCompareEditorInput(final CompareConfiguration configuration, final List<ScriptContainer<?>> scripts,
        final RefactoringOperationType operationType,
        final String elementName, final String newName, final boolean canBeContainedInScript) {
    super(configuration);
    this.scripts = scripts;
    this.elementName = elementName;
    this.operationType = operationType;
    this.newName = newName;
    this.canBeContainedInScript = canBeContainedInScript;
}
 
Example #10
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 #11
Source File: DefaultViewerCreator.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Viewer createViewer(Composite parent, CompareConfiguration compareConfiguration) {
	if (compareConfiguration == null) {
		return createContentViever(parent, compareConfiguration);
	}
	return createMergeViewer(parent, compareConfiguration);
}
 
Example #12
Source File: DefaultViewerCreator.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected Viewer createMergeViewer(Composite parent, CompareConfiguration compareConfiguration) {
	compareConfiguration.setProperty(DefaultMergeEditor.PROVIDER, mergeEditorProvider);
	DefaultMergeViewer result = new DefaultMergeViewer(parent, SWT.NULL, compareConfiguration, documentProvider,
			sourceViewerConfigurationProvider) {
		@Override
		public String getTitle() {
			if (compareViewerTitle != null) {
				return compareViewerTitle;
			}
			return super.getTitle();
		}
	};
	result.setXtextDocumentUtil(xtextDocumentUtil);
	return result;
}
 
Example #13
Source File: DefaultMergeViewer.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public DefaultMergeViewer(Composite parent, int styles, CompareConfiguration compareConfiguration,
		StreamContentDocumentProvider documentProvider,
		Provider<XtextSourceViewerConfiguration> sourceViewerConfigurationProvider) {
	super(parent, styles | SWT.LEFT_TO_RIGHT, compareConfiguration);
	this.documentProvider = documentProvider;
	this.sourceViewerConfigurationProvider = sourceViewerConfigurationProvider;
}
 
Example #14
Source File: EditConflictsAction.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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());
}
 
Example #15
Source File: EditConflictsSynchronizeOperation.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
   * 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());
	}
});        
  }
 
Example #16
Source File: SVNLocalCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @throws SVNException
 * creates a SVNCompareRevisionsInput  
 */
public SVNLocalCompareInput(ISVNLocalResource resource, ISVNRemoteResource remoteResource, SVNRevision pegRevision) throws SVNException {
	super(new CompareConfiguration());
	this.resource = resource;
	this.remoteResource = remoteResource;
       this.remoteRevision = remoteResource.getRevision();
       this.pegRevision = pegRevision;
}
 
Example #17
Source File: SVNLocalBaseCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public SVNLocalBaseCompareInput(ISVNLocalResource[] resources, SVNRevision revision, boolean readOnly) throws SVNException, SVNClientException {
	super(new CompareConfiguration());
       this.remoteRevision = revision;
       this.readOnly = readOnly;
       
       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 = null;
       	LocalResourceStatus status = resources[i].getStatus();
           if (status != null && status.isCopied()) {
           	ISVNClientAdapter svnClient = null;
           	try {
            	svnClient = resources[i].getRepository().getSVNClient();
            	ISVNInfo info = svnClient.getInfoFromWorkingCopy(resources[i].getFile());
            	SVNUrl copiedFromUrl = info.getCopyUrl();
            	if (copiedFromUrl != null) {
            		GetRemoteResourceCommand getRemoteResourceCommand = new GetRemoteResourceCommand(resources[i].getRepository(), copiedFromUrl, SVNRevision.HEAD);
            		getRemoteResourceCommand.run(null);
            		remoteResource = getRemoteResourceCommand.getRemoteResource();
            	}
           	}
           	finally {
           		resources[i].getRepository().returnSVNClient(svnClient);
           	}
           }
           if (remoteResource == null) remoteResource = resources[i].getRemoteResource(revision);
           remoteResourceNodes[i] = new ResourceEditionNode(remoteResource);
           remoteResourceNodes[i].setLocalResource(localResourceNodes[i]);
           localResourceNodes[i].setRemoteResource(remoteResourceNodes[i]);
       }
}
 
Example #18
Source File: AbapGitCompareInput.java    From ADT_Frontend with MIT License 5 votes vote down vote up
@Override
protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
	CompareConfiguration configuration = getCompareConfiguration();
	configuration.setLeftLabel(this.left.getName());
	configuration.setRightLabel(this.right.getName());
	return new DiffNode(null, Differencer.CHANGE, null, this.left, this.right);
}
 
Example #19
Source File: PropertyCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
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());
}
 
Example #20
Source File: BuiltInEditConflictsAction.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private void editConflictsExternal(String mergeProgramLocation, String mergeProgramParameters) throws CoreException, InvocationTargetException, InterruptedException {
    try {
    	builtInConflictsCompareInput = new BuiltInConflictsCompareInput(new CompareConfiguration(), conflictDescriptor);
    	
        if (mergeProgramLocation.equals("")) { //$NON-NLS-1$
            throw new SVNException(Messages.BuiltInEditConflictsAction_0);
        }
        File mergeProgramFile = new File(mergeProgramLocation);
        if (!mergeProgramFile.exists()) {
            throw new SVNException(Messages.BuiltInEditConflictsAction_1);
        }

        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();
        builtInConflictsCompareInput.handleExternalDispose();
    } catch (IOException e) {
    	throw new SVNException(Messages.BuiltInEditConflictsAction_2 + e.getMessage(), e);
    }
}
 
Example #21
Source File: SVNLocalBranchTagCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #22
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 #23
Source File: SVNFolderCompareEditorInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public SVNFolderCompareEditorInput(ISVNRemoteFolder folder1, SVNRevision pegRevision1, ISVNRemoteFolder folder2, SVNRevision pegRevision2) {
	super(new CompareConfiguration());
	this.folder1 = folder1;
	this.folder2 = folder2;
	left = new SummaryEditionNode(folder1, pegRevision1);
	left.setRootFolder((RemoteFolder)folder1);
	left.setNodeType(SummaryEditionNode.LEFT);
	right = new SummaryEditionNode(folder2, pegRevision2);
	right.setRootFolder((RemoteFolder)folder2);
	right.setNodeType(SummaryEditionNode.RIGHT);
}
 
Example #24
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 #25
Source File: SVNCompareRevisionsInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
    * creates a SVNCompareRevisionsInput  
    */
public SVNCompareRevisionsInput(IFile resource, ILogEntry[] logEntries) {
	super(new CompareConfiguration());
	this.resource = resource;
	this.logEntries = logEntries;
	updateCurrentEdition();
	initializeActions();
}
 
Example #26
Source File: SVNCompareRevisionsInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
    * 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);
}
 
Example #27
Source File: SVNLocalCompareSummaryInput.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public SVNLocalCompareSummaryInput(ISVNLocalResource[] resources, SVNRevision remoteRevision) throws SVNException {
	super(new CompareConfiguration());
	this.resources = resources;
	this.remoteRevision = remoteRevision;
	remoteFolders = new RemoteFolder[resources.length];
	for (int i = 0; i < resources.length; i++) {
		remoteFolders[i] = new RemoteFolder(resources[i].getRepository(), resources[i].getUrl(), remoteRevision);
	}
}
 
Example #28
Source File: JavaStructureDiffViewer.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public ChangePropertyAction(ResourceBundle bundle, CompareConfiguration cc, String rkey, String pkey) {
	fPropertyKey= pkey;
	fBundle= bundle;
	fPrefix= rkey;
	JavaCompareUtilities.initAction(this, fBundle, fPrefix);
	setCompareConfiguration(cc);
}
 
Example #29
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 #30
Source File: BuiltInEditConflictsAction.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private void editConflictsInternal()
        throws InvocationTargetException, InterruptedException {
    CompareConfiguration cc = new CompareConfiguration();
    cc.setLeftEditable(true);
    builtInConflictsCompareInput = new BuiltInConflictsCompareInput(cc, conflictDescriptor);
    builtInConflictsCompareInput.setResources(conflictOldFile, conflictWorkingFile,
            conflictNewFile, mergedFile, fileName);
    CompareUI.openCompareEditorOnPage(builtInConflictsCompareInput, getTargetPage());
}