You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(80) |
Oct
(12) |
Nov
(237) |
Dec
(210) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(344) |
Feb
(311) |
Mar
(239) |
Apr
(72) |
May
(8) |
Jun
|
Jul
(73) |
Aug
(88) |
Sep
(235) |
Oct
(111) |
Nov
(325) |
Dec
(220) |
| 2006 |
Jan
(108) |
Feb
(64) |
Mar
(381) |
Apr
(98) |
May
(38) |
Jun
(16) |
Jul
(34) |
Aug
(70) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2007 |
Jan
(22) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(12) |
| 2010 |
Jan
(49) |
Feb
(9) |
Mar
(2) |
Apr
(17) |
May
(10) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Matthias K <mat...@us...> - 2006-03-25 12:14:26
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.compare/src/org In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3700/matthias_kue/org.jcommander.compare/src/org Log Message: Directory /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.compare/src/org added to the repository |
|
From: Matthias K <mat...@us...> - 2006-03-25 12:14:26
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.compare/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3700/matthias_kue/org.jcommander.compare/META-INF Log Message: Directory /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.compare/META-INF added to the repository |
|
From: Edgar <edg...@us...> - 2006-03-23 02:55:38
|
Update of /cvsroot/jcommander/plugins/org.jcommander.ui.filepanel/src/org/jcommander/ui/filepanel/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24322/src/org/jcommander/ui/filepanel/model Modified Files: FileControlModel.java Log Message: bug 1455252 Index: FileControlModel.java =================================================================== RCS file: /cvsroot/jcommander/plugins/org.jcommander.ui.filepanel/src/org/jcommander/ui/filepanel/model/FileControlModel.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** FileControlModel.java 20 Mar 2006 12:12:29 -0000 1.54 --- FileControlModel.java 23 Mar 2006 02:55:32 -0000 1.55 *************** *** 563,567 **** control.getSorted(sortedDetails, control.getComparator()); //if there is no file highlighted, set it to be the first item ! if(getHighlightedFile() == null) { setHighlightedFile(sortedDetails[0].getFile()); Color back = FileTableControl.HIGHLIGHT_BACKGROUND_COLOR; --- 563,567 ---- control.getSorted(sortedDetails, control.getComparator()); //if there is no file highlighted, set it to be the first item ! if(getHighlightedFile() == null && sortedDetails.length>0) { setHighlightedFile(sortedDetails[0].getFile()); Color back = FileTableControl.HIGHLIGHT_BACKGROUND_COLOR; |
|
From: Matthias K <mat...@us...> - 2006-03-22 22:54:14
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/compare/internal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32597/compare/org/eclipse/compare/internal Modified Files: CompareUIPlugin.java Log Message: Fixed not finding viewers: corrected Extensionpoints to org.jcommander.eclipsepatch.<...> Index: CompareUIPlugin.java =================================================================== RCS file: /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompareUIPlugin.java 21 Mar 2006 22:19:29 -0000 1.1 --- CompareUIPlugin.java 22 Mar 2006 22:54:09 -0000 1.2 *************** *** 140,144 **** private static boolean NORMALIZE_CASE= true; ! public static final String PLUGIN_ID= "org.eclipse.compare"; //$NON-NLS-1$ private static final String BINARY_TYPE= "binary"; //$NON-NLS-1$ --- 140,145 ---- private static boolean NORMALIZE_CASE= true; ! // TODO!!! This is changed from the original plug in ! public static final String PLUGIN_ID= "org.jcommander.eclipsepatch.compare"; //$NON-NLS-1$ private static final String BINARY_TYPE= "binary"; //$NON-NLS-1$ |
|
From: Matthias K <mat...@us...> - 2006-03-22 22:54:14
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32597 Modified Files: plugin.xml Log Message: Fixed not finding viewers: corrected Extensionpoints to org.jcommander.eclipsepatch.<...> Index: plugin.xml =================================================================== RCS file: /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/plugin.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** plugin.xml 21 Mar 2006 22:19:29 -0000 1.1 --- plugin.xml 22 Mar 2006 22:54:09 -0000 1.2 *************** *** 268,272 **** <extension ! point="org.eclipse.compare.streamMergers"> <streamMerger extensions="txt" --- 268,272 ---- <extension ! point="org.jcommander.eclipsepatch.compare.streamMergers"> <streamMerger extensions="txt" *************** *** 281,285 **** <extension ! point="org.eclipse.compare.structureCreators"> <structureCreator extensions="zip" --- 281,285 ---- <extension ! point="org.jcommander.eclipsepatch.compare.structureCreators"> <structureCreator extensions="zip" *************** *** 290,294 **** <extension ! point="org.eclipse.compare.contentMergeViewers"> <viewer extensions="class,exe,dll,binary,zip,jar" --- 290,294 ---- <extension ! point="org.jcommander.eclipsepatch.compare.contentMergeViewers"> <viewer extensions="class,exe,dll,binary,zip,jar" *************** *** 313,317 **** <extension ! point="org.eclipse.compare.contentViewers"> <viewer extensions="txt" --- 313,317 ---- <extension ! point="org.jcommander.eclipsepatch.compare.contentViewers"> <viewer extensions="txt" |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:41
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/ui/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/ui/model Added Files: WorkbenchContentProvider.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: WorkbenchContentProvider.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui.model; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceChangeEvent; import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.resources.IWorkspace; import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.widgets.Control; /** * Tree content provider for resource objects that can be adapted to the * interface {@link org.eclipse.ui.model.IWorkbenchAdapter IWorkbenchAdapter}. * This provider will listen for resource changes within the workspace and * update the viewer as necessary. * <p> * This class may be instantiated, or subclassed by clients. * </p> */ public class WorkbenchContentProvider extends BaseWorkbenchContentProvider implements IResourceChangeListener { private Viewer viewer; /** * Creates the resource content provider. */ public WorkbenchContentProvider() { super(); } /* * (non-Javadoc) Method declared on IContentProvider. */ public void dispose() { if (viewer != null) { IWorkspace workspace = null; Object obj = viewer.getInput(); if (obj instanceof IWorkspace) { workspace = (IWorkspace) obj; } else if (obj instanceof IContainer) { workspace = ((IContainer) obj).getWorkspace(); } if (workspace != null) { workspace.removeResourceChangeListener(this); } } super.dispose(); } /* * (non-Javadoc) Method declared on IContentProvider. */ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { super.inputChanged(viewer, oldInput, newInput); this.viewer = viewer; IWorkspace oldWorkspace = null; IWorkspace newWorkspace = null; if (oldInput instanceof IWorkspace) { oldWorkspace = (IWorkspace) oldInput; } else if (oldInput instanceof IContainer) { oldWorkspace = ((IContainer) oldInput).getWorkspace(); } if (newInput instanceof IWorkspace) { newWorkspace = (IWorkspace) newInput; } else if (newInput instanceof IContainer) { newWorkspace = ((IContainer) newInput).getWorkspace(); } if (oldWorkspace != newWorkspace) { if (oldWorkspace != null) { oldWorkspace.removeResourceChangeListener(this); } if (newWorkspace != null) { newWorkspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); } } } /* * (non-Javadoc) Method declared on IResourceChangeListener. */ public final void resourceChanged(final IResourceChangeEvent event) { processDelta(event.getDelta()); } /** * Process the resource delta. * * @param delta */ protected void processDelta(IResourceDelta delta) { Control ctrl = viewer.getControl(); if (ctrl == null || ctrl.isDisposed()) return; final Collection runnables = new ArrayList(); processDelta(delta, runnables); if (runnables.isEmpty()) return; //Are we in the UIThread? If so spin it until we are done if (ctrl.getDisplay().getThread() == Thread.currentThread()) { runUpdates(runnables); } else { ctrl.getDisplay().asyncExec(new Runnable(){ /* (non-Javadoc) * @see java.lang.Runnable#run() */ public void run() { //Abort if this happens after disposes Control ctrl = viewer.getControl(); if (ctrl == null || ctrl.isDisposed()) return; runUpdates(runnables); } }); } } /** * Run all of the runnables that are the widget updates * @param runnables */ private void runUpdates(Collection runnables) { Iterator runnableIterator = runnables.iterator(); while(runnableIterator.hasNext()){ ((Runnable)runnableIterator.next()).run(); } } /** * Process a resource delta. Add any runnables */ private void processDelta(IResourceDelta delta, Collection runnables) { //he widget may have been destroyed // by the time this is run. Check for this and do nothing if so. Control ctrl = viewer.getControl(); if (ctrl == null || ctrl.isDisposed()) return; // Get the affected resource final IResource resource = delta.getResource(); // If any children have changed type, just do a full refresh of this // parent, // since a simple update on such children won't work, // and trying to map the change to a remove and add is too dicey. // The case is: folder A renamed to existing file B, answering yes to // overwrite B. IResourceDelta[] affectedChildren = delta .getAffectedChildren(IResourceDelta.CHANGED); for (int i = 0; i < affectedChildren.length; i++) { if ((affectedChildren[i].getFlags() & IResourceDelta.TYPE) != 0) { runnables.add(getRefreshRunnable(resource)); return; } } // Opening a project just affects icon, but we need to refresh when // a project is closed because if child items have not yet been created // in the tree we still need to update the item's children int changeFlags = delta.getFlags(); if ((changeFlags & IResourceDelta.OPEN) != 0) { if (resource.isAccessible()) { runnables.add(getUpdateRunnable(resource)); } else { runnables.add(getRefreshRunnable(resource)); return; } } // Check the flags for changes the Navigator cares about. // See ResourceLabelProvider for the aspects it cares about. // Notice we don't care about F_CONTENT or F_MARKERS currently. if ((changeFlags & (IResourceDelta.SYNC | IResourceDelta.TYPE | IResourceDelta.DESCRIPTION)) != 0) { runnables.add(getUpdateRunnable(resource)); } // Replacing a resource may affect its label and its children if ((changeFlags & IResourceDelta.REPLACED) != 0) { runnables.add(getRefreshRunnable(resource)); return; } // Handle changed children . for (int i = 0; i < affectedChildren.length; i++) { processDelta(affectedChildren[i], runnables); } // @issue several problems here: // - should process removals before additions, to avoid multiple equal // elements in viewer // - Kim: processing removals before additions was the indirect cause of // 44081 and its varients // - Nick: no delta should have an add and a remove on the same element, // so processing adds first is probably OK // - using setRedraw will cause extra flashiness // - setRedraw is used even for simple changes // - to avoid seeing a rename in two stages, should turn redraw on/off // around combined removal and addition // - Kim: done, and only in the case of a rename (both remove and add // changes in one delta). IResourceDelta[] addedChildren = delta .getAffectedChildren(IResourceDelta.ADDED); IResourceDelta[] removedChildren = delta .getAffectedChildren(IResourceDelta.REMOVED); if (addedChildren.length == 0 && removedChildren.length == 0) return; final Object[] addedObjects; final Object[] removedObjects; // Process additions before removals as to not cause selection // preservation prior to new objects being added // Handle added children. Issue one update for all insertions. int numMovedFrom = 0; int numMovedTo = 0; if (addedChildren.length > 0) { addedObjects = new Object[addedChildren.length]; for (int i = 0; i < addedChildren.length; i++) { addedObjects[i] = addedChildren[i].getResource(); if ((addedChildren[i].getFlags() & IResourceDelta.MOVED_FROM) != 0) { ++numMovedFrom; } } } else addedObjects = new Object[0]; // Handle removed children. Issue one update for all removals. if (removedChildren.length > 0) { removedObjects = new Object[removedChildren.length]; for (int i = 0; i < removedChildren.length; i++) { removedObjects[i] = removedChildren[i].getResource(); if ((removedChildren[i].getFlags() & IResourceDelta.MOVED_TO) != 0) { ++numMovedTo; } } } else { removedObjects = new Object[0]; } // heuristic test for items moving within same folder (i.e. renames) final boolean hasRename = numMovedFrom > 0 && numMovedTo > 0; Runnable addAndRemove = new Runnable(){ public void run() { if (viewer instanceof AbstractTreeViewer) { AbstractTreeViewer treeViewer = (AbstractTreeViewer) viewer; // Disable redraw until the operation is finished so we don't // get a flash of both the new and old item (in the case of // rename) // Only do this if we're both adding and removing files (the // rename case) if (hasRename) { treeViewer.getControl().setRedraw(false); } try { if (addedObjects.length > 0) treeViewer.add(resource, addedObjects); if (removedObjects.length > 0) treeViewer.remove(removedObjects); } finally { if (hasRename) { treeViewer.getControl().setRedraw(true); } } } else { ((StructuredViewer) viewer).refresh(resource); } } }; runnables.add(addAndRemove); } /** * Return a runnable for refreshing a resource. * @param resource * @return Runnable */ private Runnable getRefreshRunnable(final IResource resource) { return new Runnable(){ public void run() { ((StructuredViewer) viewer).refresh(resource); } }; } /** * Return a runnable for refreshing a resource. * @param resource * @return Runnable */ private Runnable getUpdateRunnable(final IResource resource) { return new Runnable(){ public void run() { ((StructuredViewer) viewer).update(resource, null); } }; } } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:41
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/compare/patch In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/compare/patch Added Files: WorkspacePatcherUI.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: WorkspacePatcherUI.java --- package org.eclipse.compare.patch; import org.eclipse.compare.internal.patch.WorkspacePatcher; import org.eclipse.core.resources.IProject; public class WorkspacePatcherUI { /** * Returns a string that must be the first line of a workspace patch (a multi-project patch * that is understood by the Apply Patch wizard). Each project to be included in the patch * must be prefixed by the line obtained from the <code>getWorkspacePatchProjectHeader()</code>. * This snippet outlines how the a workspace patch is to be created: * <pre> * //Write out workspace patch header * stream.println(CompareUI.getWorkspacePatchHeader()); * for (int i=0; i<projects.length; i++){ * //Write out project header * stream.println(CompareUI.getWorkspacePatchProjectHeader(projects[i]); * //Write out patches in Unified Diff format * } * </pre> * @return String * @see WorkspacePatcherUI#getWorkspacePatchProjectHeader(IProject) * @since 3.2 */ public static String getWorkspacePatchHeader() { return WorkspacePatcher.MULTIPROJECTPATCH_HEADER+" "+WorkspacePatcher.MULTIPROJECTPATCH_VERSION; //$NON-NLS-1$ } /** * Returns the project header that must appear before any patches that apply to that * project. All patches that are encountered after this header and before the next header * are understood to belong the the project. * @param project project to be patched * @return String * @see WorkspacePatcherUI#getWorkspacePatchHeader() * @since 3.2 */ public static String getWorkspacePatchProjectHeader(IProject project) { return WorkspacePatcher.MULTIPROJECTPATCH_PROJECT+" "+ project.getName(); //$NON-NLS-1$ } } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:41
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/ui Added Files: IFileEditorInput.java IStorageEditorInput.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: IStorageEditorInput.java --- package org.eclipse.ui; import org.eclipse.core.resources.IStorage; import org.eclipse.core.runtime.CoreException; /** * Interface for a <code>IStorage</code> input to an editor. * <p> * Clients implementing this editor input interface should override * <code>Object.equals(Object)</code> to answer true for two inputs * that are the same. The <code>IWorbenchPage.openEditor</code> APIs * are dependent on this to find an editor with the same input. * </p><p> * Clients should implement this interface to declare new types of * <code>IStorage</code> editor inputs. * </p><p> * File-oriented editors should support this as a valid input type, and display * its content for viewing (but not allow modification). * Within the editor, the "save" and "save as" operations should create a new * file resource within the workspace. * </p><p> * All editor inputs must implement the <code>IAdaptable</code> interface; * extensions are managed by the platform's adapter manager. * </p> */ public interface IStorageEditorInput extends IEditorInput { /** * Returns the underlying IStorage object. * * @return an IStorage object. * @exception CoreException if this method fails */ public IStorage getStorage() throws CoreException; } --- NEW FILE: IFileEditorInput.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui; import org.eclipse.core.resources.IFile; /** * This interface defines a file-oriented input to an editor. * <p> * Clients implementing this editor input interface should override * <code>Object.equals(Object)</code> to answer true for two inputs * that are the same. The <code>IWorbenchPage.openEditor</code> APIs * are dependent on this to find an editor with the same input. * </p><p> * File-oriented editors should support this as a valid input type, and allow * full read-write editing of its content. * </p><p> * A default implementation of this interface is provided by * org.eclipse.ui.part.FileEditorInput. * </p><p> * All editor inputs must implement the <code>IAdaptable</code> interface; * extensions are managed by the platform's adapter manager. * </p> * * @see org.eclipse.core.resources.IFile */ public interface IFileEditorInput extends IStorageEditorInput { /** * Returns the file resource underlying this editor input. * <p> * The <code>IFile</code> returned can be a handle to a resource * that does not exist in the workspace. As such, an editor should * provide appropriate feedback to the user instead of simply failing * during input validation. For example, a text editor could open * in read-only mode with a message in the text area to inform the * user that the file does not exist. * </p> * * @return the underlying file */ public IFile getFile(); } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:41
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/ui/views/contentoutline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/ui/views/contentoutline Added Files: IContentOutlinePage.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: IContentOutlinePage.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui.views.contentoutline; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.ui.part.IPage; /** * Marker-style interface for a content outline page. This interface defines * the minimum requirement for pages within the content outline view, namely * they must be pages (implement <code>IPage</code>) and provide selections * (implement <code>ISelectionProvider</code>). * <p> * Access to a content outline page begins when an editor is activated. When * activation occurs, the content outline view will ask the editor for its * content outline page. This is done by invoking * <code>getAdapter(IContentOutlinePage.class)</code> on the editor. * If the editor returns a page, the view then creates the controls for that * page (using <code>createControl</code>) and makes the page visible. * </p> * <p> * Clients may implement this interface from scratch, or subclass the * abstract base class <code>ContentOutlinePage</code>. * </p> * <p> * Note that this interface extends <code>ISelectionProvider</code>. * This is no longer required in the case of implementors who also * implement <code>IPageBookViewPage</code> (or extend <code>Page</code>) * as they are now passed an <code>IPageSite</code> during their initialization * and this site can be configured with a selection provider. * However to avoid a breaking change * 1) this interface will continue to extend ISelectionProvider * 2) if an IContentOutlinePage does not set a selection provider for its * site, the ContentOutline will continue to use the page itself for * this purpose. * </p> * * @see ContentOutlinePage */ public interface IContentOutlinePage extends IPage, ISelectionProvider { } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:40
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/ui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/ui/actions Added Files: WorkspaceModifyOperation.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: WorkspaceModifyOperation.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui.actions; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.IThreadListener; //import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; /** * An operation which potentially makes changes to the workspace. All resource * modification should be performed using this operation. The primary * consequence of using this operation is that events which typically occur as a * result of workspace changes (such as the firing of resource deltas, * performance of autobuilds, etc.) are deferred until the outermost operation * has successfully completed. * <p> * If a scheduling rule is provided, the operation will obtain that scheduling * rule for the duration of its <code>execute</code> method. If no scheduling * rule is provided, the operation will obtain a scheduling rule that locks * the entire workspace for the duration of the operation. * </p> * <p> * Subclasses must implement <code>execute</code> to do the work of the * operation. * </p> * @see ISchedulingRule * @see org.eclipse.core.resources.IWorkspace#run(IWorkspaceRunnable, IProgressMonitor) * */ public abstract class WorkspaceModifyOperation implements IRunnableWithProgress, IThreadListener { private ISchedulingRule rule; /** * Creates a new operation. */ protected WorkspaceModifyOperation() { this(ResourcesPlugin.getWorkspace().getRoot()); } /** * Creates a new operation that will run using the provided * scheduling rule. * @param rule The ISchedulingRule to use or <code>null</code>. * @since 3.0 */ protected WorkspaceModifyOperation(ISchedulingRule rule) { this.rule = rule; } /** * Performs the steps that are to be treated as a single logical workspace * change. * <p> * Subclasses must implement this method. * </p> * * @param monitor the progress monitor to use to display progress and field * user requests to cancel * @exception CoreException if the operation fails due to a CoreException * @exception InvocationTargetException if the operation fails due to an exception other than CoreException * @exception InterruptedException if the operation detects a request to cancel, * using <code>IProgressMonitor.isCanceled()</code>, it should exit by throwing * <code>InterruptedException</code>. It is also possible to throw * <code>OperationCanceledException</code>, which gets mapped to <code>InterruptedException</code> * by the <code>run</code> method. */ protected abstract void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException; /** * The <code>WorkspaceModifyOperation</code> implementation of this * <code>IRunnableWithProgress</code> method initiates a batch of changes by * invoking the <code>execute</code> method as a workspace runnable * (<code>IWorkspaceRunnable</code>). */ public synchronized final void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { final InvocationTargetException[] iteHolder = new InvocationTargetException[1]; try { IWorkspaceRunnable workspaceRunnable = new IWorkspaceRunnable() { public void run(IProgressMonitor pm) throws CoreException { try { execute(pm); } catch (InvocationTargetException e) { // Pass it outside the workspace runnable iteHolder[0] = e; } catch (InterruptedException e) { // Re-throw as OperationCanceledException, which will be // caught and re-thrown as InterruptedException below. throw new OperationCanceledException(e.getMessage()); } // CoreException and OperationCanceledException are propagated } }; ResourcesPlugin.getWorkspace().run(workspaceRunnable, rule, IResource.NONE, monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } catch (OperationCanceledException e) { throw new InterruptedException(e.getMessage()); } // Re-throw the InvocationTargetException, if any occurred if (iteHolder[0] != null) { throw iteHolder[0]; } } /* (non-Javadoc) * @see IThreadListener#threadChange(Thread); * @since 3.2 */ public void threadChange(Thread thread) { //we must make sure we aren't transferring control away from a thread that //already owns a scheduling rule because this is deadlock prone (bug 105491) if (rule == null) return; Job currentJob = Platform.getJobManager().currentJob(); if (currentJob == null) return; ISchedulingRule currentRule = currentJob.getRule(); if (currentRule == null) return; throw new IllegalStateException("Cannot fork a thread from a thread owning a rule"); //$NON-NLS-1$ } } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:40
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/ui/part In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/ui/part Added Files: FileEditorInput.java FileEditorInputFactory.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: FileEditorInputFactory.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui.part; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.Path; import org.eclipse.ui.IElementFactory; import org.eclipse.ui.IMemento; /** * Factory for saving and restoring a <code>FileEditorInput</code>. * The stored representation of a <code>FileEditorInput</code> remembers * the full path of the file (that is, <code>IFile.getFullPath</code>). * <p> * The workbench will automatically create instances of this class as required. * It is not intended to be instantiated or subclassed by the client. * </p> */ public class FileEditorInputFactory implements IElementFactory { /** * Factory id. The workbench plug-in registers a factory by this name * with the "org.eclipse.ui.elementFactories" extension point. */ private static final String ID_FACTORY = "org.eclipse.ui.part.FileEditorInputFactory"; //$NON-NLS-1$ /** * Tag for the IFile.fullPath of the file resource. */ private static final String TAG_PATH = "path"; //$NON-NLS-1$ /** * Creates a new factory. */ public FileEditorInputFactory() { } /* (non-Javadoc) * Method declared on IElementFactory. */ public IAdaptable createElement(IMemento memento) { // Get the file name. String fileName = memento.getString(TAG_PATH); if (fileName == null) return null; // Get a handle to the IFile...which can be a handle // to a resource that does not exist in workspace IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile( new Path(fileName)); if (file != null) return new FileEditorInput(file); else return null; } /** * Returns the element factory id for this class. * * @return the element factory id */ public static String getFactoryId() { return ID_FACTORY; } /** * Saves the state of the given file editor input into the given memento. * * @param memento the storage area for element state * @param input the file editor input */ public static void saveState(IMemento memento, FileEditorInput input) { IFile file = input.getFile(); memento.putString(TAG_PATH, file.getFullPath().toString()); } } --- NEW FILE: FileEditorInput.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui.part; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IStorage; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; //import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.IMemento; import org.eclipse.ui.IPathEditorInput; import org.eclipse.ui.IPersistableElement; import org.eclipse.ui.PlatformUI; //import org.eclipse.ui.ide.IDE; /** * Adapter for making a file resource a suitable input for an editor. * <p> * This class may be instantiated; it is not intended to be subclassed. * </p> */ public class FileEditorInput implements IFileEditorInput, IPathEditorInput, IPersistableElement { private IFile file; /** * Creates an editor input based of the given file resource. * * @param file the file resource */ public FileEditorInput(IFile file) { if (file == null) { throw new IllegalArgumentException(); } this.file = file; } /* (non-Javadoc) * Method declared on Object. */ public int hashCode() { return file.hashCode(); } /* (non-Javadoc) * Method declared on Object. * * The <code>FileEditorInput</code> implementation of this <code>Object</code> * method bases the equality of two <code>FileEditorInput</code> objects on the * equality of their underlying <code>IFile</code> resources. */ public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof IFileEditorInput)) return false; IFileEditorInput other = (IFileEditorInput) obj; return file.equals(other.getFile()); } /* (non-Javadoc) * Method declared on IEditorInput. */ public boolean exists() { return file.exists(); } /* (non-Javadoc) * Method declared on IAdaptable. */ public Object getAdapter(Class adapter) { if (adapter == IFile.class) return file; return file.getAdapter(adapter); } /* (non-Javadoc) * Method declared on IPersistableElement. */ public String getFactoryId() { return FileEditorInputFactory.getFactoryId(); } /* (non-Javadoc) * Method declared on IFileEditorInput. */ public IFile getFile() { return file; } /* (non-Javadoc) * Method declared on IEditorInput. */ public ImageDescriptor getImageDescriptor() { //IContentType contentType = IDE.getContentType(file); return PlatformUI.getWorkbench().getEditorRegistry() .getImageDescriptor(file.getName(), null); } /* (non-Javadoc) * Method declared on IEditorInput. */ public String getName() { return file.getName(); } /* (non-Javadoc) * Method declared on IEditorInput. */ public IPersistableElement getPersistable() { return this; } /* (non-Javadoc) * Method declared on IStorageEditorInput. */ public IStorage getStorage() throws CoreException { return file; } /* (non-Javadoc) * Method declared on IEditorInput. */ public String getToolTipText() { return file.getFullPath().makeRelative().toString(); } /* (non-Javadoc) * Method declared on IPersistableElement. */ public void saveState(IMemento memento) { FileEditorInputFactory.saveState(memento, this); } /* (non-Javadoc) * Method declared on IPathEditorInput * @since 3.0 * @issue consider using an internal adapter for IPathEditorInput rather than adding this as API */ public IPath getPath() { return file.getLocation(); } /* (non-Javadoc) * @see java.lang.Object#toString() */ public String toString() { return getClass().getName() + "(" + getFile().getFullPath() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:40
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/META-INF Added Files: MANIFEST.MF Log Message: Patched version of org.eclipse.compare --- NEW FILE: MANIFEST.MF --- Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.jcommander.eclipsepatch.compare;singleton:=true Bundle-Version: 3.2.0 Bundle-Activator: org.eclipse.compare.internal.CompareUIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin Export-Package: org.eclipse.compare, org.eclipse.compare.contentmergeviewer, org.eclipse.compare.internal;x-internal:=true, org.eclipse.compare.internal.merge;x-internal:=true, org.eclipse.compare.internal.patch;x-internal:=true, org.eclipse.compare.patch, org.eclipse.compare.rangedifferencer, org.eclipse.compare.structuremergeviewer Require-Bundle: org.eclipse.ui;bundle-version="[3.1.0,4.0.0)", org.eclipse.core.resources;bundle-version="[3.1.0,4.0.0)", org.eclipse.jface.text;bundle-version="[3.1.0,4.0.0)", org.eclipse.ui.workbench.texteditor;bundle-version="[3.1.0,4.0.0)", org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)" Eclipse-LazyStart: true |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:39
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/icons/full/etool16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/icons/full/etool16 Added Files: ignorews_edit.gif conflict_edit.gif Log Message: Patched version of org.eclipse.compare --- NEW FILE: conflict_edit.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ignorews_edit.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:39
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/icons/full/wizban In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/icons/full/wizban Added Files: applypatch_wizban.png Log Message: Patched version of org.eclipse.compare --- NEW FILE: applypatch_wizban.png --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/schema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/schema Added Files: streamMergers.exsd contentViewers.exsd contentMergeViewers.exsd structureCreators.exsd structureMergeViewers.exsd Log Message: Patched version of org.eclipse.compare --- NEW FILE: structureMergeViewers.exsd --- <?xml version='1.0' encoding='UTF-8'?> <!-- Schema file written by PDE --> <schema targetNamespace="org.eclipse.compare"> <annotation> <appInfo> <meta.schema plugin="org.eclipse.compare" id="structureMergeViewers" name="StructureMerge Viewers"/> </appInfo> <documentation> This extension point allows a plug-in to register compare/merge viewers for structural content types. The viewer is expected to extend <samp>org.eclipse.jface.viewers.Viewer</samp>. However, since viewers don't have a default constructor, the extension point must implement the factory interface for viewers <samp>org.eclipse.compare.IViewerCreator</samp>. </documentation> </annotation> <element name="extension"> <complexType> <sequence> <element ref="viewer" minOccurs="0" maxOccurs="unbounded"/> <element ref="contentTypeBinding" minOccurs="0" maxOccurs="unbounded"/> </sequence> <attribute name="point" type="string" use="required"> <annotation> <documentation> a fully qualified identifier of the target extension point </documentation> </annotation> </attribute> <attribute name="id" type="string"> <annotation> <documentation> an optional identifier of the extension instance </documentation> </annotation> </attribute> <attribute name="name" type="string"> <annotation> <documentation> an optional name of the extension instance </documentation> <appInfo> <meta.attribute translatable="true"/> </appInfo> </annotation> </attribute> </complexType> </element> <element name="viewer"> <complexType> <attribute name="id" type="string" use="required"> <annotation> <documentation> a unique identifier that can be used to reference the viewer </documentation> </annotation> </attribute> <attribute name="class" type="string" use="required"> <annotation> <documentation> a fully qualified name of a class that implements a factory for the structure merge viewer and implements <samp>org.eclipse.compare.IViewerCreator</samp> </documentation> <appInfo> <meta.attribute kind="java" basedOn="org.eclipse.jface.viewers.Viewer:org.eclipse.compare.IViewerCreator"/> </appInfo> </annotation> </attribute> <attribute name="extensions" type="string" use="required"> <annotation> <documentation> a comma separated list of file extensions e.g. "zip, jar" </documentation> </annotation> </attribute> </complexType> </element> <element name="contentTypeBinding"> <complexType> <attribute name="contentTypeId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="structureMergeViewerId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> </complexType> </element> <annotation> <appInfo> <meta.section type="examples"/> </appInfo> <documentation> The following is an example of compare/merge viewer for zip files (extension "zip"): <p> <pre> <extension point = "org.eclipse.compare.structureMergeViewers"> <viewer id="org.eclipse.compare.ZipCompareViewer" class="org.eclipse.compare.ZipCompareViewerCreator" extensions="zip" /> </extension> </pre> </p> </documentation> </annotation> <annotation> <appInfo> <meta.section type="apiInfo"/> </appInfo> <documentation> The contributed class must implement <code>org.eclipse.compare.IViewerCreator</code> </documentation> </annotation> <annotation> <appInfo> <meta.section type="implementation"/> </appInfo> <documentation> The Compare UI plugin defines a structure compare viewer for zip archives. </documentation> </annotation> <annotation> <appInfo> <meta.section type="copyright"/> </appInfo> <documentation> Copyright (c) 2000, 2004 IBM Corporation and others.<br> All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> </documentation> </annotation> </schema> --- NEW FILE: contentMergeViewers.exsd --- <?xml version='1.0' encoding='UTF-8'?> <!-- Schema file written by PDE --> <schema targetNamespace="org.eclipse.compare"> <annotation> <appInfo> <meta.schema plugin="org.eclipse.compare" id="contentMergeViewers" name="ContentMerge Viewers"/> </appInfo> <documentation> This extension point allows a plug-in to register compare/merge viewers for specific content types. The viewer is expected to extend <samp>org.eclipse.jface.viewers.Viewer</samp>. However, since viewers don't have a default constructor, the extension point must implement the factory interface for viewers <samp>org.eclipse.compare.IViewerCreator</samp>. </documentation> </annotation> <element name="extension"> <complexType> <sequence> <element ref="viewer" minOccurs="0" maxOccurs="unbounded"/> <element ref="contentTypeBinding" minOccurs="0" maxOccurs="unbounded"/> </sequence> <attribute name="point" type="string" use="required"> <annotation> <documentation> a fully qualified identifier of the target extension point </documentation> </annotation> </attribute> <attribute name="id" type="string"> <annotation> <documentation> an optional identifier of the extension instance </documentation> </annotation> </attribute> <attribute name="name" type="string"> <annotation> <documentation> an optional name of the extension instance </documentation> <appInfo> <meta.attribute translatable="true"/> </appInfo> </annotation> </attribute> </complexType> </element> <element name="viewer"> <complexType> <attribute name="id" type="string" use="required"> <annotation> <documentation> a unique identifier that can be used to reference the viewer </documentation> </annotation> </attribute> <attribute name="class" type="string" use="required"> <annotation> <documentation> a fully qualified name of a class that implements a factory for the content merge viewer and implements <samp>org.eclipse.compare.IViewerCreator</samp> </documentation> <appInfo> <meta.attribute kind="java" basedOn="org.eclipse.jface.viewers.Viewer:org.eclipse.compare.IViewerCreator"/> </appInfo> </annotation> </attribute> <attribute name="extensions" type="string"> <annotation> <documentation> a comma separated list of file extensions e.g. "java, gif" </documentation> </annotation> </attribute> </complexType> </element> <element name="contentTypeBinding"> <complexType> <attribute name="contentTypeId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="contentMergeViewerId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> </complexType> </element> <annotation> <appInfo> <meta.section type="examples"/> </appInfo> <documentation> The following is an example of a compare/merge viewer for text files (extension "txt"): <p> <pre> <extension point = "org.eclipse.compare.contentMergeViewers"> <viewer id="org.eclipse.compare.contentmergeviewer.TextMergeViewer" class="org.eclipse.compare.internal.TextMergeViewerCreator" extensions="txt" /> </extension> </pre> </p> </documentation> </annotation> <annotation> <appInfo> <meta.section type="apiInfo"/> </appInfo> <documentation> The contributed class must implement <code>org.eclipse.compare.IViewerCreator</code> </documentation> </annotation> <annotation> <appInfo> <meta.section type="implementation"/> </appInfo> <documentation> The Compare UI plugin defines content viewers for text, binary contents, and images. </documentation> </annotation> <annotation> <appInfo> <meta.section type="copyright"/> </appInfo> <documentation> Copyright (c) 2000, 2004 IBM Corporation and others.<br> All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> </documentation> </annotation> </schema> --- NEW FILE: structureCreators.exsd --- <?xml version='1.0' encoding='UTF-8'?> <!-- Schema file written by PDE --> <schema targetNamespace="org.eclipse.compare"> <annotation> <appInfo> <meta.schema plugin="org.eclipse.compare" id="structureCreators" name="Structure Creators"/> </appInfo> <documentation> This extension point allows a plug-in to register a structure creator for specific content types. The structure creator is expected to create a tree of <samp>IStructureComparator</samp>s for a given content. This tree is used as the input for the structural compare. The extension point must implement the interface <samp>org.eclipse.compare.structuremergeviewer.IStructureCreator</samp>. </documentation> </annotation> <element name="extension"> <complexType> <sequence> <element ref="structureCreator" minOccurs="0" maxOccurs="unbounded"/> <element ref="contentTypeBinding" minOccurs="0" maxOccurs="unbounded"/> </sequence> <attribute name="point" type="string" use="required"> <annotation> <documentation> a fully qualified identifier of the target extension point </documentation> </annotation> </attribute> <attribute name="id" type="string"> <annotation> <documentation> an optional identifier of the extension instance </documentation> </annotation> </attribute> <attribute name="name" type="string"> <annotation> <documentation> an optional name of the extension instance </documentation> <appInfo> <meta.attribute translatable="true"/> </appInfo> </annotation> </attribute> </complexType> </element> <element name="structureCreator"> <complexType> <attribute name="id" type="string" use="required"> <annotation> <documentation> a unique identifier that can be used to reference the structure creator </documentation> </annotation> </attribute> <attribute name="class" type="string" use="required"> <annotation> <documentation> a fully qualified name of a class that implements <samp>org.eclipse.compare.structuremergeviewer.IStructureCreator</samp> </documentation> <appInfo> <meta.attribute kind="java" basedOn="org.eclipse.compare.structuremergeviewer.IStructureComparator"/> </appInfo> </annotation> </attribute> <attribute name="extensions" type="string"> <annotation> <documentation> a comma separated list of file extensions e.g. "java, properties" </documentation> </annotation> </attribute> </complexType> </element> <element name="contentTypeBinding"> <complexType> <attribute name="contentTypeId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="structureCreatorId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> </complexType> </element> <annotation> <appInfo> <meta.section type="examples"/> </appInfo> <documentation> The following is an example of a structure creator for java files (extension "java"): <p> <pre> <extension point = "org.eclipse.compare.structureCreators"> <structureCreator id="org.eclipse.compare.JavaStructureCreator" class="org.eclipse.compare.JavaStructureCreator" extensions="java" /> </extension> </pre> </p> </documentation> </annotation> <annotation> <appInfo> <meta.section type="apiInfo"/> </appInfo> <documentation> The contributed class must implement <code>org.eclipse.compare.structuremergeviewer.IStructureCreator</code> </documentation> </annotation> <annotation> <appInfo> <meta.section type="implementation"/> </appInfo> <documentation> The Compare UI plugin defines a structure creator for zip archives. </documentation> </annotation> <annotation> <appInfo> <meta.section type="copyright"/> </appInfo> <documentation> Copyright (c) 2000, 2004 IBM Corporation and others.<br> All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> </documentation> </annotation> </schema> --- NEW FILE: streamMergers.exsd --- <?xml version='1.0' encoding='UTF-8'?> <!-- Schema file written by PDE --> <schema targetNamespace="org.eclipse.compare"> <annotation> <appInfo> <meta.schema plugin="org.eclipse.compare" id="streamMergers" name="Stream Merger"/> </appInfo> <documentation> This extension point allows a plug-in to register a stream merger for specific content types. The stream merger is expected to perform a three-way merge on three input streams and writes the result to an output stream. The extension point must implement the interface <samp>org.eclipse.compare.IStreamMerger</samp>. </documentation> </annotation> <element name="extension"> <complexType> <sequence> <element ref="streamMerger" minOccurs="0" maxOccurs="unbounded"/> <element ref="contentTypeBinding" minOccurs="0" maxOccurs="unbounded"/> </sequence> <attribute name="point" type="string" use="required"> <annotation> <documentation> a fully qualified identifier of the target extension point </documentation> </annotation> </attribute> <attribute name="id" type="string"> <annotation> <documentation> an optional identifier of the extension instance </documentation> </annotation> </attribute> <attribute name="name" type="string"> <annotation> <documentation> an optional name of the extension instance </documentation> <appInfo> <meta.attribute translatable="true"/> </appInfo> </annotation> </attribute> </complexType> </element> <element name="streamMerger"> <complexType> <attribute name="id" type="string" use="required"> <annotation> <documentation> a unique identifier that can be used to reference the stream merger </documentation> </annotation> </attribute> <attribute name="class" type="string" use="required"> <annotation> <documentation> a fully qualified name of a class that implements <samp>org.eclipse.compare.IStreamMerger</samp> </documentation> <appInfo> <meta.attribute kind="java" basedOn="org.eclipse.compare.IStreamMerger"/> </appInfo> </annotation> </attribute> <attribute name="extensions" type="string"> <annotation> <documentation> a comma separated list of file extensions e.g. "java, properties" </documentation> </annotation> </attribute> </complexType> </element> <element name="contentTypeBinding"> <complexType> <attribute name="contentTypeId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="streamMergerId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> </complexType> </element> <annotation> <appInfo> <meta.section type="since"/> </appInfo> <documentation> 3.0 </documentation> </annotation> <annotation> <appInfo> <meta.section type="examples"/> </appInfo> <documentation> The following is an example of a stream merger for property files (extension "properties"): <p> <pre> <extension point = "org.eclipse.compare.streamMergers"> <streamMerger id="org.eclipse.compare.internal.merge.TextStreamMerger" class="org.eclipse.compare.internal.merge.TextStreamMerger" extensions="properties" /> </extension> </pre> </p> </documentation> </annotation> <annotation> <appInfo> <meta.section type="apiInfo"/> </appInfo> <documentation> The contributed class must implement <code>org.eclipse.compare.IStreamMerger</code> </documentation> </annotation> <annotation> <appInfo> <meta.section type="implementation"/> </appInfo> <documentation> The Compare UI plugin defines a stream merger for line oriented text files. </documentation> </annotation> <annotation> <appInfo> <meta.section type="copyright"/> </appInfo> <documentation> Copyright (c) 2000, 2004 IBM Corporation and others.<br> All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> </documentation> </annotation> </schema> --- NEW FILE: contentViewers.exsd --- <?xml version='1.0' encoding='UTF-8'?> <!-- Schema file written by PDE --> <schema targetNamespace="org.eclipse.compare"> <annotation> <appInfo> <meta.schema plugin="org.eclipse.compare" id="contentViewers" name="Content Viewers"/> </appInfo> <documentation> This extension point allows a plug-in to register viewers for specific content types. These viewers are used in the <samp>EditionSelectionDialog</samp> when presenting an edition of a resource or a subsection thereof. The viewer is expected to extend <samp>org.eclipse.jface.viewers.Viewer</samp>. However since viewers don't have a default constructor the extension point must implement the factory interface for viewers <samp>org.eclipse.compare.IViewerCreator</samp>. </documentation> </annotation> <element name="extension"> <complexType> <sequence> <element ref="viewer" minOccurs="0" maxOccurs="unbounded"/> <element ref="contentTypeBinding" minOccurs="0" maxOccurs="unbounded"/> </sequence> <attribute name="point" type="string" use="required"> <annotation> <documentation> a fully qualified identifier of the target extension point </documentation> </annotation> </attribute> <attribute name="id" type="string"> <annotation> <documentation> an optional identifier of the extension instance </documentation> </annotation> </attribute> <attribute name="name" type="string"> <annotation> <documentation> an optional name of the extension instance </documentation> <appInfo> <meta.attribute translatable="true"/> </appInfo> </annotation> </attribute> </complexType> </element> <element name="viewer"> <complexType> <attribute name="id" type="string" use="required"> <annotation> <documentation> a unique identifier that can be used to reference the viewer </documentation> </annotation> </attribute> <attribute name="class" type="string" use="required"> <annotation> <documentation> a fully qualified name of a class that implements a factory for the content viewer and implements <samp>org.eclipse.compare.IViewerCreator</samp> </documentation> <appInfo> <meta.attribute kind="java" basedOn="org.eclipse.jface.viewers.Viewer:org.eclipse.compare.IViewerCreator"/> </appInfo> </annotation> </attribute> <attribute name="extensions" type="string"> <annotation> <documentation> a comma separated list of file extensions e.g. "java, gif" </documentation> </annotation> </attribute> </complexType> </element> <element name="contentTypeBinding"> <complexType> <attribute name="contentTypeId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> <attribute name="contentViewerId" type="string" use="required"> <annotation> <documentation> </documentation> </annotation> </attribute> </complexType> </element> <annotation> <appInfo> <meta.section type="examples"/> </appInfo> <documentation> The following is an example of a viewer for text files (extension "txt"): <p> <pre> <extension point = "org.eclipse.compare.contentViewers"> <viewer id="org.eclipse.compare.internal.TextViewer" class="org.eclipse.compare.internal.TextViewerCreator" extensions="txt" /> </extension> </pre> </p> </documentation> </annotation> <annotation> <appInfo> <meta.section type="apiInfo"/> </appInfo> <documentation> The contributed class must implement <code>org.eclipse.compare.IViewerCreator</code> </documentation> </annotation> <annotation> <appInfo> <meta.section type="implementation"/> </appInfo> <documentation> The Compare UI plugin defines content viewers for text and images. </documentation> </annotation> <annotation> <appInfo> <meta.section type="copyright"/> </appInfo> <documentation> Copyright (c) 2000, 2004 IBM Corporation and others.<br> All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> </documentation> </annotation> </schema> |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:36
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/scripts Added Files: exportplugin.xml Log Message: Patched version of org.eclipse.compare --- NEW FILE: exportplugin.xml --- <project name="org.eclipse.compare" default="export" basedir=".."> <target name="init"> <tstamp/> <property name="destdir" value="../../plugin-export" /> <property name="plugin" value="org.eclipse.compare" /> <property name="qualifier" value="zzz${DSTAMP}-${TSTAMP}" /> <property name="plugin_version" value="_3.2.0.${qualifier}" /> <property name="dest" value="${destdir}/${plugin}${plugin_version}" /> <property name="destjar" value="${destdir}/${plugin}${plugin_version}.jar" /> </target> <target name="build" depends="init"> <eclipse.incrementalBuild project="${plugin}" kind="incr"/> </target> <target name="export" depends="build"> <mkdir dir="${destdir}" /> <delete dir="${dest}" /> <mkdir dir="${dest}" /> <copy todir="${dest}/META-INF"> <fileset dir="META-INF" /> </copy> <replaceregexp file="${dest}/META-INF/MANIFEST.MF" match="Bundle-Version: ((\d)+\.(\d)+\.(\d)+\.)qualifier" replace="Bundle-Version: \1${qualifier}" byline="true" /> <delete file="${destjar}" /> <zip zipfile="${destjar}"> <fileset dir="."> <include name="plugin.xml" /> <include name="plugin.properties" /> <include name="icons/**" /> <include name=".options" /> <include name="schema/**" /> <include name="src/**" /> </fileset> <fileset dir="bin" /> <fileset dir="${dest}"> <include name="META-INF/**" /> </fileset> </zip> <delete dir="${dest}" /> </target> </project> |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:36
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/.settings In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/.settings Added Files: org.eclipse.jdt.core.prefs Log Message: Patched version of org.eclipse.compare --- NEW FILE: org.eclipse.jdt.core.prefs --- #Tue Nov 30 15:51:47 CET 2004 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.unusedImport=error org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.builder.invalidClasspath=abort org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch org.eclipse.jdt.core.compiler.problem.unusedLocal=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.source=1.3 org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error org.eclipse.jdt.core.builder.cleanOutputFolder=clean org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error org.eclipse.jdt.core.compiler.problem.fieldHiding=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning org.eclipse.jdt.core.classpath.exclusionPatterns=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.incompatibleJDKLevel=ignore eclipse.preferences.version=1 org.eclipse.jdt.core.circularClasspath=error org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error org.eclipse.jdt.core.incompleteClasspath=error org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning org.eclipse.jdt.core.builder.duplicateResourceTask=warning org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:36
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/compare/rangedifferencer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/compare/rangedifferencer Added Files: RangeDifferencer.java LinkedRangeDifference.java RangeDifference.java package.html DifferencesIterator.java IRangeComparator.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: IRangeComparator.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.rangedifferencer; /** * For breaking an object to compare into a sequence of comparable entities. * <p> * It is used by <code>RangeDifferencer</code> to find longest sequences of * matching and non-matching ranges. * <p> * For example, to compare two text documents and find longest common sequences * of matching and non-matching lines, the implementation must break the document * into lines. <code>getRangeCount</code> would return the number of lines in the * document, and <code>rangesEqual</code> would compare a specified line given * with one in another <code>IRangeComparator</code>. * </p> * <p> * Clients should implement this interface; there is no standard implementation. * </p> */ public interface IRangeComparator { /** * Returns the number of comparable entities. * * @return the number of comparable entities */ int getRangeCount(); /** * Returns whether the comparable entity given by the first index * matches an entity specified by the other <code>IRangeComparator</code> and index. * * @param thisIndex the index of the comparable entity within this <code>IRangeComparator</code> * @param other the IRangeComparator to compare this with * @param otherIndex the index of the comparable entity within the other <code>IRangeComparator</code> * @return <code>true</code> if the comparable entities are equal */ boolean rangesEqual(int thisIndex, IRangeComparator other, int otherIndex); /** * Returns whether a comparison should be skipped because it would be too costly (or lengthy). * * @param length a number on which to base the decision whether to return * <code>true</code> or <code>false</code> * @param maxLength another number on which to base the decision whether to return * <code>true</code> or <code>false</code> * @param other the other <code>IRangeComparator</code> to compare with * @return <code>true</code> to avoid a too lengthy range comparison */ boolean skipRangeComparison(int length, int maxLength, IRangeComparator other); } --- NEW FILE: RangeDifference.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.rangedifferencer; /** * Description of a change between two or three ranges of comparable entities. * <p> * <code>RangeDifference</code> objects are the elements of a compare result returned from * the <code>RangeDifferencer</code> <code>find* </code> methods. * Clients use these objects as they are returned from the differencer. * This class is not intended to be instantiated or subclassed. * <p> * Note: A range in the <code>RangeDifference</code> object is given as a start index * and length in terms of comparable entities. However, these entity indices and counts * are not necessarily character positions. For example, if an entity represents a line * in a document, the start index would be a line number and the count would be in lines. * </p> * * @see RangeDifferencer */ public class RangeDifference { /** Two-way change constant indicating no change. */ public final static int NOCHANGE= 0; /** Two-way change constant indicating two-way change (same as <code>RIGHT</code>) */ public final static int CHANGE= 2; /** Three-way change constant indicating a change in both right and left. */ public final static int CONFLICT= 1; /** Three-way change constant indicating a change in right. */ public final static int RIGHT= 2; /** Three-way change constant indicating a change in left. */ public final static int LEFT= 3; /** * Three-way change constant indicating the same change in both right and left, * that is only the ancestor is different. */ public final static int ANCESTOR= 4; /** Constant indicating an unknown change kind. */ public final static int ERROR= 5; /** the kind of change: NOCHANGE, CHANGE, LEFT, RIGHT, ANCESTOR, CONFLICT, ERROR */ int fKind; int fLeftStart; int fLeftLength; int fRightStart; int fRightLength; int lAncestorStart; int lAncestorLength; /** * Creates a new range difference with the given change kind. * * @param changeKind the kind of change */ /* package */ RangeDifference(int changeKind) { fKind= changeKind; } /** * Creates a new <code>RangeDifference</code> with the given change kind * and left and right ranges. * * @param kind the kind of change * @param rightStart start index of entity on right side * @param rightLength number of entities on right side * @param leftStart start index of entity on left side * @param leftLength number of entities on left side */ /* package */ RangeDifference(int kind, int rightStart, int rightLength, int leftStart, int leftLength) { fKind= kind; fRightStart= rightStart; fRightLength= rightLength; fLeftStart= leftStart; fLeftLength= leftLength; } /** * Creates a new <code>RangeDifference</code> with the given change kind * and left, right, and ancestor ranges. * * @param kind the kind of change * @param rightStart start index of entity on right side * @param rightLength number of entities on right side * @param leftStart start index of entity on left side * @param leftLength number of entities on left side * @param ancestorStart start index of entity on ancestor side * @param ancestorLength number of entities on ancestor side */ /* package */ RangeDifference(int kind, int rightStart, int rightLength, int leftStart, int leftLength, int ancestorStart, int ancestorLength) { this(kind, rightStart, rightLength, leftStart, leftLength); lAncestorStart= ancestorStart; lAncestorLength= ancestorLength; } /** * Returns the kind of difference. * * @return the kind of difference, one of * <code>NOCHANGE</code>, <code>CHANGE</code>, <code>LEFT</code>, <code>RIGHT</code>, * <code>ANCESTOR</code>, <code>CONFLICT</code>, <code>ERROR</code> */ public int kind() { return fKind; } /** * Returns the start index of the entity range on the ancestor side. * * @return the start index of the entity range on the ancestor side */ public int ancestorStart() { return lAncestorStart; } /** * Returns the number of entities on the ancestor side. * * @return the number of entities on the ancestor side */ public int ancestorLength() { return lAncestorLength; } /** * Returns the end index of the entity range on the ancestor side. * * @return the end index of the entity range on the ancestor side */ public int ancestorEnd() { return lAncestorStart + lAncestorLength; } /** * Returns the start index of the entity range on the right side. * * @return the start index of the entity range on the right side */ public int rightStart() { return fRightStart; } /** * Returns the number of entities on the right side. * * @return the number of entities on the right side */ public int rightLength() { return fRightLength; } /** * Returns the end index of the entity range on the right side. * * @return the end index of the entity range on the right side */ public int rightEnd() { return fRightStart + fRightLength; } /** * Returns the start index of the entity range on the left side. * * @return the start index of the entity range on the left side */ public int leftStart() { return fLeftStart; } /** * Returns the number of entities on the left side. * * @return the number of entities on the left side */ public int leftLength() { return fLeftLength; } /** * Returns the end index of the entity range on the left side. * * @return the end index of the entity range on the left side */ public int leftEnd() { return fLeftStart + fLeftLength; } /** * Returns the maximum number of entities in the left, right, and ancestor sides of this range. * * @return the maximum number of entities in the left, right, and ancestor sides of this range */ public int maxLength() { return Math.max(fRightLength, Math.max(fLeftLength, lAncestorLength)); } } --- NEW FILE: package.html --- <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Author" content="IBM"> <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]"> <title>Package-level Javadoc</title> </head> <body> Provides support for finding the differences between two or three sequences of comparable entities. <h2> Package Specification</h2> The class <b>RangeDifferencer</b> finds longest sequences of matching and non-matching comparable entities. Its implementation is based on an objectified version of the algorithm described in: <i>A File Comparison Program,</i> by Webb Miller and Eugene W. Myers, Software Practice and Experience, Vol. 15, Nov. 1985. <p> Clients must supply the input to the differencer as an implementation of the <b>IRangeComparator</b> interface. An <b>IRangeComparator</b> breaks the input data into a sequence of entities and provides a method for comparing one entity with the entity in another <b>IRangeComparator</b>. <p> For example, to compare two text documents and find longest common sequences of matching and non-matching lines, the implementation of <b>IRangeComparator</b> must break the document into lines and provide a method for testing whether two lines are considered equal. See <b>org.eclipse.compare.internal.DocLineComparator</b> for how this can be done. <p> The differencer returns the differences among these sequences as an array of <b>RangeDifference</b> objects. Every single <b>RangeDifference</b> describes the kind of difference (no change, change, addition, deletion) and the corresponding ranges of the underlying comparable entities in the two or three inputs. </body> </html> --- NEW FILE: DifferencesIterator.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.rangedifferencer; import java.util.ArrayList; import java.util.List; /** * A custom iterator to iterate over a List of <code>RangeDifferences</code>. * It is used internally by the <code>RangeDifferencer</code>. */ /* package */ class DifferencesIterator { List fRange; int fIndex; RangeDifference[] fArray; RangeDifference fDifference; /* * Creates a differences iterator on an array of <code>RangeDifference</code>s. */ DifferencesIterator(RangeDifference[] differenceRanges) { fArray= differenceRanges; fIndex= 0; fRange= new ArrayList(); if (fIndex < fArray.length) fDifference= fArray[fIndex++]; else fDifference= null; } /* * Returns the number of RangeDifferences */ int getCount() { return fRange.size(); } /* * Appends the edit to its list and moves to the next <code>RangeDifference</code>. */ void next() { fRange.add(fDifference); if (fDifference != null) { if (fIndex < fArray.length) fDifference= fArray[fIndex++]; else fDifference= null; } } /* * Difference iterators are used in pairs. * This method returns the other iterator. */ DifferencesIterator other(DifferencesIterator right, DifferencesIterator left) { if (this == right) return left; return right; } /* * Removes all <code>RangeDifference</code>s */ void removeAll() { fRange.clear(); } } --- NEW FILE: RangeDifferencer.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.rangedifferencer; import java.util.*; import org.eclipse.jface.util.Assert; import org.eclipse.core.runtime.IProgressMonitor; /** * A <code>RangeDifferencer</code> finds the differences between two or three <code>IRangeComparator</code>s. * <p> * To use the differencer, clients provide an <code>IRangeComparator</code> * that breaks their input data into a sequence of comparable entities. The differencer * returns the differences among these sequences as an array of <code>RangeDifference</code> objects * (<code>findDifferences</code> methods). * Every <code>RangeDifference</code> represents a single kind of difference * and the corresponding ranges of the underlying comparable entities in the * left, right, and optionally ancestor sides. * <p> * Alternatively, the <code>findRanges</code> methods not only return objects for * the differing ranges but for non-differing ranges too. * <p> * The algorithm used is an objectified version of one described in: * <it>A File Comparison Program,</it> by Webb Miller and Eugene W. Myers, * Software Practice and Experience, Vol. 15, Nov. 1985. * * @see IRangeComparator * @see RangeDifference */ public final class RangeDifferencer { private static final RangeDifference[] EMPTY_RESULT= new RangeDifference[0]; /* (non Javadoc) * Cannot be instantiated! */ private RangeDifferencer() { // nothing to do } /** * Finds the differences between two <code>IRangeComparator</code>s. * The differences are returned as an array of <code>RangeDifference</code>s. * If no differences are detected an empty array is returned. * * @param left the left range comparator * @param right the right range comparator * @return an array of range differences, or an empty array if no differences were found */ public static RangeDifference[] findDifferences(IRangeComparator left, IRangeComparator right) { return findDifferences((IProgressMonitor)null, left, right); } /** * Finds the differences between two <code>IRangeComparator</code>s. * The differences are returned as an array of <code>RangeDifference</code>s. * If no differences are detected an empty array is returned. * * @param pm if not <code>null</code> used to report progress * @param left the left range comparator * @param right the right range comparator * @return an array of range differences, or an empty array if no differences were found * @since 2.0 */ public static RangeDifference[] findDifferences(IProgressMonitor pm, IRangeComparator left, IRangeComparator right) { // assert that both IRangeComparators are of the same class Assert.isTrue(right.getClass().equals(left.getClass())); int rightSize= right.getRangeCount(); int leftSize= left.getRangeCount(); // // Differences matrix: // only the last d of each diagonal is stored, i.e., lastDiagonal[k] = row of d // int diagLen= 2 * Math.max(rightSize, leftSize); // bound on the size of edit script int maxDiagonal= diagLen; int lastDiagonal[]= new int[diagLen + 1]; // the row containing the last d // on diagonal k (lastDiagonal[k] = row) int origin= diagLen / 2; // origin of diagonal 0 // script corresponding to d[k] LinkedRangeDifference script[]= new LinkedRangeDifference[diagLen + 1]; int row, col; // find common prefix for (row= 0; row < rightSize && row < leftSize && rangesEqual(right, row, left, row) == true;) row++; lastDiagonal[origin]= row; script[origin]= null; int lower= (row == rightSize) ? origin + 1 : origin - 1; int upper= (row == leftSize) ? origin - 1 : origin + 1; if (lower > upper) return EMPTY_RESULT; //System.out.println("findDifferences: " + maxDiagonal + " " + lower + " " + upper); // for each value of the edit distance for (int d= 1; d <= maxDiagonal; ++d) { // d is the current edit distance if (pm != null) pm.worked(1); if (right.skipRangeComparison(d, maxDiagonal, left)) return EMPTY_RESULT; // should be something we already found // for each relevant diagonal (-d, -d+2 ..., d-2, d) for (int k= lower; k <= upper; k += 2) { // k is the current diagonal LinkedRangeDifference edit; if (pm != null && pm.isCanceled()) return EMPTY_RESULT; if (k == origin - d || k != origin + d && lastDiagonal[k + 1] >= lastDiagonal[k - 1]) { // // move down // row= lastDiagonal[k + 1] + 1; edit= new LinkedRangeDifference(script[k + 1], LinkedRangeDifference.DELETE); } else { // // move right // row= lastDiagonal[k - 1]; edit= new LinkedRangeDifference(script[k - 1], LinkedRangeDifference.INSERT); } col= row + k - origin; edit.fRightStart= row; edit.fLeftStart= col; Assert.isTrue(k >= 0 && k <= maxDiagonal); script[k]= edit; // slide down the diagonal as far as possible while (row < rightSize && col < leftSize && rangesEqual(right, row, left, col) == true) { ++row; ++col; } Assert.isTrue(k >= 0 && k <= maxDiagonal); // Unreasonable value for diagonal index lastDiagonal[k]= row; if (row == rightSize && col == leftSize) { //showScript(script[k], right, left); return createDifferencesRanges(script[k]); } if (row == rightSize) lower= k + 2; if (col == leftSize) upper= k - 2; } --lower; ++upper; } // too many differences Assert.isTrue(false); return null; } /** * Finds the differences among three <code>IRangeComparator</code>s. * The differences are returned as a list of <code>RangeDifference</code>s. * If no differences are detected an empty list is returned. * If the ancestor range comparator is <code>null</code>, a two-way * comparison is performed. * * @param ancestor the ancestor range comparator or <code>null</code> * @param left the left range comparator * @param right the right range comparator * @return an array of range differences, or an empty array if no differences were found */ public static RangeDifference[] findDifferences(IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) { return findDifferences(null, ancestor, left, right); } /** * Finds the differences among three <code>IRangeComparator</code>s. * The differences are returned as a list of <code>RangeDifference</code>s. * If no differences are detected an empty list is returned. * If the ancestor range comparator is <code>null</code>, a two-way * comparison is performed. * * @param pm if not <code>null</code> used to report progress * @param ancestor the ancestor range comparator or <code>null</code> * @param left the left range comparator * @param right the right range comparator * @return an array of range differences, or an empty array if no differences were found * @since 2.0 */ public static RangeDifference[] findDifferences(IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) { if (ancestor == null) return findDifferences(pm, left, right); RangeDifference[] leftAncestorScript= null; RangeDifference[] rightAncestorScript= findDifferences(pm, ancestor, right); if (rightAncestorScript != null) leftAncestorScript= findDifferences(pm, ancestor, left); if (rightAncestorScript == null || leftAncestorScript == null) return null; DifferencesIterator myIter= new DifferencesIterator(rightAncestorScript); DifferencesIterator yourIter= new DifferencesIterator(leftAncestorScript); List diff3= new ArrayList(); diff3.add(new RangeDifference(RangeDifference.ERROR)); // add a sentinel int changeRangeStart= 0; int changeRangeEnd= 0; // // Combine the two two-way edit scripts into one // while (myIter.fDifference != null || yourIter.fDifference != null) { DifferencesIterator startThread; myIter.removeAll(); yourIter.removeAll(); // // take the next diff that is closer to the start // if (myIter.fDifference == null) startThread= yourIter; else if (yourIter.fDifference == null) startThread= myIter; else { // not at end of both scripts take the lowest range if (myIter.fDifference.fLeftStart <= yourIter.fDifference.fLeftStart) // 2 -> common (Ancestor) change range startThread= myIter; else startThread= yourIter; } changeRangeStart= startThread.fDifference.fLeftStart; changeRangeEnd= startThread.fDifference.leftEnd(); startThread.next(); // // check for overlapping changes with other thread // merge overlapping changes with this range // DifferencesIterator other= startThread.other(myIter, yourIter); while (other.fDifference != null && other.fDifference.fLeftStart <= changeRangeEnd) { int newMax= other.fDifference.leftEnd(); other.next(); if (newMax >= changeRangeEnd) { changeRangeEnd= newMax; other= other.other(myIter, yourIter); } } diff3.add(createRangeDifference3(myIter, yourIter, diff3, right, left, changeRangeStart, changeRangeEnd)); } // remove sentinel diff3.remove(0); return (RangeDifference[]) diff3.toArray(EMPTY_RESULT); } /** * Finds the differences among two <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * * @param left the left range comparator * @param right the right range comparator * @return an array of range differences */ public static RangeDifference[] findRanges(IRangeComparator left, IRangeComparator right) { return findRanges((IProgressMonitor)null, left, right); } /** * Finds the differences among two <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * * @param pm if not <code>null</code> used to report progress * @param left the left range comparator * @param right the right range comparator * @return an array of range differences * @since 2.0 */ public static RangeDifference[] findRanges(IProgressMonitor pm, IRangeComparator left, IRangeComparator right) { RangeDifference[] in= findDifferences(pm, left, right); List out= new ArrayList(); RangeDifference rd; int mstart= 0; int ystart= 0; for (int i= 0; i < in.length; i++) { RangeDifference es= in[i]; rd= new RangeDifference(RangeDifference.NOCHANGE, mstart, es.rightStart() - mstart, ystart, es.leftStart() - ystart); if (rd.maxLength() != 0) out.add(rd); out.add(es); mstart= es.rightEnd(); ystart= es.leftEnd(); } rd= new RangeDifference(RangeDifference.NOCHANGE, mstart, right.getRangeCount() - mstart, ystart, left.getRangeCount() - ystart); if (rd.maxLength() > 0) out.add(rd); return (RangeDifference[]) out.toArray(EMPTY_RESULT); } /** * Finds the differences among three <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * If the ancestor range comparator is <code>null</code>, a two-way * comparison is performed. * * @param ancestor the ancestor range comparator or <code>null</code> * @param left the left range comparator * @param right the right range comparator * @return an array of range differences */ public static RangeDifference[] findRanges(IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) { return findRanges(null, ancestor, left, right); } /** * Finds the differences among three <code>IRangeComparator</code>s. * In contrast to <code>findDifferences</code>, the result * contains <code>RangeDifference</code> elements for non-differing ranges too. * If the ancestor range comparator is <code>null</code>, a two-way * comparison is performed. * * @param pm if not <code>null</code> used to report progress * @param ancestor the ancestor range comparator or <code>null</code> * @param left the left range comparator * @param right the right range comparator * @return an array of range differences * @since 2.0 */ public static RangeDifference[] findRanges(IProgressMonitor pm, IRangeComparator ancestor, IRangeComparator left, IRangeComparator right) { if (ancestor == null) return findRanges(pm, left, right); RangeDifference[] in= findDifferences(pm, ancestor, left, right); List out= new ArrayList(); RangeDifference rd; int mstart= 0; int ystart= 0; int astart= 0; for (int i= 0; i < in.length; i++) { RangeDifference es= in[i]; rd= new RangeDifference(RangeDifference.NOCHANGE, mstart, es.rightStart() - mstart, ystart, es.leftStart() - ystart, astart, es.ancestorStart() - astart); if (rd.maxLength() > 0) out.add(rd); out.add(es); mstart= es.rightEnd(); ystart= es.leftEnd(); astart= es.ancestorEnd(); } rd= new RangeDifference(RangeDifference.NOCHANGE, mstart, right.getRangeCount() - mstart, ystart, left.getRangeCount() - ystart, astart, ancestor.getRangeCount() - astart); if (rd.maxLength() > 0) out.add(rd); return (RangeDifference[]) out.toArray(EMPTY_RESULT); } //---- private methods /* * Creates a Vector of DifferencesRanges out of the LinkedRangeDifference. * It coalesces adjacent changes. * In addition, indices are changed such that the ranges are 1) open, i.e, * the end of the range is not included, and 2) are zero based. */ private static RangeDifference[] createDifferencesRanges(LinkedRangeDifference start) { LinkedRangeDifference ep= reverseDifferences(start); ArrayList result= new ArrayList(); RangeDifference es= null; while (ep != null) { es= new RangeDifference(RangeDifference.CHANGE); if (ep.isInsert()) { es.fRightStart= ep.fRightStart + 1; es.fLeftStart= ep.fLeftStart; RangeDifference b= ep; do { ep= ep.getNext(); es.fLeftLength++; } while (ep != null && ep.isInsert() && ep.fRightStart == b.fRightStart); } else { es.fRightStart= ep.fRightStart; es.fLeftStart= ep.fLeftStart; RangeDifference a= ep; // // deleted lines // do { a= ep; ep= ep.getNext(); es.fRightLength++; } while (ep != null && ep.isDelete() && ep.fRightStart == a.fRightStart + 1); boolean change= (ep != null && ep.isInsert() && ep.fRightStart == a.fRightStart); if (change) { RangeDifference b= ep; // // replacement lines // do { ep= ep.getNext(); es.fLeftLength++; } while (ep != null && ep.isInsert() && ep.fRightStart == b.fRightStart); } else { es.fLeftLength= 0; } es.fLeftStart++; // meaning of range changes from "insert after", to "replace with" } // // the script commands are 1 based, subtract one to make them zero based // es.fRightStart--; es.fLeftStart--; result.add(es); } return (RangeDifference[]) result.toArray(EMPTY_RESULT); } /* * Creates a <code>RangeDifference3</code> given the * state of two DifferenceIterators. */ private static RangeDifference createRangeDifference3(DifferencesIterator myIter, DifferencesIterator yourIter, List diff3, IRangeComparator right, IRangeComparator left, int changeRangeStart, int changeRangeEnd) { int rightStart, rightEnd; int leftStart, leftEnd; int kind= RangeDifference.ERROR; RangeDifference last= (RangeDifference) diff3.get(diff3.size() - 1); Assert.isTrue((myIter.getCount() != 0 || yourIter.getCount() != 0)); // At least one range array must be non-empty // // find corresponding lines to fChangeRangeStart/End in right and left // if (myIter.getCount() == 0) { // only left changed rightStart= changeRangeStart - last.ancestorEnd() + last.rightEnd(); rightEnd= changeRangeEnd - last.ancestorEnd() + last.rightEnd(); kind= RangeDifference.LEFT; } else { RangeDifference f= (RangeDifference) myIter.fRange.get(0); RangeDifference l= (RangeDifference) myIter.fRange.get(myIter.fRange.size() - 1); rightStart= changeRangeStart - f.fLeftStart + f.fRightStart; rightEnd= changeRangeEnd - l.leftEnd() + l.rightEnd(); } if (yourIter.getCount() == 0) { // only right changed leftStart= changeRangeStart - last.ancestorEnd() + last.leftEnd(); leftEnd= changeRangeEnd - last.ancestorEnd() + last.leftEnd(); kind= RangeDifference.RIGHT; } else { RangeDifference f= (RangeDifference) yourIter.fRange.get(0); RangeDifference l= (RangeDifference) yourIter.fRange.get(yourIter.fRange.size() - 1); leftStart= changeRangeStart - f.fLeftStart + f.fRightStart; leftEnd= changeRangeEnd - l.leftEnd() + l.rightEnd(); } if (kind == RangeDifference.ERROR) { // overlapping change (conflict) -> compare the changed ranges if (rangeSpansEqual(right, rightStart, rightEnd - rightStart, left, leftStart, leftEnd - leftStart)) kind= RangeDifference.ANCESTOR; else kind= RangeDifference.CONFLICT; } return new RangeDifference(kind, rightStart, rightEnd - rightStart, leftStart, leftEnd - leftStart, changeRangeStart, changeRangeEnd - changeRangeStart); } /* * Tests if two ranges are equal */ private static boolean rangesEqual(IRangeComparator a, int ai, IRangeComparator b, int bi) { return a.rangesEqual(ai, b, bi); } /* * Tests whether <code>right</code> and <code>left</code> changed in the same way */ private static boolean rangeSpansEqual(IRangeComparator right, int rightStart, int rightLen, IRangeComparator left, int leftStart, int leftLen) { if (rightLen == leftLen) { int i= 0; for (i= 0; i < rightLen; i++) { if (!rangesEqual(right, rightStart + i, left, leftStart + i)) break; } if (i == rightLen) return true; } return false; } /* * Reverses the range differences */ private static LinkedRangeDifference reverseDifferences(LinkedRangeDifference start) { LinkedRangeDifference ep, behind, ahead; ahead= start; ep= null; while (ahead != null) { behind= ep; ep= ahead; ahead= ahead.getNext(); ep.setNext(behind); } return ep; } } --- NEW FILE: LinkedRangeDifference.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.rangedifferencer; /* package */ class LinkedRangeDifference extends RangeDifference { static final int INSERT= 0; static final int DELETE= 1; LinkedRangeDifference fNext; /* * Creates a LinkedRangeDifference an initializes it to the error state */ LinkedRangeDifference() { super(ERROR); fNext= null; } /* * Constructs and links a LinkeRangeDifference to another LinkedRangeDifference */ LinkedRangeDifference(LinkedRangeDifference next, int operation) { super(operation); fNext= next; } /* * Follows the next link */ LinkedRangeDifference getNext() { return fNext; } boolean isDelete() { return kind() == DELETE; } boolean isInsert() { return kind() == INSERT; } /* * Sets the next link of this LinkedRangeDifference */ void setNext(LinkedRangeDifference next) { fNext= next; } } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:36
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/ui/views/navigator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/ui/views/navigator Added Files: ResourceSorter.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: ResourceSorter.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui.views.navigator; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; /** * Sorter for viewers that display items of type <code>IResource</code>. * The sorter supports two sort criteria: * <p> * <code>NAME</code>: Folders are given order precedence, followed by files. * Within these two groups resources are ordered by name. All name comparisons * are case-insensitive. * </p> * <p> * <code>TYPE</code>: Folders are given order precedence, followed by files. * Within these two groups resources are ordered by extension. All extension * comparisons are case-insensitive. * </p> * <p> * This class may be instantiated; it is not intended to be subclassed. * </p> */ public class ResourceSorter extends ViewerSorter { /** * Constructor argument value that indicates to sort items by name. */ public final static int NAME = 1; /** * Constructor argument value that indicates to sort items by extension. */ public final static int TYPE = 2; private int criteria; /** * Creates a resource sorter that will use the given sort criteria. * * @param criteria the sort criterion to use: one of <code>NAME</code> or * <code>TYPE</code> */ public ResourceSorter(int criteria) { super(); this.criteria = criteria; } /** * Returns an integer value representing the relative sort priority of the * given element based on its class. * <p> * <ul> * <li>resources (<code>IResource</code>) - 2</li> * <li>project references (<code>ProjectReference</code>) - 1</li> * <li>everything else - 0</li> * </ul> * </p> * * @param element the element * @return the sort priority (larger numbers means more important) */ protected int classComparison(Object element) { if (element instanceof IResource) { return 2; } return 0; } /* (non-Javadoc) * Method declared on ViewerSorter. */ public int compare(Viewer viewer, Object o1, Object o2) { //have to deal with non-resources in navigator //if one or both objects are not resources, returned a comparison //based on class. if (!(o1 instanceof IResource && o2 instanceof IResource)) { return compareClass(o1, o2); } IResource r1 = (IResource) o1; IResource r2 = (IResource) o2; if (r1 instanceof IContainer && r2 instanceof IContainer) return compareNames(r1, r2); else if (r1 instanceof IContainer) return -1; else if (r2 instanceof IContainer) return 1; else if (criteria == NAME) return compareNames(r1, r2); else if (criteria == TYPE) return compareTypes(r1, r2); else return 0; } /** * Returns a number reflecting the collation order of the given elements * based on their class. * * @param element1 the first element to be ordered * @param element2 the second element to be ordered * @return a negative number if the first element is less than the * second element; the value <code>0</code> if the first element is * equal to the second element; and a positive number if the first * element is greater than the second element */ protected int compareClass(Object element1, Object element2) { return classComparison(element1) - classComparison(element2); } /** * Returns a number reflecting the collation order of the given resources * based on their resource names. * * @param resource1 the first resource element to be ordered * @param resource2 the second resource element to be ordered * @return a negative number if the first element is less than the * second element; the value <code>0</code> if the first element is * equal to the second element; and a positive number if the first * element is greater than the second element */ protected int compareNames(IResource resource1, IResource resource2) { return collator.compare(resource1.getName(), resource2.getName()); } /** * Returns a number reflecting the collation order of the given resources * based on their respective file extensions. Resources with the same file * extension will be collated based on their names. * * @param resource1 the first resource element to be ordered * @param resource2 the second resource element to be ordered * @return a negative number if the first element is less than the * second element; the value <code>0</code> if the first element is * equal to the second element; and a positive number if the first * element is greater than the second element */ protected int compareTypes(IResource resource1, IResource resource2) { String ext1 = getExtensionFor(resource1); String ext2 = getExtensionFor(resource2); // Compare extensions. If they're different then return a value that // indicates correct extension ordering. If they're the same then // return a value that indicates the correct NAME ordering. int result = collator.compare(ext1, ext2); if (result != 0) // ie.- different extensions return result; return compareNames(resource1, resource2); } /** * Returns the sort criteria of this sorter. * * @return the sort criterion: one of <code>NAME</code> or <code>TYPE</code> */ public int getCriteria() { return criteria; } /** * Returns the extension portion of the given resource. * * @param resource the resource * @return the file extension, possibily the empty string */ private String getExtensionFor(IResource resource) { String ext = resource.getFileExtension(); return ext == null ? "" : ext; //$NON-NLS-1$ } /** * Sets the sort criteria of this sorter. * * @param criteria the sort criterion: * one of <code>ResourceSorter.NAME</code> or * <code>ResourceSorter.TYPE</code> */ public void setCriteria(int criteria) { this.criteria = criteria; } } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:35
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/icons/full/dtool16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/icons/full/dtool16 Added Files: ignorews_edit.gif conflict_edit.gif Log Message: Patched version of org.eclipse.compare --- NEW FILE: conflict_edit.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ignorews_edit.gif --- (This appears to be a binary file; contents omitted.) |
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/compare/internal/merge In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/compare/internal/merge Added Files: MergeMessages.properties MergeMessages.java TextStreamMerger.java LineComparator.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: MergeMessages.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.internal.merge; import org.eclipse.osgi.util.NLS; public final class MergeMessages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.compare.internal.merge.MergeMessages";//$NON-NLS-1$ private MergeMessages() { // Do not instantiate } public static String TextAutoMerge_inputEncodingError; public static String TextAutoMerge_outputEncodingError; public static String TextAutoMerge_outputIOError; public static String TextAutoMerge_conflict; static { NLS.initializeMessages(BUNDLE_NAME, MergeMessages.class); } } --- NEW FILE: MergeMessages.properties --- ############################################################################### # Copyright (c) 2004 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### TextAutoMerge_inputEncodingError= Unsupported encoding for input streams TextAutoMerge_outputEncodingError= Unsupported encoding for output streams TextAutoMerge_outputIOError= IO error on writing TextAutoMerge_conflict= Conflict: cannot auto merge --- NEW FILE: TextStreamMerger.java --- /******************************************************************************* * Copyright (c) 2003, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.internal.merge; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.UnsupportedEncodingException; import org.eclipse.compare.*; import org.eclipse.compare.rangedifferencer.RangeDifference; import org.eclipse.compare.rangedifferencer.RangeDifferencer; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; /** * A simple merger for streams containing text lines. */ public class TextStreamMerger implements IStreamMerger { /* * (non-Javadoc) * * @see org.eclipse.compare.internal.merge.IAutoMerger#automerge(java.io.OutputStream, * org.eclipse.core.resources.IEncodedStorage, * org.eclipse.core.resources.IEncodedStorage, * org.eclipse.core.resources.IEncodedStorage, * org.eclipse.core.runtime.IProgressMonitor) */ public IStatus merge(OutputStream output, String outputEncoding, InputStream ancestor, String ancestorEncoding, InputStream target, String targetEncoding, InputStream other, String otherEncoding, IProgressMonitor monitor) { LineComparator a, t, o; try { a= new LineComparator(ancestor, ancestorEncoding); t= new LineComparator(target, targetEncoding); o= new LineComparator(other, otherEncoding); } catch (UnsupportedEncodingException e) { return new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, 1, MergeMessages.TextAutoMerge_inputEncodingError, e); } try { String lineSeparator= System.getProperty("line.separator"); //$NON-NLS-1$ if (lineSeparator == null) lineSeparator= "\n"; //$NON-NLS-1$ RangeDifference[] diffs= RangeDifferencer.findRanges(monitor, a, t, o); for (int i= 0; i < diffs.length; i++) { RangeDifference rd= diffs[i]; switch (rd.kind()) { case RangeDifference.ANCESTOR: // pseudo conflict case RangeDifference.NOCHANGE: case RangeDifference.RIGHT: for (int j= rd.rightStart(); j < rd.rightEnd(); j++) { String s= o.getLine(j); output.write(s.getBytes(outputEncoding)); output.write(lineSeparator.getBytes(outputEncoding)); } break; case RangeDifference.LEFT: for (int j= rd.leftStart(); j < rd.leftEnd(); j++) { String s= t.getLine(j); output.write(s.getBytes(outputEncoding)); output.write(lineSeparator.getBytes(outputEncoding)); } break; case RangeDifference.CONFLICT: return new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, CONFLICT, MergeMessages.TextAutoMerge_conflict, null); default: break; } } } catch (UnsupportedEncodingException e) { return new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, 1, MergeMessages.TextAutoMerge_outputEncodingError, e); } catch (IOException e) { return new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, 1, MergeMessages.TextAutoMerge_outputIOError, e); } return Status.OK_STATUS; } } --- NEW FILE: LineComparator.java --- /******************************************************************************* * Copyright (c) 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.internal.merge; import java.io.*; import java.util.ArrayList; import org.eclipse.compare.rangedifferencer.IRangeComparator; /** * This implementation of IRangeComparator breaks an input stream into lines. */ class LineComparator implements IRangeComparator { private String[] fLines; public LineComparator(InputStream is, String encoding) throws UnsupportedEncodingException { BufferedReader br = new BufferedReader(new InputStreamReader(is, encoding)); String line; ArrayList ar = new ArrayList(); try { while ((line = br.readLine()) != null) ar.add(line); } catch (IOException e) { // silently ignored } // try { // is.close(); // } catch (IOException e1) { // } fLines = (String[]) ar.toArray(new String[ar.size()]); } String getLine(int ix) { return fLines[ix]; } /* (non-Javadoc) * @see org.eclipse.compare.rangedifferencer.IRangeComparator#getRangeCount() */ public int getRangeCount() { return fLines.length; } /* (non-Javadoc) * @see org.eclipse.compare.rangedifferencer.IRangeComparator#rangesEqual(int, org.eclipse.compare.rangedifferencer.IRangeComparator, int) */ public boolean rangesEqual(int thisIndex, IRangeComparator other, int otherIndex) { String s1 = fLines[thisIndex]; String s2 = ((LineComparator) other).fLines[otherIndex]; return s1.equals(s2); } /* (non-Javadoc) * @see org.eclipse.compare.rangedifferencer.IRangeComparator#skipRangeComparison(int, int, org.eclipse.compare.rangedifferencer.IRangeComparator) */ public boolean skipRangeComparison(int length, int maxLength, IRangeComparator other) { return false; } } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:35
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/icons/full/dlcl16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/icons/full/dlcl16 Added Files: copycont_r_co.gif ancestorpane_co.gif syncpane_co.gif prev_nav.gif twowaycompare_co.gif copy_r_co.gif copy_l_co.gif smartmode_co.gif copycont_l_co.gif next_nav.gif Log Message: Patched version of org.eclipse.compare --- NEW FILE: copy_r_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: copy_l_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: copycont_r_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: prev_nav.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: smartmode_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: next_nav.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: syncpane_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ancestorpane_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: copycont_l_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: twowaycompare_co.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:35
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/compare/org/eclipse/compare/contentmergeviewer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/compare/org/eclipse/compare/contentmergeviewer Added Files: package.html TextMergeViewerResources.properties IDocumentRange.java ITokenComparator.java IMergeViewerContentProvider.java TextMergeViewer.java ContentMergeViewer.java Log Message: Patched version of org.eclipse.compare --- NEW FILE: IDocumentRange.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.contentmergeviewer; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.IDocument; /** * Defines a subrange in a document. * <p> * It is used by text viewers that can work on a subrange of a document. For example, * a text viewer for Java compilation units might use this to restrict the view * to a single method. * </p> * <p> * Clients may implement this interface. * </p> * * @see TextMergeViewer * @see org.eclipse.compare.structuremergeviewer.DocumentRangeNode */ public interface IDocumentRange { /** * The position category typically used for an <code>IDocumentRange</code> position * (value <code>"DocumentRangeCategory"</code>). * @since 2.0 */ public static final String RANGE_CATEGORY= "DocumentRangeCategory"; //$NON-NLS-1$ /** * Returns the underlying document. * * @return the underlying document */ IDocument getDocument(); /** * Returns a position that specifies a subrange in the underlying document, * or <code>null</code> if this document range spans the whole underlying document. * * @return a position that specifies a subrange in the underlying document, or <code>null</code> */ Position getRange(); } --- NEW FILE: TextMergeViewerResources.properties --- ############################################################################### # Copyright (c) 2000, 2005 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html # # Contributors: # IBM Corporation - initial API and implementation ############################################################################### # NLS_MESSAGEFORMAT_VAR # @(#)TextMergeViewerResources.properties # # Resource strings for TextMergeViewer.java title= Text Compare saveDialog.title= Save Resource saveDialog.message= Resource has been modified. Save changes? compareProgressTask.title= Computing Differences... tooComplexError.title= Error # NLS_MESSAGEFORMAT_ALL tooComplexError.format= Too many differences. Turn on the ''Ignore White Space'' option or do a structure compare first. # NLS_MESSAGEFORMAT_VAR ##################################################### # Toolbar actions ##################################################### action.CopyLeftToRight.label=Copy Left to Right action.CopyLeftToRight.tooltip=Copy All from Left to Right action.CopyLeftToRight.image=copy_r_co.gif action.CopyRightToLeft.label=Copy Right to Left action.CopyRightToLeft.tooltip=Copy All Non-Conflicting Changes from Right to Left action.CopyRightToLeft.image=copy_l_co.gif action.CopyDiffLeftToRight.label=Copy Current Change to Right action.CopyDiffLeftToRight.tooltip=Copy Current Change from Left to Right action.CopyDiffLeftToRight.image=copycont_r_co.gif action.CopyDiffRightToLeft.label=Copy Current Change to Left action.CopyDiffRightToLeft.tooltip=Copy Current Change from Right to Left action.CopyDiffRightToLeft.image=copycont_l_co.gif action.NextDiff.label=Next action.NextDiff.tooltip=Select Next Change action.NextDiff.image=next_nav.gif action.PrevDiff.label=Previous action.PrevDiff.tooltip=Select Previous Change action.PrevDiff.image=prev_nav.gif action.EnableAncestor.label=Enable Ancestor Pane action.EnableAncestor.tooltip.unchecked=Show Ancestor Pane action.EnableAncestor.tooltip.checked=Hide Ancestor Pane action.EnableAncestor.description.unchecked=Show Ancestor Pane action.EnableAncestor.description.checked=Hide Ancestor Pane action.EnableAncestor.image=ancestorpane_co.gif action.IgnoreAncestor.label=Ignore Ancestor action.IgnoreAncestor.tooltip.unchecked=Two-Way Compare (Ignore Ancestor) action.IgnoreAncestor.tooltip.checked=Three-Way Compare action.IgnoreAncestor.description.unchecked=Two-Way Compare (Ignore Ancestor) action.IgnoreAncestor.description.checked=Three-Way Compare action.IgnoreAncestor.image=twowaycompare_co.gif ##################################################### # Context menu actions ##################################################### action.undo.label=Undo@Ctrl+Z action.undo.tooltip=Undo Last Operation action.redo.label=Redo@Ctrl+Y action.redo.tooltip=Redo Last Operation action.cut.label=Cut@Ctrl+X action.cut.tooltip=Cut Text Selection to Clipboard action.copy.label=Copy@Ctrl+C action.copy.tooltip=Copy Text Selection to Clipboard action.paste.label=Paste@Ctrl+V action.paste.tooltip=Replace Text Selection with Clipboard Contents action.delete.label=Delete action.delete.tooltip=Delete Current Text Selection action.find.label=Find...@Ctrl+F action.find.tooltip=Find Occurrence action.selectAll.label=Select All@Ctrl+A action.selectAll.tooltip=Select All Changes action.save.label=Save@Ctrl+S action.save.tooltip=Save Changes --- NEW FILE: IMergeViewerContentProvider.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.contentmergeviewer; import org.eclipse.swt.graphics.Image; import org.eclipse.jface.viewers.IContentProvider; /** * A content provider that mediates between a <code>ContentMergeViewer</code>'s model * and the viewer itself. * <p> * Clients may implement this interface. * </p> * * @see ContentMergeViewer */ public interface IMergeViewerContentProvider extends IContentProvider { //---- ancestor side /** * Returns the label for the ancestor side of a <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @return the label for the ancestor side of a <code>ContentMergeViewer</code> */ String getAncestorLabel(Object input); /** * Returns an optional image for the ancestor side of a <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @return the image for the ancestor side of a <code>ContentMergeViewer</code>, * or <code>null</code> if none */ Image getAncestorImage(Object input); /** * Returns the contents for the ancestor side of a <code>ContentMergeViewer</code>. * The interpretation of the returned object depends on the concrete <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @return the content for the ancestor side of a <code>ContentMergeViewer</code>, * or <code>null</code> if none */ Object getAncestorContent(Object input); /** * Returns whether the ancestor side of the given input element should be shown. * @param input the merge viewer's input * @return <code>true</code> if the ancestor side of the given input element should be shown */ boolean showAncestor(Object input); //---- left side /** * Returns the label for the left side of a <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @return the label for the left side of a <code>ContentMergeViewer</code> */ String getLeftLabel(Object input); /** * Returns an optional image for the left side of a <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @return the image for the left side of a <code>ContentMergeViewer</code>, * or <code>null</code> if none */ Image getLeftImage(Object input); /** * Returns the contents for the left side of a <code>ContentMergeViewer</code>. * The interpretation of the returned object depends on the concrete <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @return the content for the left side of a <code>ContentMergeViewer</code>, * or <code>null</code> if none */ Object getLeftContent(Object input); /** * Returns whether the left side is editable. * * @param input the input object of the <code>ContentMergeViewer</code> * @return <code>true</code> if the left side of a <code>ContentMergeViewer</code> is editable */ boolean isLeftEditable(Object input); /** * Saves new contents for the left side of the <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @param bytes the new contents to save for the left side */ void saveLeftContent(Object input, byte[] bytes); //---- right side /** * Returns the label for the right side of a <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @return the label for the right side of a <code>ContentMergeViewer</code> */ String getRightLabel(Object input); /** * Returns an optional image for the right side of a <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @return the image for the right side of a <code>ContentMergeViewer</code>, * or <code>null</code> if none */ Image getRightImage(Object input); /** * Returns the contents for the right side of a <code>ContentMergeViewer</code>. * The interpretation of the returned object depends on the concrete <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @return the content for the right side of a <code>ContentMergeViewer</code>, * or <code>null</code> if none */ Object getRightContent(Object input); /** * Returns whether the right side is editable. * * @param input the input object of the <code>ContentMergeViewer</code> * @return <code>true</code> if the right side of a <code>ContentMergeViewer</code> is editable */ boolean isRightEditable(Object input); /** * Saves new contents for the right side of the <code>ContentMergeViewer</code>. * * @param input the input object of the <code>ContentMergeViewer</code> * @param bytes the new contents to save for the right side */ void saveRightContent(Object input, byte[] bytes); } --- NEW FILE: package.html --- <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Author" content="IBM"> <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]"> <title>Package-level Javadoc</title> </head> <body> Support for compare and merge viewers which show the content side-by-side. <h2> Package Specification</h2> The <b>ContentMergeViewer</b> is an abstract compare and merge viewer with two side-by-side content areas and an optional content area for a common ancestor (for three-way compare). Because the implementation makes no assumptions about the content type it is a subclass responsibility to deal with a specific type. Its subclass <b>ImageMergeViewer</b> in package org.eclipse.compare.internal shows how to base a simple mergeviewer for images on <b>ContentMergeViewer</b>. <p> A <b>ContentMergeViewer</b> accesses its model by means of a content provider which must implement the <b>IMergeViewerContentProvider</b> interface. <p> The <b>TextMergeViewer</b> is the standard concrete subclass of <b>ContentMergeViewer</b> for comparing and merging text content. <br> A text merge viewer uses the <b>org.eclipse.compare.rangedifferencer.RangeDifferencer</b> to perform a textual, line-by-line comparison of two (or three) input documents. For text lines that differ the <b>TextMergeViewer</b> uses an <b>ITokenComparator</b> to find longest sequences of matching and non-matching tokens. The <b>TextMergeViewer</b>'s default token compare works on characters separated by whitespace. If a different strategy is needed (for example, Java tokens in a Java-aware merge viewer), clients can create their own token comparators by implementing the <b>ITokenComparator</b> interface. <p>The <b>TextMergeViewer</b> not only works on whole documents but on subranges of documents too. In this case the viewer's input must be an <b>IDocumentRange</b> instead of an <b>IDocument</b>. </body> </html> --- NEW FILE: ContentMergeViewer.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.contentmergeviewer; import java.util.ResourceBundle; import org.eclipse.swt.SWT; import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*; [...1005 lines suppressed...] boolean leftEmpty= content.getLeftContent(oldInput) == null; boolean rightEmpty= content.getRightContent(oldInput) == null; if (fCompareConfiguration.isLeftEditable() && fLeftSaveAction.isEnabled()) { byte[] bytes= getContents(true); if (leftEmpty && bytes != null && bytes.length == 0) bytes= null; setLeftDirty(false); content.saveLeftContent(oldInput, bytes); } if (fCompareConfiguration.isRightEditable() && fRightSaveAction.isEnabled()) { byte[] bytes= getContents(false); if (rightEmpty && bytes != null && bytes.length == 0) bytes= null; setRightDirty(false); content.saveRightContent(oldInput, bytes); } } } --- NEW FILE: TextMergeViewer.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * cha...@ma... - curved line code *******************************************************************************/ package org.eclipse.compare.contentmergeviewer; import java.util.List; import java.util.ArrayList; import java.util.Iterator; import java.util.Map; import java.util.HashMap; import java.util.ResourceBundle; [...4266 lines suppressed...] while (e.hasNext()) { Diff diff= (Diff) e.next(); Position pos= diff.getPosition(part); int viewHeight= part.getLineRange(pos, region).y; int virtualHeight= diff.getMaxDiffHeight(fShowAncestor); if (v < (virtualPos + virtualHeight)) { v-= virtualPos; // make relative to this slot if (viewHeight <= 0) { v= 0; } else { v= (v*viewHeight)/virtualHeight; } return viewPos+v; } virtualPos+= virtualHeight; viewPos+= viewHeight; } return viewPos; } } --- NEW FILE: ITokenComparator.java --- /******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.compare.contentmergeviewer; import org.eclipse.compare.rangedifferencer.IRangeComparator; /** * For performing a so-called "token compare" on a line of text. * This interface extends the <code>IRangeComparator</code> interface * so that it can be used by the <code>TextMergeViewer</code>. * <p> * <code>TextMergeViewer</code> activates the token compare when navigating into * a range of differing lines. At first the lines are selected as a block. * When navigating into this block the token compare shows for every line * the differing token by selecting them. * <p> * <code>TextMergeViewer</code>'s default token comparator works on characters separated * by whitespace. If a different strategy is needed (for example, to use Java tokens in * a Java-aware merge viewer), clients may create their own token * comparators by implementing this interface (and overriding the * <code>TextMergeViewer.createTokenComparator</code> factory method). * </p> * * @see TextMergeViewer */ public interface ITokenComparator extends IRangeComparator { /** * Returns the start character position of the token with the given index. * If the index is out of range (but not negative) the character position * behind the last character (the length of the input string) is returned. * * @param index index of the token for which to return the start position * @return the start position of the token with the given index * @throws java.lang.IndexOutOfBoundsException if index is negative */ int getTokenStart(int index); /** * Returns the character length of the token with the given index. * If the index is out of range (but not negative) the value 0 is returned. * * @param index index of the token for which to return the start position * @return the character length of the token with the given index * @throws java.lang.IndexOutOfBoundsException if index is negative */ int getTokenLength(int index); } |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:35
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/icons/full/obj16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/icons/full/obj16 Added Files: resource_obj.gif day_obj.gif Log Message: Patched version of org.eclipse.compare --- NEW FILE: resource_obj.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: day_obj.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Matthias K <mat...@us...> - 2006-03-21 22:19:35
|
Update of /cvsroot/jcommander/incubator/matthias_kue/org.jcommander.eclipsepatch.compare/icons/full/eview16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8063/icons/full/eview16 Added Files: compare_view.gif Log Message: Patched version of org.eclipse.compare --- NEW FILE: compare_view.gif --- (This appears to be a binary file; contents omitted.) |