import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.RegistryFactory;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.tizen.common.core.application.InstallPathConfig;
import org.tizen.common.core.command.EclipseExecutor;
import org.tizen.common.core.command.Executor;
* @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
*/
public class CommonPlugin extends AbstractUIPlugin {
- private static final Logger logger = LoggerFactory.getLogger(CommonPlugin.class);
+ // logger can not be initialized because logger requires preference store of CommonPlugin
+ //private static final Logger logger = LoggerFactory.getLogger(CommonPlugin.class);
// The plug-in ID
public static final String PLUGIN_ID = "org.tizen.common"; //$NON-NLS-1$
String sdbPath = InstallPathConfig.getSDBPath();
if (!HostUtil.exists(sdbPath)) {
- DialogUtil.openMessageDialog("There is no " + sdbPath + ".");
+ DialogUtil.openMessageDialog(String.format("There is no %s.", sdbPath));
}
else {
try {
SmartDevelopmentBridge.init();
SmartDevelopmentBridge.createBridge(sdbPath, true);
} catch (Throwable t) {
- logger.error("Problem occurred while initializing sdb", t.getMessage(), t);
+ plugin.getLog().log(new Status(Status.ERROR, PLUGIN_ID, "Problem occurred while initializing sdb", t));
DialogUtil.openErrorDialog("Failed to start sdb");
}
}
if (OSChecker.isWindows()) {
String dllPath = InstallPathConfig.getSdbWinUsbApiPath();
- if (!HostUtil.exists(dllPath))
- {
+ if (!HostUtil.exists(dllPath)) {
DialogUtil.openMessageDialog("There is no " + dllPath + ".\n" +
"It's not mandatory but you may have problem in using sdb through USB.");
}
super.stop(context);
}
-
- public static void setDefault( CommonPlugin plugin )
- {
+ public static void setDefault( CommonPlugin plugin ) {
CommonPlugin.plugin = plugin;
}
*/
@Override
protected void initializeDefaultPreferences( final IPreferenceStore store ) {
- if (InstallPathConfig.getSDKPath() != null)
- {
+ if (InstallPathConfig.getSDKPath() != null) {
store.setDefault(TizenBasePreferencePage.KEY_SDKLOCATION, InstallPathConfig.getSDKPath());
}
store.setDefault(TizenBasePreferencePage.KEY_SDKUPDATE, TizenBasePreferencePage.VALUE_SDKUPDATE_DEFAULT);
}
/**
- * Set {@link Executor} in eclipse plugin environment
+ * Sets {@link Executor} in eclipse plugin environment
*
* @param executor {@link Executor}
*/
- public void setExecutor( final Executor executor )
- {
+ public void setExecutor( final Executor executor ) {
this.executor = executor;
}
/**
- * Return {@link Executor} in eclipse plugin environment
+ * Returns {@link Executor} in eclipse plugin environment
* @return
*/
- public Executor getExecutor()
- {
+ public Executor getExecutor() {
return this.executor;
}
/**
- * Return {@link Prompter} in eclipse plugin environment
+ * Returns {@link Prompter} in eclipse plugin environment
*
* @return {@link Prompter}
*/
- public Prompter getPrompter()
- {
+ public Prompter getPrompter() {
return this.prompter;
}
- protected void initializeExecutor()
- {
+ protected void initializeExecutor() {
this.prompter = new EclipsePrompter( new SWTPrompter() );
-
this.executor = new EclipseExecutor( prompter );
}
- protected void finalizeExecutor()
- {
-
+ protected void finalizeExecutor() {
}
private void addCSCreateListener() {
IExtensionRegistry x = RegistryFactory.getRegistry();
IConfigurationElement[] ces = x.getConfigurationElementsFor(EXT_ID);
- for ( IConfigurationElement ce : ces ) {
+ for (IConfigurationElement ce : ces) {
if (ATTR_SCOPE.equals(ce.getName())) {
String className = ce.getAttribute(ATTR_CLASS);
if (className != null) {
CrashReportService.addCrashReportServiceListener((ICrashReportServiceListener)obj);
}
} catch (CoreException e) {
- logger.warn("Error occurred while adding CrashReportServiceListener", e);
+ plugin.getLog().log(new Status(Status.WARNING, PLUGIN_ID, "Problem occurred while adding CrashReportServiceListener", e));
}
}
}