Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-06-18 11:59:19 +0000
committerLars Vogel2020-06-18 14:05:07 +0000
commit427efc516331c0ddb2f824c8d7d81749710840e9 (patch)
treebb5cd1506e2246322b9498fe6449ec28ca4c96f0
parentee5884e01fe2684358d2284759171887a3f00009 (diff)
downloadeclipse.platform.ui-427efc516331c0ddb2f824c8d7d81749710840e9.tar.gz
eclipse.platform.ui-427efc516331c0ddb2f824c8d7d81749710840e9.tar.xz
eclipse.platform.ui-427efc516331c0ddb2f824c8d7d81749710840e9.zip
Bug 564144 - Removes
org/eclipse/ui/internal/preferences/PreferenceStoreAdapter.java Full text search also showed no usage Change-Id: I6029484398daa0f157a82fab0db2a05d14a30b38
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceStoreAdapter.java101
1 files changed, 0 insertions, 101 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceStoreAdapter.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceStoreAdapter.java
deleted file mode 100644
index 68bb1943465..00000000000
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/preferences/PreferenceStoreAdapter.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2019 IBM Corporation and others.
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ui.internal.preferences;
-
-import java.util.Set;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-
-/**
- * @since 3.1
- */
-public final class PreferenceStoreAdapter extends PropertyMapAdapter {
-
- private IPreferenceStore store;
-
- private IPropertyChangeListener listener = event -> firePropertyChange(event.getProperty());
-
- public PreferenceStoreAdapter(IPreferenceStore toConvert) {
- this.store = toConvert;
- }
-
- @Override
- protected void attachListener() {
- store.addPropertyChangeListener(listener);
- }
-
- @Override
- protected void detachListener() {
- store.removePropertyChangeListener(listener);
- }
-
- @Override
- public Set<String> keySet() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Object getValue(String propertyId, Class propertyType) {
- if (propertyType.isAssignableFrom(String.class)) {
- return store.getString(propertyId);
- }
-
- if (propertyType == Boolean.class) {
- return store.getBoolean(propertyId) ? Boolean.TRUE : Boolean.FALSE;
- }
-
- if (propertyType == Double.class) {
- return Double.valueOf(store.getDouble(propertyId));
- }
-
- if (propertyType == Float.class) {
- return Float.valueOf(store.getFloat(propertyId));
- }
-
- if (propertyType == Integer.class) {
- return Integer.valueOf(store.getInt(propertyId));
- }
-
- if (propertyType == Long.class) {
- return Long.valueOf(store.getLong(propertyId));
- }
-
- return null;
- }
-
- @Override
- public boolean propertyExists(String propertyId) {
- return store.contains(propertyId);
- }
-
- @Override
- public void setValue(String propertyId, Object newValue) {
- if (newValue instanceof String) {
- store.setValue(propertyId, (String) newValue);
- } else if (newValue instanceof Integer) {
- store.setValue(propertyId, ((Integer) newValue).intValue());
- } else if (newValue instanceof Boolean) {
- store.setValue(propertyId, ((Boolean) newValue).booleanValue());
- } else if (newValue instanceof Double) {
- store.setValue(propertyId, ((Double) newValue).doubleValue());
- } else if (newValue instanceof Float) {
- store.setValue(propertyId, ((Float) newValue).floatValue());
- } else if (newValue instanceof Integer) {
- store.setValue(propertyId, ((Integer) newValue).intValue());
- } else if (newValue instanceof Long) {
- store.setValue(propertyId, ((Long) newValue).longValue());
- }
- }
-
-}

Back to the top