⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mp3infoproviderfactory.java

📁 eclise rcp 项目,是非常好的学习源码
💻 JAVA
字号:
/*******************************************************************************
 * Copyright (c) 2007 Siemens AG
 * 
 * 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:
 *    Kai T鰀ter - initial API and implementation
 *******************************************************************************/

package com.siemens.ct.mp3m.model;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;

import com.siemens.ct.mp3m.utilities.LogUtil;


public class MP3InfoProviderFactory {
    private static MP3InfoProviderFactory factory;

    private IMP3InfoProvider currentProvider;

    /**
     * Creates the only instance of the factory.
     */
    private MP3InfoProviderFactory() {
        IConfigurationElement[] providers = Platform.getExtensionRegistry()
                .getConfigurationElementsFor("com.siemens.ct.mp3m.model", "mp3info");
        for (IConfigurationElement provider : providers) {
            try {
                currentProvider = (IMP3InfoProvider) provider.createExecutableExtension("class");
            } catch (CoreException e) {
            	LogUtil.logError("com.siemens.ct.mp3m.model",e);
            }
        }
    }

    public static MP3InfoProviderFactory getInstance() {
        if (factory == null) {
            factory = new MP3InfoProviderFactory();
        }
        return factory;
    }

    public IMP3Info getMP3Info() {
        return currentProvider.getMP3Info();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -