david_williams | dce4ddd | 2005-03-18 05:35:37 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2001, 2004 IBM Corporation and others. |
| 3 | * All rights reserved. This program and the accompanying materials |
| 4 | * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | * which accompanies this distribution, and is available at |
| 6 | * http://www.eclipse.org/legal/epl-v10.html |
| 7 | * |
| 8 | * Contributors: |
| 9 | * IBM Corporation - initial API and implementation |
| 10 | * Jens Lukowski/Innoopract - initial renaming/restructuring |
| 11 | * |
| 12 | *******************************************************************************/ |
| 13 | package org.eclipse.wst.sse.core.internal.encoding.util; |
| 14 | |
david_williams | dce4ddd | 2005-03-18 05:35:37 +0000 | [diff] [blame] | 15 | import org.eclipse.core.resources.IWorkspace; |
| 16 | import org.eclipse.core.resources.ResourcesPlugin; |
| 17 | import org.eclipse.core.runtime.Plugin; |
| 18 | import org.eclipse.core.runtime.Preferences; |
| 19 | import org.eclipse.wst.sse.core.internal.encoding.CommonEncodingPreferenceNames; |
| 20 | import org.eclipse.wst.sse.core.internal.encoding.ICodedResourcePlugin; |
| 21 | |
| 22 | /** |
| 23 | * The main plugin class to be used in the desktop. |
| 24 | */ |
| 25 | public class CodedResourcePlugin extends Plugin implements ICodedResourcePlugin { |
| 26 | //The shared instance. |
| 27 | private static CodedResourcePlugin plugin; |
david_williams | dce4ddd | 2005-03-18 05:35:37 +0000 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Returns the shared instance. |
| 31 | */ |
| 32 | public static CodedResourcePlugin getDefault() { |
| 33 | return plugin; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Returns the workspace instance. |
| 38 | */ |
| 39 | public static IWorkspace getWorkspace() { |
| 40 | return ResourcesPlugin.getWorkspace(); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * The constructor. |
| 45 | */ |
| 46 | public CodedResourcePlugin() { |
| 47 | super(); |
| 48 | plugin = this; |
| 49 | } |
| 50 | |
| 51 | protected void initializeDefaultPluginPreferences() { |
| 52 | Preferences prefs = getPluginPreferences(); |
| 53 | prefs.setDefault(CommonEncodingPreferenceNames.USE_3BYTE_BOM_WITH_UTF8, false); |
| 54 | } |
david_williams | dce4ddd | 2005-03-18 05:35:37 +0000 | [diff] [blame] | 55 | } |