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

Method propertyChange

src/main/java/org/fife/rtext/RText.java:1073–1095  ·  view source on GitHub ↗

Called whenever a property changes for a component we are registered as listening to.

(PropertyChangeEvent e)

Source from the content-addressed store, hash-verified

1071 * as listening to.
1072 */
1073 @Override
1074 public void propertyChange(PropertyChangeEvent e) {
1075
1076 String propertyName = e.getPropertyName();
1077
1078 // If the file's path is changing (must be caused by the file being saved(?))...
1079 if (propertyName.equals(RTextEditorPane.FULL_PATH_PROPERTY)) {
1080 setTitle((String)e.getNewValue());
1081 }
1082
1083 // If the file's modification status is changing...
1084 else if (propertyName.equals(RTextEditorPane.DIRTY_PROPERTY)) {
1085 String oldTitle = getTitle();
1086 boolean newValue = (Boolean)e.getNewValue();
1087 if (!newValue) {
1088 setTitle(oldTitle.substring(0,oldTitle.length()-1));
1089 }
1090 else {
1091 setTitle(oldTitle + '*');
1092 }
1093 }
1094
1095 }
1096
1097
1098 void registerChildWindowListeners(Window w) {

Callers

nothing calls this directly

Calls 4

setTitleMethod · 0.95
getTitleMethod · 0.95
getNewValueMethod · 0.80
equalsMethod · 0.45

Tested by

no test coverage detected