private Shell shell;\r
private Button close;\r
private int index;\r
- private Browser tipArea;\r
+ protected Browser tipArea;\r
private String fontName;\r
private TipStyle style;\r
private Image image;\r
/**\r
* Fill the tip area with the selected tip\r
*/\r
- private void fillTipArea() {\r
+ protected void fillTipArea() {\r
this.tipArea.setText("<html><body bgcolor=\"#ffffff\" text=\"#000000\"><p style=\"font-family:" + this.fontName + ";font-size=12px\">" //\r
+ this.tips.get(this.index) + "</p></body></html>");\r
}\r
* @param composite parent composite\r
* @param gridData associated grid data\r
*/\r
- private void buildShowOnStartup(final Composite composite, final GridData gridData) {\r
+ protected void buildShowOnStartup(final Composite composite, final GridData gridData) {\r
final Button checkBox = new Button(composite, SWT.CHECK);\r
checkBox.setLayoutData(gridData);\r
checkBox.setText(ResourceManager.getLabel(ResourceManager.SHOW_TIP_AT_STARTUP));\r
org.mihalis.opal.preferenceWindow,
org.mihalis.opal.preferenceWindow.widgets,
org.mihalis.opal.promptSupport,
+ org.mihalis.opal.tipOfTheDay,
+ org.mihalis.opal.utils,
org.tizen.common.project.util,
org.tizen.common.sign.preferences
Export-Package: org.tizen.common.ui,
Bundle-Vendor = The Linux Foundation
Bundle-Name = Tizen Common UI
-
wizard.preferences.name = Wizard
-
extension-point.commandbar = Command Bar Extension
+extension-point.tipoftheday = Tip of the day Extension
\ No newline at end of file
<?eclipse version="3.4"?>\r
<plugin>\r
<extension-point id="org.tizen.common.ui.commandbar" name="%extension-point.commandbar" schema="schema/org.tizen.common.ui.commandbar.exsd"/>\r
+ <extension-point id="org.tizen.common.ui.tipoftheday" name="%extension-point.tipoftheday" schema="schema/org.tizen.common.ui.tipoftheday.exsd"/>\r
<extension\r
point="org.eclipse.ui.commands">\r
<category\r
<startup\r
class="org.tizen.common.ui.commandbar.Startup"></startup>\r
</extension>\r
+ <extension\r
+ point="org.eclipse.ui.startup">\r
+ <startup\r
+ class="org.tizen.common.ui.dialog.StartUp">\r
+ </startup>\r
+ </extension>\r
<extension point="org.eclipse.ui.menus">\r
<group id="org.tizen.common.ui.commandbar" separatorsVisible="true">\r
<location>\r
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"\r
sequence="M1+M2+C">\r
</key>\r
- </extension>\r
+ </extension>
</plugin>\r
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.tizen.common.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.tizen.common.ui" id="org.tizen.common.ui.tipoftheday" name="Tip of the day Extension"/>
+ </appinfo>
+ <documentation>
+ Provides the extension point for the tip of the day.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="tip"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="tip">
+ <complexType>
+ <attribute name="file" type="string">
+ <annotation>
+ <documentation>
+ tip html file path
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="resource"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="url" type="string">
+ <annotation>
+ <documentation>
+ tip url
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ <extension
+ point="org.tizen.common.ui.tipoftheday">
+ <tip
+ file="tips/tip.html"
+ </tip>
+</extension>
+
+<extension
+ point="org.tizen.common.ui.tipoftheday">
+ <tip
+ url="http://www.tizen.org"
+ </tip>
+</extension>
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
* Contact:
*
* Yoonki Park <yoonki.park@samsung.com>
+* Changhyun Lee <changhyun1.lee@samsung.com>
* Kangho Kim <kh5325.kim@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
import org.eclipse.ui.IStartup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
import static org.tizen.common.core.application.InstallPathConfig.*;
public class Startup implements IStartup {
- private static final Logger logger = LoggerFactory.getLogger(Startup.class);
+
+ protected static final Logger logger = LoggerFactory.getLogger(Startup.class);
@Override
public void earlyStartup() {
// some hack Eclipse log (because log4j might not be configured properly)
org.tizen.common.util.log.Logger.info(info);
}
+
}
import java.net.URL;
import java.util.Arrays;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
-import org.osgi.framework.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.ui.Activator;
+import org.tizen.common.util.PluginUtil;
import org.tizen.common.util.SWTUtil;
/**
}
public static String getColorPickerURL() {
- Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
- Path path = new Path(COLORPICKER_HOME);
- URL fColorPickerUrl = null;
- try {
- fColorPickerUrl = FileLocator.toFileURL(FileLocator.find(bundle, path, null));
- } catch (Exception e) {
- logger.error("Failed to find a colorpicker", e);
+ URL fColorPickerUrl = PluginUtil.getFileURLinBundle( Activator.PLUGIN_ID, COLORPICKER_HOME );
+ if ( fColorPickerUrl != null ) {
+ return fColorPickerUrl.toString();
}
- return fColorPickerUrl.toString();
+ return null;
}
/**
--- /dev/null
+/*
+* Common
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+*
+* Contact:
+* Changhyun Lee <changhyun1.lee@samsung.com>
+* Kangho Kim <kh5325.kim@samsung.com>
+* Hyeongseok Heo <hyeongseok.heo@samsung.com>
+* Bonyong Lee <bonyong.lee@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
+package org.tizen.common.ui.dialog;
+
+import java.net.URL;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IStartup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.tizen.common.CommonPlugin;
+import org.tizen.common.ui.page.preference.TizenBasePreferencePage;
+import org.tizen.common.util.PluginUtil;
+import org.tizen.common.util.SWTUtil;
+import org.tizen.common.util.StringUtil;
+
+/**
+ * StartUp
+ *
+ * @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
+ */
+public class StartUp implements IStartup {
+
+ protected static final Logger logger = LoggerFactory.getLogger(StartUp.class);
+
+ public static final String EXTENTION_POINT_TIPOFTHEDAY = "org.tizen.common.ui.tipoftheday";
+
+ @Override
+ public void earlyStartup() {
+ tipOfTheDayStartup();
+ }
+
+ public void tipOfTheDayStartup() {
+ final IPreferenceStore prefStore = CommonPlugin.getDefault().getPreferenceStore();
+ if ( prefStore.getBoolean( TizenBasePreferencePage.KEY_TIPOFTHEDAY )) {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ TipOfTheDayDialog tip = new TipOfTheDayDialog();
+ // set url from extension
+ IConfigurationElement[] ces = PluginUtil.getExtensionConfigurationElements(EXTENTION_POINT_TIPOFTHEDAY);
+ for ( IConfigurationElement ce : ces ) {
+ String filepath = ce.getAttribute("file");
+ String tipurl = ce.getAttribute("url");
+ if ( !StringUtil.isEmpty( filepath ) ) {
+ URL url = PluginUtil.getFileURLinBundle( ce.getContributor().getName(), filepath );
+ if ( url == null ) {
+ continue;
+ }
+ logger.trace( url.toString() );
+ tip.addTip( url.toString() );
+ } else if ( !StringUtil.isEmpty( tipurl ) ) {
+ logger.trace( tipurl );
+ tip.addTip( tipurl );
+ }
+ }
+
+ if ( !tip.getTips().isEmpty() ) {
+ tip.open( SWTUtil.getActiveShell() );
+ }
+ }
+ });
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Changhyun Lee <changhyun1.lee@samsung.com>
+ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.common.ui.dialog;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.mihalis.opal.tipOfTheDay.TipOfTheDay;
+import org.mihalis.opal.utils.ResourceManager;
+import org.tizen.common.CommonPlugin;
+import org.tizen.common.ui.page.preference.TizenBasePreferencePage;
+
+/**
+ * TipOfTheDayDialog.
+ *
+ * @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
+ */
+public class TipOfTheDayDialog extends TipOfTheDay {
+
+ public TipOfTheDayDialog() {
+ super();
+ setStyle( TipStyle.HEADER );
+ }
+
+ /**
+ * Fill the tip area with the selected tip url
+ */
+ @Override
+ protected void fillTipArea() {
+ this.tipArea.setUrl( getTips().get(getIndex()) );
+ }
+
+ @Override
+ protected void buildShowOnStartup(Composite composite, GridData gridData) {
+ final Button checkBox = new Button(composite, SWT.CHECK);
+ checkBox.setLayoutData(gridData);
+ checkBox.setText(ResourceManager.getLabel(ResourceManager.SHOW_TIP_AT_STARTUP));
+ checkBox.setSelection(isShowOnStartup());
+ final IPreferenceStore prefStore = CommonPlugin.getDefault().getPreferenceStore();
+ checkBox.addListener(SWT.Selection, new Listener() {
+ @Override
+ public void handleEvent(final Event event) {
+ boolean checked = checkBox.getSelection();
+ setShowOnStartup(checked);
+ prefStore.setValue(TizenBasePreferencePage.KEY_TIPOFTHEDAY, checked);
+ }
+ });
+ }
+
+}
public static final String PLUGIN_ID = "org.tizen.common"; //$NON-NLS-1$
// The shared instance
private static CommonPlugin plugin;
-
+
/**
* {@link Prompter} using swt dialog
*/
protected EclipsePrompter prompter = null;
-
+
/**
* {@link Executor} with {@link SWTPrompter}
*/
protected Executor executor = null;
-
+
//protected RepositorySelector selector = null;
-
- protected CrashReportService crService = null;
+ protected CrashReportService crService = null;
/*
* (non-Javadoc)
@Override
public void start(BundleContext context) throws Exception {
super.start( context );
-
+
getPreferenceStore().addPropertyChangeListener( new TizenLog4jConfigurator() );
-
+
plugin = this;
initializeExecutor();
initializeSmartDeviceBridge();
*/
@Override
public void stop(BundleContext context) throws Exception {
- finalizeSmartDeviceBridge();
+ finalizeSmartDeviceBridge();
finalizeExecutor();
plugin = null;
super.stop(context);
}
-
+
public static void setDefault( CommonPlugin plugin ) {
CommonPlugin.plugin = plugin;
}
store.setDefault(TizenBasePreferencePage.KEY_SDKLOCATION, InstallPathConfig.getSDKPath());
}
store.setDefault(TizenBasePreferencePage.KEY_SDKUPDATE, TizenBasePreferencePage.VALUE_SDKUPDATE_DEFAULT);
-
+ store.setDefault(TizenBasePreferencePage.KEY_TIPOFTHEDAY, TizenBasePreferencePage.VALUE_TIPOFTHEDAY_DEFAULT);
+
// RDS settings
store.setDefault(RdsPreferencePage.RDS_OPTION_ID, RdsPreferencePage.RDS_MODE_DEFAULT);
}
public void setExecutor( final Executor executor ) {
this.executor = executor;
}
-
+
/**
* Returns {@link Executor} in eclipse plugin environment
* @return
public Executor getExecutor() {
return this.executor;
}
-
+
/**
* Returns {@link Prompter} in eclipse plugin environment
*
protected void finalizeExecutor() {
}
- protected void initializeSmartDeviceBridge()
- {
+ protected void initializeSmartDeviceBridge() {
String sdbPath = InstallPathConfig.getSDBPath();
- if (!HostUtil.exists(sdbPath))
- {
- DialogUtil.openMessageDialog(String.format("There is no %s.", sdbPath));
- }
- else {
- try
- {
+ if (!HostUtil.exists(sdbPath)) {
+ DialogUtil.openMessageDialog(String.format("There is no %s.", sdbPath));
+ } else {
+ try {
SmartDevelopmentBridge bridge = SmartDevelopmentBridge.createBridge(sdbPath, false);
bridge.waitforStart( 5000 );
- if ( !bridge.getStarted() )
- {
+ if ( !bridge.getStarted() ) {
DialogUtil.openErrorDialog( "Failed to start sdb. Read sdb log in ${tizen_sdk}/tools for details." );
// Just to proceed for using IDE without sdb
bridge.stopBridge();
}
- }
- catch ( final Throwable t )
- {
- plugin.getLog().log(new Status(Status.ERROR, PLUGIN_ID, "Problem occurred while initializing sdb", t));
+ } catch ( final Throwable t ) {
+ plugin.getLog().log(new Status(Status.ERROR, PLUGIN_ID, "Problem occurred while initializing sdb", t));
DialogUtil.openErrorDialog("Failed to start sdb");
}
}
}
-
- protected void finalizeSmartDeviceBridge()
- {
- SmartDevelopmentBridge.disconnectBridge();
- }
-
+
+ protected void finalizeSmartDeviceBridge() {
+ SmartDevelopmentBridge.disconnectBridge();
+ }
+
protected void initializeCrashReportService() throws ServerException {
- crService = new CrashReportService();
+ crService = new CrashReportService();
final String ATTR_SCOPE = "client";
final String ATTR_CLASS = "class";
crService.addCrashReportServiceListener( (ICrashReportServiceListener) obj );
}
} catch (CoreException e) {
- plugin.getLog().log( new Status( Status.WARNING, PLUGIN_ID, "Error occurred while adding cs create listener" , e ) );
+ plugin.getLog().log( new Status( Status.WARNING, PLUGIN_ID, "Error occurred while adding cs create listener" , e ) );
}
}
}
}
crService.boot();
}
-
- protected void destroyCrashReportService()
- {
- crService.down();
+
+ protected void destroyCrashReportService() {
+ crService.down();
}
+
}
private static final String BUNDLE_NAME = Messages.class.getName();//$NON-NLS-1$
public static String DESCRIPTION;
-
+
public static String GROUP1;
public static String GROUP2;
-
+ public static String GROUP3;
+
public static String LABEL_LOCATION;
public static String LABEL_UPDATE;
-
+ public static String LABEL_TIPOFTHEDAY;
+
public static String PROPERTIES_PAGE_BODY;
public static String RDS_NOTE;
public static String RDS_OPTION_SAVE_FAIL;
public static String RDS_MODE_PREFERENCE;
-
+
public static String LOGGER_GROUP;
public static String LABEL_LOG_LOCATION;
public static String LABEL_LOG_CP;
-
+
public static String BUTTON_REPORT;
public static String BUTTON_USAGE;
public static String BUTTON_PERFORM;
-
+
static {
// initialize resource bundle
NLS.initializeMessages( BUNDLE_NAME, Messages.class );
LABEL_LOCATION=Location:
GROUP2=SDK update
LABEL_UPDATE=Automatically find new updates at start-up and notify me
+GROUP3=Tip of the day
+LABEL_TIPOFTHEDAY=Show on startup
PROPERTIES_PAGE_BODY=Expand the tree to edit preferences for a specific feature.
RDS_NOTE=Currently, this option is not supported for multi-app project.
RDS_OPTION_SAVE_FAIL=Failed to save options.
public static final String KEY_SDKLOCATION = "sdkpath"; //$NON-NLS-1$
public static final String KEY_SDKUPDATE = "sdkupdate"; //$NON-NLS-1$
-
+ public static final String KEY_TIPOFTHEDAY = "tipoftheday"; //$NON-NLS-1$
+
public static final String VALUE_SDKLOCATION_DEFAULT = null;;
public static final boolean VALUE_SDKUPDATE_DEFAULT = false;
+ public static final boolean VALUE_TIPOFTHEDAY_DEFAULT = true;
private boolean applyOk = true;
/**
SWTUtil.createSpacer(composite, 1);
createUpdateSettingPreferences(composite);
SWTUtil.createSpacer(composite, 1);
+ createTopOfTheDayPreferences(composite);
+ SWTUtil.createSpacer(composite, 1);
createLoggerPreferences(composite);
}
addField(startupCheckEditor);
}
+ private void createTopOfTheDayPreferences(Composite parent) {
+ Composite comp = SWTUtil.createGroup(parent, Messages.GROUP3, 1);
+ Composite formatComposite = SWTUtil.createCompositeEx(comp, 1, GridData.FILL_HORIZONTAL);
+ BooleanFieldEditor tipofthedayCheckEditor = new BooleanFieldEditor(KEY_TIPOFTHEDAY,
+ Messages.LABEL_TIPOFTHEDAY, formatComposite);
+ addField(tipofthedayCheckEditor);
+ }
+
private void createLoggerPreferences(Composite parent) {
Composite comp = SWTUtil.createGroup(parent, Messages.LOGGER_GROUP, 1);
SWTUtil.setGridLayout(comp, 2, false, -1, -1, -1, -1, GridData.FILL_HORIZONTAL);
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.URIUtil;
+import org.osgi.framework.Bundle;
+import org.osgi.service.packageadmin.PackageAdmin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.tizen.common.Surrogate;
/**
* @author Ho Namkoong{@literal <ho.namkoong@samsung.com>} (S-Core)
*/
public class PluginUtil {
-
+
+ protected static final Logger logger = LoggerFactory.getLogger(PluginUtil.class);
+
protected static Surrogate<IExtensionRegistry> platformSurrogate = new Surrogate<IExtensionRegistry>() {
public IExtensionRegistry getAdapter()
{
public static URL getBuiltInURL(Plugin plugin, String entryPath) throws IOException {
Assert.notNull( plugin );
Assert.notNull( entryPath );
-
+
URL entry = plugin.getBundle().getEntry( entryPath );
return ( entry != null ) ? FileLocator.toFileURL( entry ) : null;
}
return registry.getConfigurationElementsFor( extPointId );
}
+ /**
+ * Returns the resolved bundle with the specified symbolic name that has the
+ * highest version. If no resolved bundles are installed that have the
+ * specified symbolic name then null is returned.
+ * <p>
+ * Clients are also able to acquire the {@link PackageAdmin} service and query
+ * it for the bundle with the specified symbolic name. Clients can ask the
+ * service for all bundles with that particular name and then determine the
+ * one with the highest version. Note that clients may want to filter
+ * the results based on the state of the bundles.
+ * </p>
+ * @param symbolicName the symbolic name of the bundle to be returned.
+ * @return the bundle that has the specified symbolic name with the
+ * highest version, or <tt>null</tt> if no bundle is found.
+ */
+ public static Bundle getBundle( String symbolicName ) {
+ return Platform.getBundle( symbolicName );
+ }
+
+ /**
+ * Return the resolved URL with the specified symbolic name and resource full path.
+ * @param symbolicName the symbolic name of the bundle to be returned.
+ * @param filePath The filepath of the resource. See {@code ClassLoader.getResource}
+ * for a description of the format of a resource name.
+ * @return the converted file URL or the original URL passed in if it is
+ * not recognized by this converter
+ */
+ public static URL getFileURLinBundle( String symbolicName, String filePath ) {
+ Bundle bundle = getBundle( symbolicName );
+ if ( bundle == null ) {
+ return null;
+ }
+ return getFileURLinBundle( bundle, filePath );
+ }
+
+ /**
+ * Return the resolved URL with the bundle and resource full path.
+ * @param bundle See {@code Bundle}
+ * @param filePath The filepath of the resource. See {@code ClassLoader.getResource}
+ * for a description of the format of a resource name.
+ * @return the converted file URL or the original URL passed in if it is
+ * not recognized by this converter
+ */
+ public static URL getFileURLinBundle( Bundle bundle, String filePath ) {
+ if ( bundle == null || filePath == null ) {
+ return null;
+ }
+ URL url = bundle.getResource( filePath );
+ if ( url == null ) {
+ return null;
+ }
+ URL resolvedURL = null;
+ try {
+ // http://www.eclipsezone.com/eclipse/forums/t82616.html
+ resolvedURL = FileLocator.toFileURL( url );
+ } catch (IOException e) {
+ logger.error( e.getMessage(), e );
+ }
+ return resolvedURL;
+ }
+
}