Java Code Examples for org.eclipse.compare.structuremergeviewer.DiffNode#getLeft()

The following examples show how to use org.eclipse.compare.structuremergeviewer.DiffNode#getLeft() . 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: SVNLocalCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private static void commit(IProgressMonitor pm, DiffNode node) throws CoreException {
	ITypedElement left= node.getLeft();
	if (left instanceof BufferedResourceNode)
		((BufferedResourceNode) left).commit(pm);
		
	ITypedElement right= node.getRight();
	if (right instanceof BufferedResourceNode)
		((BufferedResourceNode) right).commit(pm);

	IDiffElement[] children= node.getChildren();
	if (children != null) {
		for (int i= 0; i < children.length; i++) {
			IDiffElement element= children[i];
			if (element instanceof DiffNode)
				commit(pm, (DiffNode) element);
		}
	}
}
 
Example 2
Source File: SVNLocalBaseCompareInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private static void commit(IProgressMonitor pm, DiffNode node) throws CoreException {
	ITypedElement left= node.getLeft();
	if (left instanceof BufferedResourceNode)
		((BufferedResourceNode) left).commit(pm);
		
	ITypedElement right= node.getRight();
	if (right instanceof BufferedResourceNode)
		((BufferedResourceNode) right).commit(pm);

	IDiffElement[] children= node.getChildren();
	if (children != null) {
		for (int i= 0; i < children.length; i++) {
			IDiffElement element= children[i];
			if (element instanceof DiffNode)
				commit(pm, (DiffNode) element);
		}
	}
}
 
Example 3
Source File: SVNLocalCompareSummaryInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
private static void commit(IProgressMonitor pm, DiffNode node) throws CoreException {
	ITypedElement left= node.getLeft();
	if (left instanceof BufferedResourceNode)
		((BufferedResourceNode) left).commit(pm);
		
	ITypedElement right= node.getRight();
	if (right instanceof BufferedResourceNode)
		((BufferedResourceNode) right).commit(pm);

	IDiffElement[] children= node.getChildren();
	if (children != null) {
		for (int i= 0; i < children.length; i++) {
			IDiffElement element= children[i];
			if (element instanceof DiffNode)
				commit(pm, (DiffNode) element);
		}
	}
}
 
Example 4
Source File: DiffTreeLabelProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Image getImage(Object element) {
	if (element instanceof DiffNode){
		DiffNode node = ((DiffNode)element);
		if (node.getLeft()!=null){
			return node.getImage();
		} else {
			return node.getAncestor().getImage();
		}
	}
	return null;
}
 
Example 5
Source File: DiffTreeLabelProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public String getText(Object element) {
	if (element instanceof DiffNode){
		DiffNode node = ((DiffNode)element);
		if (node.getLeft()!=null){
			return node.getName();
		} else {
			return node.getAncestor().getName();
		}
	}
	return null;
}
 
Example 6
Source File: DiffTreeLabelProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void update(ViewerCell cell) {
	StyledString styledString = new StyledString();
	
	DiffNode node = (DiffNode)cell.getElement();
	if (node.getLeft()!=null){
		styledString.append(getText(cell.getElement()),boldgreen);
	} else {
		styledString.append(getText(cell.getElement()));
	}
	cell.setText(styledString.getString());
	cell.setImage(getImage(cell.getElement())) ;
	cell.setStyleRanges(styledString.getStyleRanges());
	
}