MCPcopy Create free account
hub / github.com/bobbylight/RText / propertyChange

Method propertyChange

src/main/java/org/fife/rtext/StatusBar.java:257–286  ·  view source on GitHub ↗

Called whenever a property changes on a component we're listening to. @param e The event.

(PropertyChangeEvent e)

Source from the content-addressed store, hash-verified

255 * @param e The event.
256 */
257 @Override
258 public void propertyChange(PropertyChangeEvent e) {
259
260 String property = e.getPropertyName();
261
262 // If a file was just saved...
263 if (property.equals(RTextEditorPane.DIRTY_PROPERTY)) {
264 boolean wasDirty = (Boolean)e.getOldValue();
265 boolean isDirty = (Boolean)e.getNewValue();
266 if (wasDirty && !isDirty)
267 setStatusMessage(fileSaveSuccessfulText);
268 }
269
270 // If they opened a file...
271 else if (property.equals(AbstractMainView.TEXT_AREA_ADDED_PROPERTY)) {
272 RTextEditorPane textArea = (RTextEditorPane)e.getNewValue();
273 setStatusMessage(MessageFormat.format(openedFileText,
274 textArea.getFileName()));
275 }
276
277 // If they saved a read-only file with a different filename (hence it
278 // is now not read-only)...
279 // NOTE: We don't have the "else" below because we'll get both this
280 // property change notification and a DIRTY_PROPERTY one.
281 if (property.equals(RTextEditorPane.READ_ONLY_PROPERTY)) {
282 boolean enabled = (Boolean)e.getNewValue();
283 setReadOnlyIndicatorEnabled(enabled);
284 }
285
286 }
287
288
289 /**

Callers

nothing calls this directly

Calls 5

getOldValueMethod · 0.80
getNewValueMethod · 0.80
equalsMethod · 0.45
getFileNameMethod · 0.45

Tested by

no test coverage detected