KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > diff > DiffView


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.api.diff;
21
22 import java.awt.Component JavaDoc;
23 import java.beans.PropertyChangeListener JavaDoc;
24 import javax.swing.JToolBar JavaDoc;
25
26 /**
27  * Controller interface that allows external code to control the DIFF component.
28  *
29  * @author Maros Sandor, Martin Entlicher
30  */

31 public interface DiffView {
32
33     /**
34      * This property is fired when the difference count has changed.
35      */

36     public static final String JavaDoc PROP_DIFF_COUNT = "diffCount"; // NOI18N
37

38     /**
39      * Gets the visual DIFF component that modules can include in their GUI.
40      *
41      * @return Component
42      */

43     public Component JavaDoc getComponent();
44     
45     /**
46      * Gets the number of differences found in sources.
47      *
48      * @return int
49      */

50     public int getDifferenceCount();
51     
52     /**
53      * Test whether this view can change the current difference.
54      * This is expected to be true when the view has a visual indication
55      * of the current difference.
56      */

57     public boolean canSetCurrentDifference();
58
59     /**
60      * Instructs the DIFF view to navigate to the n-th difference.
61      *
62      * @param diffNo The difference number (-1 means hide current difference visualization)
63      * @throws UnsupportedOperationException iff {@link #canSetCurrentDifference}
64      * returns <code>false</code>.
65      */

66     public void setCurrentDifference(int diffNo) throws UnsupportedOperationException JavaDoc;
67     
68     /**
69      * Get the current difference that is displayed in the view.
70      *
71      * @return The current difference number
72      * @throws UnsupportedOperationException iff {@link #canSetCurrentDifference}
73      * returns <code>false</code>.
74      */

75     public int getCurrentDifference() throws UnsupportedOperationException JavaDoc;
76     
77     /**
78      * Get a toolbar, that is adviced to be displayed together with the component
79      * obtained from {@link #getComponent}.
80      *
81      * @return the toolbar or <code>null</code> when no toolbar is provided by
82      * this view.
83      */

84     public JToolBar JavaDoc getToolBar();
85     
86     /**
87      * Add a property change listener.
88      * @param l The property change listener
89      */

90     public void addPropertyChangeListener(PropertyChangeListener JavaDoc l);
91     
92     /**
93      * Remove a property change listener.
94      * @param l The property change listener
95      */

96     public void removePropertyChangeListener(PropertyChangeListener JavaDoc l);
97     
98 }
99
Popular Tags