Lines 41-46
Link Here
|
41 |
*/ |
41 |
*/ |
42 |
package org.netbeans.modules.versioning.core.spi; |
42 |
package org.netbeans.modules.versioning.core.spi; |
43 |
|
43 |
|
|
|
44 |
import java.io.File; |
44 |
import java.io.IOException; |
45 |
import java.io.IOException; |
45 |
import java.util.Date; |
46 |
import java.util.Date; |
46 |
import javax.swing.Action; |
47 |
import javax.swing.Action; |
Lines 115-120
Link Here
|
115 |
private Action[] actions; |
116 |
private Action[] actions; |
116 |
private RevisionProvider revisionProvider; |
117 |
private RevisionProvider revisionProvider; |
117 |
private MessageEditProvider mep; |
118 |
private MessageEditProvider mep; |
|
|
119 |
private ParentProvider parentProvider; |
118 |
|
120 |
|
119 |
/** |
121 |
/** |
120 |
* Creates a new HistoryEntry instance. |
122 |
* Creates a new HistoryEntry instance. |
Lines 188-193
Link Here
|
188 |
} |
190 |
} |
189 |
|
191 |
|
190 |
/** |
192 |
/** |
|
|
193 |
* Creates a new HistoryEntry instance. |
194 |
* |
195 |
* @param files involved files |
196 |
* @param dateTime the date and time when the versioning revision was created |
197 |
* @param message the message describing the versioning revision |
198 |
* @param username full description of the user who created the versioning revision |
199 |
* @param usernameShort short description of the user who created the versioning revision |
200 |
* @param revision full description of the versioning revision |
201 |
* @param revisionShort short description of the versioning revision |
202 |
* @param actions actions which might be called in regard with this revision |
203 |
* @param revisionProvider a RevisionProvider to get access to a files contents in this revision |
204 |
* @param messageEditProvider a MessageEditProvider to change a revisions message |
205 |
* @param parentProvider a ParentProvider to provide this entries parent entry. Not necessary for VCS |
206 |
* where a revisions parent always is the time nearest previous revision. |
207 |
* |
208 |
*/ |
209 |
public HistoryEntry( |
210 |
VCSFileProxy[] files, |
211 |
Date dateTime, |
212 |
String message, |
213 |
String username, |
214 |
String usernameShort, |
215 |
String revision, |
216 |
String revisionShort, |
217 |
Action[] actions, |
218 |
RevisionProvider revisionProvider, |
219 |
MessageEditProvider messageEditProvider, |
220 |
ParentProvider parentProvider) |
221 |
{ |
222 |
this(files, dateTime, message, username, usernameShort, revision, revisionShort, actions, revisionProvider, messageEditProvider); |
223 |
this.parentProvider = parentProvider; |
224 |
} |
225 |
|
226 |
/** |
191 |
* Determines if this HistoryEntry instance supports changes. |
227 |
* Determines if this HistoryEntry instance supports changes. |
192 |
* |
228 |
* |
193 |
* @return true if it is possible to access setter methods in this instance |
229 |
* @return true if it is possible to access setter methods in this instance |
Lines 298-305
Link Here
|
298 |
revisionProvider.getRevisionFile(originalFile, revisionFile); |
334 |
revisionProvider.getRevisionFile(originalFile, revisionFile); |
299 |
} |
335 |
} |
300 |
} |
336 |
} |
|
|
337 |
|
338 |
/** |
339 |
* Returns this revisions parent entry or null if not available. |
340 |
* |
341 |
* @param file the file for whitch the parent HistoryEntry should be returned |
342 |
* @return this revisions parent entry |
343 |
*/ |
344 |
public HistoryEntry getParentEntry(VCSFileProxy file) { |
345 |
if(parentProvider != null) { |
346 |
return parentProvider.getParentEntry(file); |
301 |
} |
347 |
} |
|
|
348 |
return null; |
349 |
} |
302 |
|
350 |
|
|
|
351 |
} |
352 |
|
303 |
/** |
353 |
/** |
304 |
* Adds a listener for history change events. |
354 |
* Adds a listener for history change events. |
305 |
* |
355 |
* |
Lines 357-362
Link Here
|
357 |
} |
407 |
} |
358 |
|
408 |
|
359 |
/** |
409 |
/** |
|
|
410 |
* Implement and pass over to a {@link HistoryEntry} in case you want |
411 |
* {@link HistoryEntry#getParentProvider()} to return relevant values. |
412 |
* |
413 |
* @since 1.30 |
414 |
*/ |
415 |
public interface ParentProvider { |
416 |
/** |
417 |
* Return a {@link HistoryEntry} representing the parent of the {@link HistoryEntry} |
418 |
* configured with this ParentProvider. |
419 |
* |
420 |
* @param file the file for whitch the parent HistoryEntry should be returned |
421 |
* @return the parent HistoryEntry |
422 |
*/ |
423 |
HistoryEntry getParentEntry(VCSFileProxy file); |
424 |
} |
425 |
|
426 |
/** |
360 |
* Event notifying a change in the history of some files. |
427 |
* Event notifying a change in the history of some files. |
361 |
*/ |
428 |
*/ |
362 |
public static final class HistoryEvent { |
429 |
public static final class HistoryEvent { |