Lines 51-56
Link Here
|
51 |
* @since 3.14 |
51 |
* @since 3.14 |
52 |
*/ |
52 |
*/ |
53 |
public abstract class StatusDisplayer { |
53 |
public abstract class StatusDisplayer { |
|
|
54 |
|
55 |
/** |
56 |
* Default message 'importance' for file annotations. |
57 |
*/ |
58 |
public static final int IMPORTANCE_ANNOTATION = 1000; |
59 |
/** |
60 |
* Default message 'importance' for messages from incremental find. |
61 |
*/ |
62 |
public static final int IMPORTANCE_INCREMENTAL_FIND = 900; |
63 |
/** |
64 |
* Default message 'importance' for messages from find and replace actions. |
65 |
*/ |
66 |
public static final int IMPORTANCE_FIND_OR_REPLACE = 800; |
67 |
/** |
68 |
* Default message 'importance' for error and warning messages on current line. |
69 |
*/ |
70 |
public static final int IMPORTANCE_ERROR_HIGHLIGHT = 700; |
71 |
|
54 |
private static StatusDisplayer INSTANCE = null; |
72 |
private static StatusDisplayer INSTANCE = null; |
55 |
|
73 |
|
56 |
/** Subclass constructor. */ |
74 |
/** Subclass constructor. */ |
Lines 89-98
Link Here
|
89 |
* <p class="nonnormative">Default implementation of status line in NetBeans |
107 |
* <p class="nonnormative">Default implementation of status line in NetBeans |
90 |
* displays the text in status line and clears it after a while. |
108 |
* displays the text in status line and clears it after a while. |
91 |
* Also there is no guarantee how long the text will be displayed as |
109 |
* Also there is no guarantee how long the text will be displayed as |
92 |
* it can be replaced with new call to this method at any time. |
110 |
* it can be replaced with new call to this method at any time.</p> |
|
|
111 |
* <p>Note: The text may not show in the status line at all if some |
112 |
* other text with higher importance is currently showing in the status line.</p> |
93 |
* @param text the text to be shown |
113 |
* @param text the text to be shown |
|
|
114 |
* @see #setStatusText(String,int) |
94 |
*/ |
115 |
*/ |
95 |
public abstract void setStatusText(String text); |
116 |
public abstract void setStatusText(String text); |
|
|
117 |
|
118 |
/** |
119 |
* <p>Show text in the status line. <code>importance</code> argument |
120 |
* indicates that the text should stay in the status line until it is replaced |
121 |
* with new text by calling <code>setStatusText(String,int)</code> again with |
122 |
* the same or higher importance value.</p> |
123 |
* <p>The text will be removed from status line when this method's return value is |
124 |
* garbage-collected or excplicitly by calling <code>Message.clear(int)</code>. |
125 |
* @param text The text to be shown until some other text with the same or higher |
126 |
* importance is passed into the status line. |
127 |
* @param importance Positive integer defining the 'Importance' of the message |
128 |
* to be displayed, the higher number the higher importance. |
129 |
* @return Handle associated with given status line text. The text will be removed |
130 |
* from status line either after calling <code>clear(int)</code> on this handle or when |
131 |
* the <code>Message</code> object is garbage-collected. |
132 |
* @throws IllegalArgumentException If importance <= 0 |
133 |
*/ |
134 |
public Message setStatusText(String text, int importance) { |
135 |
setStatusText(text); |
136 |
return new Message(); |
137 |
} |
96 |
|
138 |
|
97 |
/** Add a listener for when the text changes. |
139 |
/** Add a listener for when the text changes. |
98 |
* @param l a listener |
140 |
* @param l a listener |
Lines 103-108
Link Here
|
103 |
* @param l a listener |
145 |
* @param l a listener |
104 |
*/ |
146 |
*/ |
105 |
public abstract void removeChangeListener(ChangeListener l); |
147 |
public abstract void removeChangeListener(ChangeListener l); |
|
|
148 |
|
149 |
/** |
150 |
* Handle for 'important' status line messages. The message will be removed |
151 |
* from status line when this object is garbage-collected. |
152 |
* |
153 |
* @see #setStatusText(String,int) |
154 |
*/ |
155 |
public static class Message { |
156 |
/** |
157 |
* Removes this message from status line after <code>timeInMillis</code> |
158 |
* milliseconds. |
159 |
* @param timeInMillis |
160 |
*/ |
161 |
public void clear(int timeInMillis) { |
162 |
} |
163 |
} |
106 |
|
164 |
|
107 |
/** |
165 |
/** |
108 |
* Trivial default impl for standalone usage. |
166 |
* Trivial default impl for standalone usage. |