/******************************* Copyright notice ******************************* Copyright (C)2002 by Andrei Loskutov <loskutov@gmx.de>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ********************************************************************************/ package adiag.connection.eclipse; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import org.eclipse.compare.BufferedContent; import org.eclipse.compare.CompareUI; import org.eclipse.compare.ITypedElement; import org.eclipse.compare.structuremergeviewer.IStructureComparator; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Status; import org.eclipse.swt.graphics.Image; /** * @author Andy the Great * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ public class TypedElement extends BufferedContent implements ITypedElement, IStructureComparator { private String name; private String type; /** * Constructor for TypedElement. */ public TypedElement() { super(); } /** * Constructor for TypedElement. */ public TypedElement(String name, String type) { this(); this.name = name; this.type = type; } /* (non-Javadoc) * @see org.eclipse.compare.ITypedElement#getName() */ public String getName() { return name; } /* (non-Javadoc) * @see org.eclipse.compare.ITypedElement#getImage() */ public Image getImage() { return CompareUI.getImage(getType()); } /* (non-Javadoc) * @see org.eclipse.compare.ITypedElement#getType() */ public String getType() { return type; } /* (non-Javadoc) * @see org.eclipse.compare.structuremergeviewer.IStructureComparator#getChildren() */ public Object[] getChildren() { return new TypedElement[0]; } /* (non-Javadoc) * @see org.eclipse.compare.BufferedContent#createStream() */ protected InputStream createStream() throws CoreException { FileInputStream fis = null; try { fis = new FileInputStream(getName());; } catch (IOException e) { throw new CoreException(new Status(Status.ERROR, "de.loskutov.eclipse.bvwrapper", 0, "Cannot create stream for diff operation", e)); } return fis; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 2735 | andrei_loskutov | sources are now included to binary distribution at http://andrei.gmxhome.de/perforce/index.html | ||
#1 | 2554 | andrei_loskutov |
#25.12.2002 23:29 Revision 1.3.0.4 beta 1) Some small refactoring 2) First integration with P4eclipse: properties etc, thanks Boris Pr�ssmann 5) Better integration to Eclipse: use Eclipse internal compare tool for diff. 6) Fix some minor bugs. #14.12.2002 23:15 Revision 1.3.0.3 beta 1) Fix endless loop bug if p4 path was not set. 2) Fix never getting focus bug after error message shown 3) Fix painting bug on JDK 1.4.1 (must be verified!!!) 4) Some small refactoring 5) Fix error handling. 6) Fix some minor bugs. |