Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 263814
Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/context/core/LocalContextStore.java (+21 lines)
Lines 27-32 Link Here
27
import org.eclipse.core.runtime.Status;
27
import org.eclipse.core.runtime.Status;
28
import org.eclipse.mylyn.commons.core.StatusHandler;
28
import org.eclipse.mylyn.commons.core.StatusHandler;
29
import org.eclipse.mylyn.context.core.ContextCore;
29
import org.eclipse.mylyn.context.core.ContextCore;
30
import org.eclipse.mylyn.context.core.ICloneContextParticipant;
30
import org.eclipse.mylyn.context.core.IContextStore;
31
import org.eclipse.mylyn.context.core.IContextStore;
31
import org.eclipse.mylyn.context.core.IInteractionContext;
32
import org.eclipse.mylyn.context.core.IInteractionContext;
32
import org.eclipse.mylyn.context.core.IInteractionContextScaling;
33
import org.eclipse.mylyn.context.core.IInteractionContextScaling;
Lines 172-177 Link Here
172
173
173
	public IInteractionContext cloneContext(String sourceContextHandle, String destinationContextHandle) {
174
	public IInteractionContext cloneContext(String sourceContextHandle, String destinationContextHandle) {
174
175
176
		ICloneContextParticipant[] participants = getCloneParticipants();
177
178
		if (participants != null) {
179
			for (ICloneContextParticipant participant : participants) {
180
				participant.contextAboutToBeCloned(sourceContextHandle, destinationContextHandle);
181
			}
182
		}
183
175
		InteractionContext readContext = (InteractionContext) externalizer.readContextFromXml(sourceContextHandle,
184
		InteractionContext readContext = (InteractionContext) externalizer.readContextFromXml(sourceContextHandle,
176
				getFileForContext(sourceContextHandle), commonContextScaling);
185
				getFileForContext(sourceContextHandle), commonContextScaling);
177
186
Lines 189-197 Link Here
189
//			StatusHandler.log(new Status(IStatus.WARNING, ContextCorePlugin.ID_PLUGIN, "Could not copy context from: "
198
//			StatusHandler.log(new Status(IStatus.WARNING, ContextCorePlugin.ID_PLUGIN, "Could not copy context from: "
190
//					+ sourceContextHandle));
199
//					+ sourceContextHandle));
191
//		}
200
//		}
201
202
		if (participants != null) {
203
			for (ICloneContextParticipant participant : participants) {
204
				participant.contextCloned(sourceContextHandle, destinationContextHandle);
205
			}
206
		}
207
192
		return readContext;
208
		return readContext;
193
	}
209
	}
194
210
211
	private ICloneContextParticipant[] getCloneParticipants() {
212
		// TODO: implement bug 263814
213
		return null;
214
	}
215
195
	public boolean hasContext(String handleIdentifier) {
216
	public boolean hasContext(String handleIdentifier) {
196
		Assert.isNotNull(handleIdentifier);
217
		Assert.isNotNull(handleIdentifier);
197
		File file = getFileForContext(handleIdentifier);
218
		File file = getFileForContext(handleIdentifier);
(-)plugin.xml (+1 lines)
Lines 4-7 Link Here
4
   <extension-point id="bridges" name="bridges" schema="schema/bridges.exsd"/>
4
   <extension-point id="bridges" name="bridges" schema="schema/bridges.exsd"/>
5
   <extension-point id="internalBridges" name="Internal Bridges" schema="schema/internalBridges.exsd"/>
5
   <extension-point id="internalBridges" name="Internal Bridges" schema="schema/internalBridges.exsd"/>
6
   <extension-point id="relationProviders" name="relationProviders" schema="schema/relationProviders.exsd"/>
6
   <extension-point id="relationProviders" name="relationProviders" schema="schema/relationProviders.exsd"/>
7
   <extension-point id="cloneContextParticipant" name="Clone Context Participant" schema="schema/cloneContextParticipant.exsd"/>
7
</plugin>
8
</plugin>
(-)schema/cloneContextParticipant.exsd (+114 lines)
Added Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.mylyn.context.core" xmlns="http://www.w3.org/2001/XMLSchema">
4
<annotation>
5
      <appinfo>
6
         <meta.schema plugin="org.eclipse.mylyn.context.core" id="cloneContextParticipant" name="Clone Context Participant"/>
7
      </appinfo>
8
      <documentation>
9
         Provides a mechanism to participate in task context cloning.
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <annotation>
15
         <appinfo>
16
            <meta.element />
17
         </appinfo>
18
      </annotation>
19
      <complexType>
20
         <sequence>
21
            <element ref="cloneContextParticipant" minOccurs="1" maxOccurs="unbounded"/>
22
         </sequence>
23
         <attribute name="point" type="string" use="required">
24
            <annotation>
25
               <documentation>
26
                  
27
               </documentation>
28
            </annotation>
29
         </attribute>
30
         <attribute name="id" type="string">
31
            <annotation>
32
               <documentation>
33
                  
34
               </documentation>
35
            </annotation>
36
         </attribute>
37
         <attribute name="name" type="string">
38
            <annotation>
39
               <documentation>
40
                  
41
               </documentation>
42
               <appinfo>
43
                  <meta.attribute translatable="true"/>
44
               </appinfo>
45
            </annotation>
46
         </attribute>
47
      </complexType>
48
   </element>
49
50
   <element name="cloneContextParticipant">
51
      <complexType>
52
         <attribute name="class" type="string">
53
            <annotation>
54
               <documentation>
55
                  
56
               </documentation>
57
               <appinfo>
58
                  <meta.attribute kind="java" basedOn=":org.eclipse.mylyn.context.core.ICloneContextParticipant"/>
59
               </appinfo>
60
            </annotation>
61
         </attribute>
62
      </complexType>
63
   </element>
64
65
   <annotation>
66
      <appinfo>
67
         <meta.section type="since"/>
68
      </appinfo>
69
      <documentation>
70
         [Enter the first release in which this extension point appears.]
71
      </documentation>
72
   </annotation>
73
74
   <annotation>
75
      <appinfo>
76
         <meta.section type="examples"/>
77
      </appinfo>
78
      <documentation>
79
         [Enter extension point usage example here.]
80
      </documentation>
81
   </annotation>
82
83
   <annotation>
84
      <appinfo>
85
         <meta.section type="apiinfo"/>
86
      </appinfo>
87
      <documentation>
88
         [Enter API information here.]
89
      </documentation>
90
   </annotation>
91
92
   <annotation>
93
      <appinfo>
94
         <meta.section type="implementation"/>
95
      </appinfo>
96
      <documentation>
97
         [Enter information about supplied implementation of this extension point.]
98
      </documentation>
99
   </annotation>
100
101
   <annotation>
102
      <appinfo>
103
         <meta.section type="copyright"/>
104
      </appinfo>
105
      <documentation>
106
         Copyright (c) 2009 David Green and others.
107
All rights reserved. This program and the accompanying materials
108
are made available under the terms of the Eclipse Public License v1.0
109
which accompanies this distribution, and is available at
110
http://www.eclipse.org/legal/epl-v10.html
111
      </documentation>
112
   </annotation>
113
114
</schema>
(-)src/org/eclipse/mylyn/context/core/ICloneContextParticipant.java (+38 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 David Green 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
 *     David Green - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.context.core;
13
14
import org.eclipse.core.runtime.CoreException;
15
16
/**
17
 * implementors can participate in context cloning
18
 * 
19
 * @author David Green
20
 * 
21
 * @see IContextStore#cloneContext(String, String)
22
 */
23
public interface ICloneContextParticipant {
24
25
	/**
26
	 * Called when a context is about to be cloned.
27
	 * 
28
	 * @return true if cloning should proceed, otherwise false.
29
	 */
30
	public boolean contextAboutToBeCloned(String sourceContextHandle, String destinationContextHandle)
31
			throws CoreException;
32
33
	/**
34
	 * Called when a context has been cloned
35
	 */
36
	public void contextCloned(String sourceContextHandle, String destinationContextHandle) throws CoreException;
37
38
}

Return to bug 263814