// Path: app/src/main/java/org/apache/taverna/mobile/injection/component/ApplicationComponent.java
// @Singleton
// @Component(modules = ApplicationModule.class)
// public interface ApplicationComponent {
// 
//     @ApplicationContext
//     Context context();
//     Application application();
//     DataManager dataManager();
//     PreferencesHelper preferencesHelper();
// 
// }
// 
// Path: app/src/main/java/org/apache/taverna/mobile/injection/module/ApplicationModule.java
// @Module
// public class ApplicationModule {
//     protected final Application mApplication;
// 
//     public ApplicationModule(Application application) {
//         mApplication = application;
//     }
// 
//     @Provides
//     Application provideApplication() {
//         return mApplication;
//     }
// 
//     @Provides
//     @ApplicationContext
//     Context provideContext() {
//         return mApplication;
//     }
// 
// }


import com.facebook.stetho.Stetho;
import com.raizlabs.android.dbflow.config.FlowConfig;
import com.raizlabs.android.dbflow.config.FlowManager;
import com.squareup.leakcanary.LeakCanary;
import org.apache.taverna.mobile.injection.component.ApplicationComponent;
import org.apache.taverna.mobile.injection.component.DaggerApplicationComponent;
import org.apache.taverna.mobile.injection.module.ApplicationModule;
import android.app.Application;
import android.content.Context;
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */
package org.apache.taverna.mobile;





public class TavernaApplication extends Application {

    ApplicationComponent mApplicationComponent;

    public static TavernaApplication get(Context context) {
        return (TavernaApplication) context.getApplicationContext();
    }

    @Override
    public void onCreate() {
        super.onCreate();

        FlowManager.init(new FlowConfig.Builder(this).build());
        if (BuildConfig.DEBUG) {
            Stetho.initializeWithDefaults(this);
        }

        if (LeakCanary.isInAnalyzerProcess(this)) {
            return;
        }
        LeakCanary.install(this);

    }

    public ApplicationComponent getComponent() {
        if (mApplicationComponent == null) {
            mApplicationComponent = DaggerApplicationComponent.builder()
// Path: app/src/main/java/org/apache/taverna/mobile/injection/component/ApplicationComponent.java
// @Singleton
// @Component(modules = ApplicationModule.class)
// public interface ApplicationComponent {
// 
//     @ApplicationContext
//     Context context();
//     Application application();
//     DataManager dataManager();
//     PreferencesHelper preferencesHelper();
// 
// }
// 
// Path: app/src/main/java/org/apache/taverna/mobile/injection/module/ApplicationModule.java
// @Module
// public class ApplicationModule {
//     protected final Application mApplication;
// 
//     public ApplicationModule(Application application) {
//         mApplication = application;
//     }
// 
//     @Provides
//     Application provideApplication() {
//         return mApplication;
//     }
// 
//     @Provides
//     @ApplicationContext
//     Context provideContext() {
//         return mApplication;
//     }
// 
// }


// Path: app/src/main/java/org/apache/taverna/mobile/TavernaApplication.java
import com.facebook.stetho.Stetho;
import com.raizlabs.android.dbflow.config.FlowConfig;
import com.raizlabs.android.dbflow.config.FlowManager;
import com.squareup.leakcanary.LeakCanary;
import org.apache.taverna.mobile.injection.component.ApplicationComponent;
import org.apache.taverna.mobile.injection.component.DaggerApplicationComponent;
import org.apache.taverna.mobile.injection.module.ApplicationModule;
import android.app.Application;
import android.content.Context;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */
package org.apache.taverna.mobile;





public class TavernaApplication extends Application {

    ApplicationComponent mApplicationComponent;

    public static TavernaApplication get(Context context) {
        return (TavernaApplication) context.getApplicationContext();
    }

    @Override
    public void onCreate() {
        super.onCreate();

        FlowManager.init(new FlowConfig.Builder(this).build());
        if (BuildConfig.DEBUG) {
            Stetho.initializeWithDefaults(this);
        }

        if (LeakCanary.isInAnalyzerProcess(this)) {
            return;
        }
        LeakCanary.install(this);

    }

    public ApplicationComponent getComponent() {
        if (mApplicationComponent == null) {
            mApplicationComponent = DaggerApplicationComponent.builder()
                    .applicationModule(new ApplicationModule(this))