/*
 * Copyright 2013-2017 consulo.io
 *
 * Licensed 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 consulo.nunit.module.extension;

import com.intellij.openapi.projectRoots.Sdk;
import consulo.extension.ui.ModuleExtensionBundleBoxBuilder;
import consulo.module.extension.MutableModuleExtensionWithSdk;
import consulo.module.extension.MutableModuleInheritableNamedPointer;
import consulo.roots.ModuleRootLayer;
import consulo.ui.Component;
import consulo.ui.annotation.RequiredUIAccess;
import consulo.ui.layout.VerticalLayout;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * @author VISTALL
 * @since 10.02.14
 */
public class MicrosoftNUnitMutableModuleExtension extends MicrosoftNUnitModuleExtension implements MutableModuleExtensionWithSdk<MicrosoftNUnitModuleExtension>
{
	public MicrosoftNUnitMutableModuleExtension(@Nonnull String id, @Nonnull ModuleRootLayer module)
	{
		super(id, module);
	}

	@Nonnull
	@Override
	public MutableModuleInheritableNamedPointer<Sdk> getInheritableSdk()
	{
		return (MutableModuleInheritableNamedPointer<Sdk>) super.getInheritableSdk();
	}

	@Override
	public void setEnabled(boolean b)
	{
		myIsEnabled = b;
	}

	@RequiredUIAccess
	@Nullable
	@Override
	public Component createConfigurationComponent(@Nonnull Runnable updateOnCheck)
	{
		VerticalLayout layout = VerticalLayout.create();
		layout.add(ModuleExtensionBundleBoxBuilder.createAndDefine(this, updateOnCheck).build());
		return layout;
	}

	@Override
	public boolean isModified(@Nonnull MicrosoftNUnitModuleExtension extension)
	{
		return isModifiedImpl(extension);
	}
}

@@ -630,16 +630,56 @@
 nsion;%0A%0A
+import com.intellij.openapi.Disposable;%0A
 import c
@@ -1815,16 +1815,50 @@
 Nonnull 
+Disposable uiDisposable, @Nonnull 
 Runnable
@@ -1933,19 +1933,50 @@
 ;%0A%09%09
-layout.add(
+ModuleExtensionBundleBoxBuilder builder = 
 Modu
@@ -2039,16 +2039,77 @@
 OnCheck)
+;%0A%09%09builder.uiDisposable(uiDisposable);%0A%0A%09%09layout.add(builder
 .build()

fix npe - due no uiDisposable