Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -34,7 +34,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.osgi.util.NLS;

public class WorkspaceRoot extends Container implements IWorkspaceRoot {
Expand Down Expand Up @@ -123,8 +122,9 @@ public String getDefaultCharset(boolean checkImplicit) {
if (checkImplicit) {
return ResourcesPlugin.getEncoding();
}
String enc = ResourcesPlugin.getPlugin().getPluginPreferences().getString(ResourcesPlugin.PREF_ENCODING);
return enc == null || enc.length() == 0 ? null : enc;
String enc = Platform.getPreferencesService().getString(ResourcesPlugin.PI_RESOURCES,
ResourcesPlugin.PREF_ENCODING, "", null); //$NON-NLS-1$
return enc.isEmpty() ? null : enc;
}

@Override
Expand Down Expand Up @@ -284,18 +284,6 @@ public boolean isPhantom() {
return false;
}

@Deprecated
@Override
public void setDefaultCharset(String charset) {
// directly change the Resource plugin's preference for encoding
Preferences resourcesPreferences = ResourcesPlugin.getPlugin().getPluginPreferences();
if (charset != null) {
resourcesPreferences.setValue(ResourcesPlugin.PREF_ENCODING, charset);
} else {
resourcesPreferences.setToDefault(ResourcesPlugin.PREF_ENCODING);
}
}

@Override
public void setHidden(boolean isHidden) {
//workspace root cannot be set hidden
Expand Down
Loading