KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ltk > core > refactoring > participants > ISharableParticipant


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.ltk.core.refactoring.participants;
12
13 /**
14  * A tagging interface to share a concrete participant instance across
15  * multiple elements to be refactored. Consider the example of moving
16  * more than one file: if a corresponding move participant is not
17  * tagged as a <code>ISharableParticipant</code> then a separate instance
18  * of a participant is created for every file to be moved. If the
19  * participant is marked as shared then only one instance is created
20  * and the participant is responsible to handle all files to be moved.
21  * <p>
22  * The first element to be refactored will be added to the participant
23  * via the participant specific <code>initialize(Object element)</code>
24  * method. All subsequent elements will be added via the generic <code>
25  * addElement(Object, RefactoringArguments)</code> method. Implementors
26  * of this interface can assume that the refactoring arguments passed
27  * to the <code>addElement</code> method conform to the participant. For
28  * example the arguments are of type <code>MoveArguments</code> if this
29  * interface is mixed into a move participant.
30  * </p>
31  * <p>
32  * Clients may implement this interface to tag participants as shared.
33  * </p>
34  *
35  * @since 3.0
36  */

37 public interface ISharableParticipant {
38
39     /**
40      * Adds the given element and argument to the refactoring participant.
41      *
42      * @param element the element to add
43      * @param arguments the corresponding arguments
44      */

45     public void addElement(Object JavaDoc element, RefactoringArguments arguments);
46 }
47
Popular Tags