plugins/org.symbian.tools.tmw.previewer/src/org/symbian/tools/tmw/previewer/PreviewerPlugin.java
author Eugene Ostroukhov <eugeneo@symbian.org>
Mon, 23 Aug 2010 09:55:57 -0700
changeset 471 06589bf52fa7
parent 470 d4809db37847
child 475 77edd0cbdfe0
permissions -rw-r--r--
Refactoring and restructuring the repository
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
470
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     1
/**
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     2
 * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     3
 * All rights reserved.
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     8
 *
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
     9
 * Initial Contributors:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    10
 * Symbian Foundation - initial contribution.
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    11
 * Contributors:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    12
 * Description:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    13
 * Overview:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    14
 * Details:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    15
 * Platforms/Drives/Compatibility:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    16
 * Assumptions/Requirement/Pre-requisites:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    17
 * Failures and causes:
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    18
 */
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    19
package org.symbian.tools.tmw.previewer;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    20
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    21
import java.io.IOException;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    22
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    23
import org.eclipse.core.net.proxy.IProxyService;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    24
import org.eclipse.core.runtime.IStatus;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    25
import org.eclipse.core.runtime.Platform;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    26
import org.eclipse.core.runtime.Status;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    27
import org.eclipse.jface.resource.ImageDescriptor;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    28
import org.eclipse.jface.resource.ImageRegistry;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    29
import org.eclipse.ui.console.ConsolePlugin;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    30
import org.eclipse.ui.console.IConsole;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    31
import org.eclipse.ui.console.MessageConsole;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    32
import org.eclipse.ui.plugin.AbstractUIPlugin;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    33
import org.osgi.framework.BundleContext;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    34
import org.osgi.framework.ServiceReference;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    35
import org.symbian.tools.tmw.previewer.core.IPreviewerExtensionsManager;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    36
import org.symbian.tools.tmw.previewer.http.HttpPreviewer;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    37
import org.symbian.tools.tmw.previewer.internal.PreviewerExtensionsManagerImpl;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    38
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    39
/**
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    40
 * The activator class controls the plug-in life cycle
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    41
 */
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    42
public class PreviewerPlugin extends AbstractUIPlugin {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    43
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    44
	// The plug-in ID
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    45
    public static final String PLUGIN_ID = "org.symbian.tools.tmw.previewer";
471
06589bf52fa7 Refactoring and restructuring the repository
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 470
diff changeset
    46
    public static final String PREVIEW_VIEW = "org.symbian.tools.tmw.editing.wrtpreview";
470
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    47
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    48
	public static final boolean DEBUG = Platform.inDebugMode()
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    49
			&& Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/debug"));
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    50
	public static final boolean TRACE_SERVLET = DEBUG
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    51
			&& Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    52
					+ "/servlet"));
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    53
    public static final boolean DONT_CACHE_SCRIPT = DEBUG
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    54
            && Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID + "/dontScriptCaching"));
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    55
	public static final boolean TRACE_MAPPING = DEBUG
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    56
			&& Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    57
					+ "/mapping"));
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    58
	public static final boolean TRACE_WEBAPP = DEBUG
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    59
			&& Boolean.parseBoolean(Platform.getDebugOption(PLUGIN_ID
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    60
					+ "/webapp"));
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    61
	
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    62
	// The shared instance
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    63
	private static PreviewerPlugin plugin;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    64
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    65
    private final IPreviewerExtensionsManager extensionsManager = new PreviewerExtensionsManagerImpl();
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    66
    private final CommandHandlerManager handlerManager = new CommandHandlerManager();
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    67
	private final HttpPreviewer previewer = new HttpPreviewer();
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    68
    private MessageConsole console;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    69
	
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    70
	/*
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    71
	 * (non-Javadoc)
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    72
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    73
	 */
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    74
	public void start(BundleContext context) throws Exception {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    75
		super.start(context);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    76
		plugin = this;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    77
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    78
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    79
	/*
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    80
	 * (non-Javadoc)
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    81
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    82
	 */
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    83
	public void stop(BundleContext context) throws Exception {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    84
		plugin = null;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    85
		super.stop(context);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    86
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    87
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    88
	@Override
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    89
	protected void initializeImageRegistry(ImageRegistry reg) {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    90
		addImage(reg, Images.GREEN_SYNC);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    91
		addImage(reg, Images.RED_SYNC);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    92
		addImage(reg, Images.YELLOW_SYNC);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    93
        addImage(reg, Images.CLEAR_PREFS);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    94
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    95
	
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    96
	private void addImage(ImageRegistry reg, String path) {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    97
		ImageDescriptor imageDescriptor = imageDescriptorFromPlugin(PLUGIN_ID, path);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    98
		reg.put(path, imageDescriptor);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
    99
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   100
	
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   101
	/**
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   102
	 * Returns the shared instance
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   103
	 *
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   104
	 * @return the shared instance
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   105
	 */
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   106
	public static PreviewerPlugin getDefault() {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   107
		return plugin;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   108
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   109
	
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   110
	public static void log(Exception e) {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   111
		log(null, e);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   112
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   113
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   114
	public static void log(String message, Exception e) {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   115
		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, message, e);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   116
		getDefault().getLog().log(status);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   117
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   118
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   119
	public static ImageDescriptor getImageDescriptor(String key) {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   120
		return getDefault().getImageRegistry().getDescriptor(key);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   121
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   122
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   123
	public IProxyService getProxyService() {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   124
        BundleContext bundleContext = getDefault().getBundle().getBundleContext();
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   125
		ServiceReference serviceReference = bundleContext.getServiceReference(IProxyService.class.getName());
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   126
		IProxyService service = (IProxyService) bundleContext.getService(serviceReference);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   127
		return service;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   128
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   129
	
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   130
	public HttpPreviewer getHttpPreviewer() {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   131
		return previewer;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   132
	}
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   133
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   134
    public CommandHandlerManager getCommandHandlerManager() {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   135
        return handlerManager;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   136
    }
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   137
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   138
    public MessageConsole getConsole() {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   139
        if (console == null) {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   140
            console = new MessageConsole("Console", null);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   141
            ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   142
        }
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   143
        return console;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   144
    }
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   145
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   146
    public static void print(String message) throws IOException {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   147
        MessageConsole console = getDefault().getConsole();
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   148
        console.activate();
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   149
        console.newMessageStream().write(
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   150
                message);
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   151
    }
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   152
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   153
    public static IPreviewerExtensionsManager getExtensionsManager() {
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   154
        return getDefault().extensionsManager;
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   155
    }
d4809db37847 Changed repository layout and renamed project files. This revision is untested and may not run.
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
diff changeset
   156
}