KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > mapping > provider > MergeStatus


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.core.mapping.provider;
12
13 import org.eclipse.core.resources.IFile;
14 import org.eclipse.core.resources.mapping.ResourceMapping;
15 import org.eclipse.core.runtime.IStatus;
16 import org.eclipse.core.runtime.Status;
17 import org.eclipse.team.core.mapping.IMergeStatus;
18
19 /**
20  * A special status that is returned when the return code
21  * of the <code>merge</code> method is <code>CONFLICTS</code>.
22  * It is possible that there were problems that caused the
23  * auto-merge to fail. In that case, the implementor of
24  * <code>IResourceMappingMerger</code> can return a multi-status
25  * in which one of the children is a <code>MergeStatus</code> and
26  * the others describe other problems that were encountered.
27  *
28  * @see org.eclipse.team.core.mapping.IResourceMappingMerger
29  *
30  * @since 3.2
31  */

32 public class MergeStatus extends Status implements IMergeStatus {
33     
34     private ResourceMapping[] conflictingMappings;
35     private IFile[] conflictingFiles;
36
37     /**
38      * Create a merge status for reporting that some of the resource mappings
39      * for which a merge was attempted were not auto-mergable.
40      * @param pluginId the plugin id
41      * @param message the message for the status
42      * @param conflictingMappings the mappings which were not auto-mergable
43      */

44     public MergeStatus(String JavaDoc pluginId, String JavaDoc message, ResourceMapping[] conflictingMappings) {
45         super(IStatus.ERROR, pluginId, CONFLICTS, message, null);
46         this.conflictingMappings = conflictingMappings;
47     }
48
49     /**
50      * Create a merge status for reporting that some of the files
51      * for which a merge was attempted were not auto-mergable.
52      * @param pluginId the plugin id
53      * @param message the message for the status
54      * @param files the files which were not auto-mergable
55      */

56     public MergeStatus(String JavaDoc pluginId, String JavaDoc message, IFile[] files) {
57         super(IStatus.ERROR, pluginId, CONFLICTS, message, null);
58         this.conflictingFiles = files;
59     }
60
61     /* (non-Javadoc)
62      * @see org.eclipse.team.ui.mapping.IMergeStatus#getConflictingMappings()
63      */

64     public ResourceMapping[] getConflictingMappings() {
65         return conflictingMappings;
66     }
67     
68     /* (non-Javadoc)
69      * @see org.eclipse.team.ui.mapping.IMergeStatus#getConflictingFiles()
70      */

71     public IFile[] getConflictingFiles() {
72         return conflictingFiles;
73     }
74 }
75
Popular Tags