KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > compare > contentmergeviewer > IMergeViewerContentProvider


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.compare.contentmergeviewer;
12
13 import org.eclipse.swt.graphics.Image;
14 import org.eclipse.jface.viewers.IContentProvider;
15
16
17 /**
18  * A content provider that mediates between a <code>ContentMergeViewer</code>'s model
19  * and the viewer itself.
20  * <p>
21  * Clients may implement this interface.
22  * </p>
23  *
24  * @see ContentMergeViewer
25  */

26 public interface IMergeViewerContentProvider extends IContentProvider {
27     
28     //---- ancestor side
29

30     /**
31      * Returns the label for the ancestor side of a <code>ContentMergeViewer</code>.
32      *
33      * @param input the input object of the <code>ContentMergeViewer</code>
34      * @return the label for the ancestor side of a <code>ContentMergeViewer</code>
35      */

36     String JavaDoc getAncestorLabel(Object JavaDoc input);
37
38     /**
39      * Returns an optional image for the ancestor side of a <code>ContentMergeViewer</code>.
40      *
41      * @param input the input object of the <code>ContentMergeViewer</code>
42      * @return the image for the ancestor side of a <code>ContentMergeViewer</code>,
43      * or <code>null</code> if none
44      */

45     Image getAncestorImage(Object JavaDoc input);
46
47     /**
48      * Returns the contents for the ancestor side of a <code>ContentMergeViewer</code>.
49      * The interpretation of the returned object depends on the concrete <code>ContentMergeViewer</code>.
50      *
51      * @param input the input object of the <code>ContentMergeViewer</code>
52      * @return the content for the ancestor side of a <code>ContentMergeViewer</code>,
53      * or <code>null</code> if none
54      */

55     Object JavaDoc getAncestorContent(Object JavaDoc input);
56
57     /**
58      * Returns whether the ancestor side of the given input element should be shown.
59      * @param input the merge viewer's input
60      * @return <code>true</code> if the ancestor side of the given input element should be shown
61      */

62     boolean showAncestor(Object JavaDoc input);
63     
64     //---- left side
65

66     /**
67      * Returns the label for the left side of a <code>ContentMergeViewer</code>.
68      *
69      * @param input the input object of the <code>ContentMergeViewer</code>
70      * @return the label for the left side of a <code>ContentMergeViewer</code>
71      */

72     String JavaDoc getLeftLabel(Object JavaDoc input);
73
74     /**
75      * Returns an optional image for the left side of a <code>ContentMergeViewer</code>.
76      *
77      * @param input the input object of the <code>ContentMergeViewer</code>
78      * @return the image for the left side of a <code>ContentMergeViewer</code>,
79      * or <code>null</code> if none
80      */

81     Image getLeftImage(Object JavaDoc input);
82
83     /**
84      * Returns the contents for the left side of a <code>ContentMergeViewer</code>.
85      * The interpretation of the returned object depends on the concrete <code>ContentMergeViewer</code>.
86      *
87      * @param input the input object of the <code>ContentMergeViewer</code>
88      * @return the content for the left side of a <code>ContentMergeViewer</code>,
89      * or <code>null</code> if none
90      */

91     Object JavaDoc getLeftContent(Object JavaDoc input);
92
93     /**
94      * Returns whether the left side is editable.
95      *
96      * @param input the input object of the <code>ContentMergeViewer</code>
97      * @return <code>true</code> if the left side of a <code>ContentMergeViewer</code> is editable
98      */

99     boolean isLeftEditable(Object JavaDoc input);
100
101     /**
102      * Saves new contents for the left side of the <code>ContentMergeViewer</code>.
103      *
104      * @param input the input object of the <code>ContentMergeViewer</code>
105      * @param bytes the new contents to save for the left side
106      */

107     void saveLeftContent(Object JavaDoc input, byte[] bytes);
108
109     //---- right side
110

111     /**
112      * Returns the label for the right side of a <code>ContentMergeViewer</code>.
113      *
114      * @param input the input object of the <code>ContentMergeViewer</code>
115      * @return the label for the right side of a <code>ContentMergeViewer</code>
116      */

117     String JavaDoc getRightLabel(Object JavaDoc input);
118
119     /**
120      * Returns an optional image for the right side of a <code>ContentMergeViewer</code>.
121      *
122      * @param input the input object of the <code>ContentMergeViewer</code>
123      * @return the image for the right side of a <code>ContentMergeViewer</code>,
124      * or <code>null</code> if none
125      */

126     Image getRightImage(Object JavaDoc input);
127
128     /**
129      * Returns the contents for the right side of a <code>ContentMergeViewer</code>.
130      * The interpretation of the returned object depends on the concrete <code>ContentMergeViewer</code>.
131      *
132      * @param input the input object of the <code>ContentMergeViewer</code>
133      * @return the content for the right side of a <code>ContentMergeViewer</code>,
134      * or <code>null</code> if none
135      */

136     Object JavaDoc getRightContent(Object JavaDoc input);
137
138     /**
139      * Returns whether the right side is editable.
140      *
141      * @param input the input object of the <code>ContentMergeViewer</code>
142      * @return <code>true</code> if the right side of a <code>ContentMergeViewer</code> is editable
143      */

144     boolean isRightEditable(Object JavaDoc input);
145
146     /**
147      * Saves new contents for the right side of the <code>ContentMergeViewer</code>.
148      *
149      * @param input the input object of the <code>ContentMergeViewer</code>
150      * @param bytes the new contents to save for the right side
151      */

152     void saveRightContent(Object JavaDoc input, byte[] bytes);
153 }
154
155
156
Popular Tags