org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/Activator.java
author Eugene Ostroukhov <eugeneo@symbian.org>
Thu, 15 Jul 2010 10:08:51 -0700
changeset 450 ed815e0eef9a
parent 432 d2f02b279cdd
child 454 38d6944cff88
permissions -rw-r--r--
Bug 3268 - Debugger does not start on Windows XP
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
     1
/**
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
     2
 * Copyright (c) 2009 Symbian Foundation and/or its subsidiary(-ies).
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
     3
 * All rights reserved.
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
     5
 * under the terms of the License "Eclipse Public License v1.0"
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
     8
 *
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
     9
 * Initial Contributors:
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    10
 * Symbian Foundation - initial contribution.
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    11
 * Contributors:
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    12
 * Description:
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    13
 * Overview:
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    14
 * Details:
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    15
 * Platforms/Drives/Compatibility:
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    16
 * Assumptions/Requirement/Pre-requisites:
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    17
 * Failures and causes:
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    18
 */
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    19
package org.symbian.tools.wrttools;
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    20
145
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    21
import java.io.PrintStream;
310
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
    22
import java.util.Collection;
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
    23
import java.util.Comparator;
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
    24
import java.util.TreeSet;
145
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    25
310
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
    26
import org.eclipse.core.resources.IProject;
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
    27
import org.eclipse.core.resources.ResourcesPlugin;
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
    28
import org.eclipse.core.runtime.IStatus;
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
    29
import org.eclipse.core.runtime.Status;
260
38f012067872 Bug 2207 fix, wizard banners
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 182
diff changeset
    30
import org.eclipse.jface.resource.ImageRegistry;
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    31
import org.eclipse.ui.plugin.AbstractUIPlugin;
432
d2f02b279cdd Partial fix for Bug 3026 - Content Assist not working for phonegap APIs
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 310
diff changeset
    32
import org.eclipse.wst.jsdt.web.core.javascript.search.JsIndexManager;
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    33
import org.osgi.framework.BundleContext;
260
38f012067872 Bug 2207 fix, wizard banners
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 182
diff changeset
    34
import org.symbian.tools.wrttools.core.WRTImages;
309
c01f5ab28a11 Refactored to add extended support for JS Libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 260
diff changeset
    35
import org.symbian.tools.wrttools.core.libraries.JSLibrary;
c01f5ab28a11 Refactored to add extended support for JS Libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 260
diff changeset
    36
import org.symbian.tools.wrttools.core.libraries.LibraryManager;
260
38f012067872 Bug 2207 fix, wizard banners
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 182
diff changeset
    37
import org.symbian.tools.wrttools.sdt.utils.Logging;
310
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
    38
import org.symbian.tools.wrttools.util.ProjectUtils;
145
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    39
260
38f012067872 Bug 2207 fix, wizard banners
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 182
diff changeset
    40
import com.intel.bluetooth.BlueCoveImpl;
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    41
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    42
/**
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    43
 * The activator class controls the plug-in life cycle
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    44
 */
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    45
public class Activator extends AbstractUIPlugin {
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    46
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    47
	// The plug-in ID
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    48
	public static final String PLUGIN_ID = "org.symbian.tools.wrttools";
139
f0a865ead60b Fixed Bug 1869 - Open index file and select it in navigator after the project is created/imported
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 50
diff changeset
    49
	
f0a865ead60b Fixed Bug 1869 - Open index file and select it in navigator after the project is created/imported
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 50
diff changeset
    50
	public static final String NAVIGATOR_ID = PLUGIN_ID + ".wrtnavigator";
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    51
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    52
	// The shared instance
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    53
	private static Activator plugin;
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    54
	
145
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    55
	private static PrintStream savedSysOut;
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    56
	
309
c01f5ab28a11 Refactored to add extended support for JS Libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 260
diff changeset
    57
    private final LibraryManager manager = new LibraryManager();
c01f5ab28a11 Refactored to add extended support for JS Libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 260
diff changeset
    58
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    59
	/**
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    60
	 * The constructor
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    61
	 */
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    62
	public Activator() {
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    63
	}
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    64
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    65
	/*
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    66
	 * (non-Javadoc)
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    67
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    68
	 */
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    69
	public void start(BundleContext context) throws Exception {
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    70
		super.start(context);
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    71
		plugin = this;
145
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    72
		
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    73
		// set parameters for BlueCove
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    74
		String param = Integer.toString(65*1024);
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    75
		System.setProperty("bluecove.obex.mtu", param);
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    76
		BlueCoveImpl.setConfigProperty("bluecove.obex.mtu", param);
432
d2f02b279cdd Partial fix for Bug 3026 - Content Assist not working for phonegap APIs
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 310
diff changeset
    77
        JsIndexManager.getInstance();
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    78
	}
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    79
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    80
	/*
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    81
	 * (non-Javadoc)
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    82
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    83
	 */
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    84
	public void stop(BundleContext context) throws Exception {
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    85
		plugin = null;
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    86
		super.stop(context);
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
    87
	}
260
38f012067872 Bug 2207 fix, wizard banners
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 182
diff changeset
    88
38f012067872 Bug 2207 fix, wizard banners
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 182
diff changeset
    89
    @Override
38f012067872 Bug 2207 fix, wizard banners
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 182
diff changeset
    90
    protected void initializeImageRegistry(ImageRegistry reg) {
38f012067872 Bug 2207 fix, wizard banners
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 182
diff changeset
    91
        WRTImages.init(reg);
38f012067872 Bug 2207 fix, wizard banners
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 182
diff changeset
    92
    }
145
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    93
	
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    94
	/** Toggle BlueCove logging
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    95
	 */
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    96
	public static void enableBlueCoveDiagnostics(boolean enable) {
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    97
		System.setProperty("bluecove.debug", Boolean.valueOf(enable).toString());
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    98
		BlueCoveImpl.instance().enableNativeDebug(enable);
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
    99
		if (enable) {
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
   100
			System.setOut(new PrintStream(ConsoleFactory.createStream()));
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
   101
		} else {
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
   102
			System.setOut(savedSysOut);
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
   103
		}
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
   104
	}
19985c154f5c Merged. Added deployment. Fixed developer experience. Added about.ini, about.properties.
tasneems@symbian.org
parents: 139
diff changeset
   105
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   106
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   107
	/**
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   108
	 * Returns the shared instance
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   109
	 *
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   110
	 * @return the shared instance
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   111
	 */
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   112
	public static Activator getDefault() {
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   113
		return plugin;
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   114
	}
3
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
   115
	
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
   116
	public static void log(Exception e) {
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
   117
		log(e.getLocalizedMessage(), e);
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
   118
	}
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
   119
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
   120
	public static void log(String message, Exception e) {
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
   121
		getDefault().getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, e));
d3477de62514 Added new wizards for importing WRT projects. Added CSS Validator.
TasneemS@US-TASNEEMS
parents: 0
diff changeset
   122
	}
50
0560e98b9bf6 Added widget project nature and WRT validators
tasneems@symbian.org
parents: 3
diff changeset
   123
	
0560e98b9bf6 Added widget project nature and WRT validators
tasneems@symbian.org
parents: 3
diff changeset
   124
	public static void log(int severity, String message, Throwable x) {
0560e98b9bf6 Added widget project nature and WRT validators
tasneems@symbian.org
parents: 3
diff changeset
   125
		IStatus status = new Status(severity, PLUGIN_ID, 0, message, x);
0560e98b9bf6 Added widget project nature and WRT validators
tasneems@symbian.org
parents: 3
diff changeset
   126
		Logging.log(getDefault(), status);
0560e98b9bf6 Added widget project nature and WRT validators
tasneems@symbian.org
parents: 3
diff changeset
   127
	}
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   128
309
c01f5ab28a11 Refactored to add extended support for JS Libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 260
diff changeset
   129
    public static JSLibrary[] getJSLibraries() {
c01f5ab28a11 Refactored to add extended support for JS Libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 260
diff changeset
   130
        return getDefault().manager.getLibraries();
c01f5ab28a11 Refactored to add extended support for JS Libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 260
diff changeset
   131
    }
c01f5ab28a11 Refactored to add extended support for JS Libraries
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 260
diff changeset
   132
310
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   133
    public static IProject[] getWrtProjects() {
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   134
        IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   135
        Collection<IProject> prjs = new TreeSet<IProject>(new Comparator<IProject>() {
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   136
            public int compare(IProject o1, IProject o2) {
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   137
                if (o1 == o2) {
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   138
                    return 0;
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   139
                } else if (o1 == null) {
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   140
                    return -1;
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   141
                } else if (o2 == null) {
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   142
                    return 1;
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   143
                } else {
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   144
                    return o1.getName().compareTo(o2.getName());
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   145
                }
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   146
            }
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   147
        });
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   148
        for (IProject project : projects) {
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   149
            if (ProjectUtils.hasWrtNature(project)) {
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   150
                prjs.add(project);
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   151
            }
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   152
        }
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   153
        return prjs.toArray(new IProject[prjs.size()]);
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   154
    }
e9484be98cfe UI to add libraries was introduced
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 309
diff changeset
   155
0
ddc9cde0ba07 Initial version of WRT Tools Plugin.
TasneemS@US-TASNEEMS
parents:
diff changeset
   156
}