Author: rob.stryker(a)jboss.com
Date: 2008-08-26 17:39:00 -0400 (Tue, 26 Aug 2008)
New Revision: 9912
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java
Log:
JBIDE-2692 - refreshing archives view after preference change
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java 2008-08-26
21:31:20 UTC (rev 9911)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java 2008-08-26
21:39:00 UTC (rev 9912)
@@ -3,6 +3,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
+import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
+import org.jboss.ide.eclipse.archives.ui.PrefsInitializer.IArchivesPreferenceListener;
import
org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
/**
@@ -13,10 +15,12 @@
* @author rob.stryker(a)redhat.com
*
*/
-public class ArchivesRootBridgeContentProvider implements ITreeContentProvider {
+public class ArchivesRootBridgeContentProvider
+ implements ITreeContentProvider, IArchivesPreferenceListener {
private ArchivesContentProviderDelegate delegate;
public ArchivesRootBridgeContentProvider() {
delegate = new ArchivesContentProviderDelegate(WrappedProject.CATEGORY);
+ PrefsInitializer.addListener(this);
}
public Object[] getChildren(Object parentElement) {
@@ -38,10 +42,17 @@
}
public void dispose() {
+ PrefsInitializer.removeListener(this);
}
+ private Viewer viewer;
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ this.viewer = viewer;
delegate.inputChanged(viewer, oldInput, newInput);
}
+ public void preferenceChanged(String key, boolean val) {
+ viewer.refresh();
+ }
+
}
Show replies by date