Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv28825/src/net/sourceforge/csseditor/internal/editor
Modified Files:
ShowSelectedElementOnlyAction.java
Log Message:
Cleanup
Index: ShowSelectedElementOnlyAction.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor/ShowSelectedElementOnlyAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ShowSelectedElementOnlyAction.java 27 Dec 2003 18:46:55 -0000 1.2
--- ShowSelectedElementOnlyAction.java 13 Jan 2004 17:06:30 -0000 1.3
***************
*** 52,56 ****
super(CssEditorMessages.getResourceBundle(),
"CssEditor.showSelectedElementOnly.", null); //$NON-NLS-1$
! this.store = CssEditorPlugin.getDefault().getPreferenceStore();
update();
}
--- 52,56 ----
super(CssEditorMessages.getResourceBundle(),
"CssEditor.showSelectedElementOnly.", null); //$NON-NLS-1$
! store = CssEditorPlugin.getDefault().getPreferenceStore();
update();
}
***************
*** 73,80 ****
highlightRange.getLength(), true);
}
! this.store.removePropertyChangeListener(this);
! this.store.setValue(
CssEditorPreferences.EDITOR_SHOW_SELECTED_ELEMENT_ONLY, show);
! this.store.addPropertyChangeListener(this);
}
}
--- 73,80 ----
highlightRange.getLength(), true);
}
! store.removePropertyChangeListener(this);
! store.setValue(
CssEditorPreferences.EDITOR_SHOW_SELECTED_ELEMENT_ONLY, show);
! store.addPropertyChangeListener(this);
}
}
***************
*** 86,97 ****
super.setEditor(editor);
if (editor != null) {
! if (this.store == null) {
! this.store = CssEditorPlugin.getDefault().getPreferenceStore();
! this.store.addPropertyChangeListener(this);
}
synchronizeWithPreference(editor);
! } else if (this.store != null) {
! this.store.removePropertyChangeListener(this);
! this.store = null;
}
update();
--- 86,97 ----
super.setEditor(editor);
if (editor != null) {
! if (store == null) {
! store = CssEditorPlugin.getDefault().getPreferenceStore();
! store.addPropertyChangeListener(this);
}
synchronizeWithPreference(editor);
! } else if (store != null) {
! store.removePropertyChangeListener(this);
! store = null;
}
update();
***************
*** 128,131 ****
--- 128,133 ----
* Synchronizes the appearance of the editor with what the preference store
* contains.
+ *
+ * @param editor the editor to synchronize
*/
private void synchronizeWithPreference(ITextEditor editor) {
|