Lines 7-13
Link Here
|
7 |
* http://www.sun.com/ |
7 |
* http://www.sun.com/ |
8 |
* |
8 |
* |
9 |
* The Original Code is NetBeans. The Initial Developer of the Original |
9 |
* The Original Code is NetBeans. The Initial Developer of the Original |
10 |
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2002 Sun |
10 |
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun |
11 |
* Microsystems, Inc. All Rights Reserved. |
11 |
* Microsystems, Inc. All Rights Reserved. |
12 |
*/ |
12 |
*/ |
13 |
|
13 |
|
Lines 19-25
Link Here
|
19 |
|
19 |
|
20 |
//import org.openide.util.Lookup; |
20 |
//import org.openide.util.Lookup; |
21 |
|
21 |
|
|
|
22 |
import org.netbeans.api.diff.DiffView; |
22 |
import org.netbeans.api.diff.Difference; |
23 |
import org.netbeans.api.diff.Difference; |
|
|
24 |
import org.netbeans.api.diff.StreamSource; |
23 |
|
25 |
|
24 |
/** |
26 |
/** |
25 |
* This class represents a diff visualizer. It's used as a presenter of a visual |
27 |
* This class represents a diff visualizer. It's used as a presenter of a visual |
Lines 55-58
Link Here
|
55 |
public abstract Component createView(Difference[] diffs, String name1, String title1, |
57 |
public abstract Component createView(Difference[] diffs, String name1, String title1, |
56 |
Reader r1, String name2, String title2, |
58 |
Reader r1, String name2, String title2, |
57 |
Reader r2, String MIMEType) throws IOException ; |
59 |
Reader r2, String MIMEType) throws IOException ; |
|
|
60 |
/** |
61 |
* Creates single-window diff component that does not include any navigation controls and |
62 |
* is controlled programatically via the returned DiffView interface. |
63 |
* <p> |
64 |
* The StreamSource can be used to save the source content if it's modified |
65 |
* in the view. The view should not allow source modification if StreamSource.createWriter() |
66 |
* returns <code>null</code>. |
67 |
* |
68 |
* @param s1 the first source |
69 |
* @param s2 the second source |
70 |
* @return DiffView controller interface |
71 |
* |
72 |
*/ |
73 |
public DiffView createDiff(Difference[] diffs, StreamSource s1, StreamSource s2) throws IOException { |
74 |
throw new UnsupportedOperationException("This operation is not supported"); |
75 |
} |
58 |
} |
76 |
} |
59 |
* Sun Public License Notice |
77 |
* Sun Public License Notice |
60 |
* |
78 |
* |
61 |
* The contents of this file are subject to the Sun Public License |
79 |
* The contents of this file are subject to the Sun Public License |
62 |
* Version 1.0 (the "License"). You may not use this file except in |
80 |
* Version 1.0 (the "License"). You may not use this file except in |
63 |
* compliance with the License. A copy of the License is available at |
81 |
* compliance with the License. A copy of the License is available at |
64 |
* http://www.sun.com/ |
82 |
* http://www.sun.com/ |
65 |
* |
83 |
* |
66 |
* The Original Code is NetBeans. The Initial Developer of the Original |
84 |
* The Original Code is NetBeans. The Initial Developer of the Original |
67 |
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun |
85 |
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun |
68 |
* Microsystems, Inc. All Rights Reserved. |
86 |
* Microsystems, Inc. All Rights Reserved. |
69 |
*/ |
87 |
*/ |
70 |
* Controller interface that allows external code to control the DIFF component. |
88 |
* Controller interface that allows external code to control the DIFF component. |
71 |
* |
89 |
* |
72 |
* @author Maros Sandor, Martin Entlicher |
90 |
* @author Maros Sandor, Martin Entlicher |
73 |
*/ |
91 |
*/ |
74 |
|
92 |
|
75 |
/** |
93 |
/** |
76 |
* This property is fired when the difference count has changed. |
94 |
* This property is fired when the difference count has changed. |
77 |
*/ |
95 |
*/ |
78 |
public static final String PROP_DIFF_COUNT = "diffCount"; // NOI18N |
96 |
public static final String PROP_DIFF_COUNT = "diffCount"; // NOI18N |
79 |
/** |
97 |
/** |
80 |
* Gets the visual DIFF component that modules can include in their GUI. |
98 |
* Gets the visual DIFF component that modules can include in their GUI. |
81 |
* |
99 |
* |
82 |
* @return Component |
100 |
* @return Component |
83 |
*/ |
101 |
*/ |
84 |
public Component getComponent(); |
102 |
public Component getComponent(); |
85 |
|
103 |
|
86 |
/** |
104 |
/** |
87 |
* Gets the number of differences found in sources. |
105 |
* Gets the number of differences found in sources. |
88 |
* |
106 |
* |
89 |
* @return int |
107 |
* @return int |
90 |
*/ |
108 |
*/ |
91 |
public int getDiffCount(); |
109 |
public int getDiffCount(); |
92 |
|
110 |
|
93 |
/** |
111 |
/** |
94 |
* Test whether this view can change the current difference. |
112 |
* Test whether this view can change the current difference. |
95 |
* This is expected to be true when the view has a visual indication |
113 |
* This is expected to be true when the view has a visual indication |
96 |
* of the current difference. |
114 |
* of the current difference. |
97 |
*/ |
115 |
*/ |
98 |
public boolean canSetCurrentDiff(); |
116 |
public boolean canSetCurrentDiff(); |
99 |
/** |
117 |
/** |
100 |
* Instructs the DIFF view to navigate to the n-th difference. |
118 |
* Instructs the DIFF view to navigate to the n-th difference. |
101 |
* |
119 |
* |
102 |
* @param diffNo The difference number |
120 |
* @param diffNo The difference number |
103 |
* @throws UnsupportedOperationException iff {@link #canSetCurrentDiff} |
121 |
* @throws UnsupportedOperationException iff {@link #canSetCurrentDiff} |
104 |
* returns <code>false</code>. |
122 |
* returns <code>false</code>. |
105 |
*/ |
123 |
*/ |
106 |
public void setCurrentDifference(int diffNo) throws UnsupportedOperationException; |
124 |
public void setCurrentDifference(int diffNo) throws UnsupportedOperationException; |
107 |
|
125 |
|
108 |
/** |
126 |
/** |
109 |
* Get the current difference that is displayed in the view. |
127 |
* Get the current difference that is displayed in the view. |
110 |
* |
128 |
* |
111 |
* @return The current difference number |
129 |
* @return The current difference number |
112 |
* @throws UnsupportedOperationException iff {@link #canSetCurrentDiff} |
130 |
* @throws UnsupportedOperationException iff {@link #canSetCurrentDiff} |
113 |
* returns <code>false</code>. |
131 |
* returns <code>false</code>. |
114 |
*/ |
132 |
*/ |
115 |
public int getCurrentDifference() throws UnsupportedOperationException; |
133 |
public int getCurrentDifference() throws UnsupportedOperationException; |
116 |
|
134 |
|
117 |
/** |
135 |
/** |
118 |
* Get a toolbar, that is adviced to be displayed together with the component |
136 |
* Get a toolbar, that is adviced to be displayed together with the component |
119 |
* obtained from {@link #getComponent}. |
137 |
* obtained from {@link #getComponent}. |
120 |
* |
138 |
* |
121 |
* @return the toolbar or <code>null</code> when no toolbar is provided by |
139 |
* @return the toolbar or <code>null</code> when no toolbar is provided by |
122 |
* this view. |
140 |
* this view. |
123 |
*/ |
141 |
*/ |
124 |
public JToolBar getToolBar(); |
142 |
public JToolBar getToolBar(); |
125 |
|
143 |
|
126 |
/** |
144 |
/** |
127 |
* Add a property change listener. |
145 |
* Add a property change listener. |
128 |
* @param l The property change listener |
146 |
* @param l The property change listener |
129 |
*/ |
147 |
*/ |
130 |
public void addPropertyChangeListener(PropertyChangeListener l); |
148 |
public void addPropertyChangeListener(PropertyChangeListener l); |
131 |
|
149 |
|
132 |
/** |
150 |
/** |
133 |
* Remove a property change listener. |
151 |
* Remove a property change listener. |
134 |
* @param l The property change listener |
152 |
* @param l The property change listener |
135 |
*/ |
153 |
*/ |
136 |
public void removePropertyChangeListener(PropertyChangeListener l); |
154 |
public void removePropertyChangeListener(PropertyChangeListener l); |
137 |
|
155 |
|