Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornitind2008-11-28 19:58:37 +0000
committernitind2008-11-28 19:58:37 +0000
commitfc4fb68a1b0da4201288261912a83b647a970238 (patch)
treef0a2773af842fdf4635bc18d37a108e1cf011bb7 /bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java
parent027990080f12c16bc02d3a65748113fd9c56e658 (diff)
downloadwebtools.sourceediting-200811282000.tar.gz
webtools.sourceediting-200811282000.tar.xz
webtools.sourceediting-200811282000.zip
This commit was manufactured by cvs2svn to create tag 'v200811282000'.v200811282000
Diffstat (limited to 'bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java')
-rw-r--r--bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java85
1 files changed, 0 insertions, 85 deletions
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java
deleted file mode 100644
index 67d0aec21f..0000000000
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentoutline/PropertyChangeUpdateActionContributionItem.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- *
- *******************************************************************************/
-package org.eclipse.wst.sse.ui.internal.contentoutline;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * A listener on the given action's PreferenceStore. It calls .update() on the
- * action when the given key changes value.
- */
-public class PropertyChangeUpdateActionContributionItem extends ActionContributionItem {
-
- private class PreferenceUpdateListener implements IPropertyChangeListener {
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(fProperty)) {
- if (debug) {
- System.out.println(fProperty + " preference changed, updating " + getAction()); //$NON-NLS-1$
- }
- ((IUpdate) getAction()).update();
- }
- }
- }
-
- static final boolean debug = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.sse.ui/propertyChangeUpdateActionContributionItem")); //$NON-NLS-1$ //$NON-NLS-2$;
-
- private IPropertyChangeListener fListener = null;
-
- protected String fProperty = null;
- private IPreferenceStore fStore;
-
- public PropertyChangeUpdateActionContributionItem(PropertyChangeUpdateAction action) {
- super(action);
- fProperty = action.getPreferenceKey();
- fStore = action.getPreferenceStore();
- fListener = new PreferenceUpdateListener();
- connect();
- }
-
- public void connect() {
- if (debug) {
- System.out.println("PropertyChangeUpdateActionContributionItem started listening for " + fProperty); //$NON-NLS-1$
- }
- if (fStore != null) {
- fStore.addPropertyChangeListener(fListener);
- }
- }
-
- public void disconnect() {
- if (debug) {
- System.out.println("PropertyChangeUpdateActionContributionItem stopped listening for " + fProperty); //$NON-NLS-1$
- }
- if (fStore != null) {
- fStore.removePropertyChangeListener(fListener);
- }
- }
-
- public void dispose() {
- super.dispose();
- disconnect();
- fProperty = null;
- fStore = null;
- }
-
- public String toString() {
- if (getAction().getId() != null)
- return super.toString();
- else
- return getClass().getName() + "(text=" + getAction().getText() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-}

Back to the top