git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH 01/11] Add support code to handle plugin property changes

From
Tor Arne Vestbø <torarnv@gmail.com>
Date
Feb 5, 2009, 01:00 UTC
Message-ID
<1233795618-20249-2-git-send-email-torarnv@gmail.com>
In-Reply-To
<1233795618-20249-1-git-send-email-torarnv@gmail.com>
Signed-off-by: Tor Arne Vestbø <torarnv@gmail.com>
---
 .../src/org/spearce/egit/ui/Activator.java         |   52 ++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/Activator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/Activator.java
index fced643..d4a9e8e 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/Activator.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/Activator.java
@@ -10,9 +10,11 @@
 
 import java.net.Authenticator;
 import java.net.ProxySelector;
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
+import java.util.List;
 import java.util.Set;
 
 import org.eclipse.core.net.proxy.IProxyService;
@@ -27,6 +29,8 @@
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.core.runtime.jobs.ISchedulingRule;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.jsch.core.IJSchService;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -44,9 +48,24 @@
  * This is a plugin singleton mostly controlling logging.
  */
 public class Activator extends AbstractUIPlugin {
+
+	/**
+	 *  The one and only instance
+	 */
 	private static Activator plugin;
 
 	/**
+	 * Property listeners for plugin specific events
+	 */
+	private static List<IPropertyChangeListener> propertyChangeListeners =
+		new ArrayList<IPropertyChangeListener>(5);
+
+	/**
+	 * Property constant indicating the decorator configuration has changed.
+	 */
+	public static final String DECORATORS_CHANGED = "org.spearce.egit.ui.DECORATORS_CHANGED"; //$NON-NLS-1$
+
+	/**
 	 * @return the {@link Activator} singleton.
 	 */
 	public static Activator getDefault() {
@@ -167,6 +186,39 @@ private void setupRepoIndexRefresh() {
 		Repository.addAnyRepositoryChangedListener(refreshJob);
 	}
 
+	/**
+	 * Register for changes made to Team properties.
+	 * 
+	 * @param listener
+	 *            The listener to register
+	 */
+	public static void addPropertyChangeListener(
+			IPropertyChangeListener listener) {
+		propertyChangeListeners.add(listener);
+	}
+
+	/**
+	 * Remove a Team property changes.
+	 * 
+	 * @param listener
+	 *            The listener to remove
+	 */
+	public static void removePropertyChangeListener(
+			IPropertyChangeListener listener) {
+		propertyChangeListeners.remove(listener);
+	}
+
+	/**
+	 * Broadcast a Team property change.
+	 * 
+	 * @param event
+	 *            The event to broadcast
+	 */
+	public static void broadcastPropertyChange(PropertyChangeEvent event) {
+		for (IPropertyChangeListener listener : propertyChangeListeners)
+			listener.propertyChange(event);
+	}
+
 	static class RIRefresh extends Job implements RepositoryListener {
 
 		RIRefresh() {
-- 
1.6.1.2.309.g2ea3
Previous: Tor Arne VestbøNext: Tor Arne Vestbø
Message 2 of 31 in “Support customizable label decorations”
  1. 00/11 Support customizable label decorationsTor Arne Vestbø, Feb 5, 2009
  2. 01/11 Add support code to handle plugin property changesTor Arne Vestbø, Feb 5, 2009
  3. 02/11 Use Set instead of array to keep track of change listenersTor Arne Vestbø, Feb 5, 2009
  4. 03/11 Add a specialized team exception for GitTor Arne Vestbø, Feb 5, 2009
  5. 04/11 Add new class ExceptionCollector for grouping exceptionsTor Arne Vestbø, Feb 5, 2009
  6. 05/11 Add new class SWTUtils with helper-methods for creating controlsTor Arne Vestbø, Feb 5, 2009
  7. 06/11 Implement basic customizable label decorations with preferencesTor Arne Vestbø, Feb 5, 2009
  8. 07/11 Add binding for name of the current branchTor Arne Vestbø, Feb 5, 2009
  9. 08/11 Add icon decoration for tracked and untracked resourcesTor Arne Vestbø, Feb 5, 2009
  10. 09/11 Implement decorations of dirty, staged, and conflicting resourcesTor Arne Vestbø, Feb 5, 2009
  11. 10/11 Don't decorate every single resource on repository changeTor Arne Vestbø, Feb 5, 2009
  12. 11/11 Implement label decorations for folders and projectsTor Arne Vestbø, Feb 5, 2009
  13. Robin RosenbergFeb 5, 2009
  14. Tor Arne VestbøFeb 5, 2009
  15. Tor Arne VestbøFeb 5, 2009
  16. Robin RosenbergFeb 5, 2009
  17. Tor Arne VestbøFeb 5, 2009
  18. Robin RosenbergFeb 5, 2009
  19. Shawn O. PearceFeb 5, 2009
  20. Tor Arne VestbøFeb 5, 2009
  21. 02/11 Use Set instead of array to keep track of change listenersTor Arne Vestbø, Feb 5, 2009
  22. Shawn O. PearceFeb 5, 2009
  23. Tor Arne VestbøFeb 5, 2009
  24. Shawn O. PearceFeb 5, 2009
  25. Add support code to handle plugin property changesTor Arne Vestbø, Feb 5, 2009
  26. Tor Arne VestbøFeb 5, 2009
  27. Shawn O. PearceFeb 5, 2009
  28. Tor Arne VestbøFeb 5, 2009
  29. Robin RosenbergFeb 5, 2009
  30. Tor Arne VestbøFeb 5, 2009
  31. Robin RosenbergFeb 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.