/*
* Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
package com.amazonaws.eclipse.android.sdk;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import com.amazonaws.eclipse.android.sdk.preferences.PreferenceConstants;
/**
* The activator class controls the plug-in life cycle
*/
public class AndroidSDKPlugin extends AbstractUIPlugin implements IStartup {
// The plug-in ID
public static final String PLUGIN_ID = "com.amazonaws.eclipse.android.sdk"; //$NON-NLS-1$
// The shared instance
private static AndroidSDKPlugin plugin;
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
if ( getPreferenceStore().getBoolean(PreferenceConstants.DOWNLOAD_AUTOMATICALLY) ) {
AndroidSdkManager.getInstance().initializeSDKInstalls();
}
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static AndroidSDKPlugin getDefault() {
return plugin;
}
public void earlyStartup() {}
}