/*
 * Copyright 2013-2016 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.play1.module.extension;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.swing.*;

import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.util.ui.JBUI;
import consulo.disposer.Disposable;
import consulo.extension.ui.ModuleExtensionSdkBoxBuilder;
import consulo.module.extension.MutableModuleExtensionWithSdk;
import consulo.module.extension.MutableModuleInheritableNamedPointer;
import consulo.module.extension.swing.SwingMutableModuleExtension;
import consulo.roots.ModuleRootLayer;
import consulo.ui.Component;
import consulo.ui.Label;
import consulo.ui.annotation.RequiredUIAccess;
import consulo.ui.layout.VerticalLayout;

/**
 * @author VISTALL
 * @since 15:48/28.05.13
 */
public class Play1MutableModuleExtension extends Play1ModuleExtension implements MutableModuleExtensionWithSdk<Play1ModuleExtension>, SwingMutableModuleExtension
{
	public Play1MutableModuleExtension(@Nonnull String id, @Nonnull ModuleRootLayer module)
	{
		super(id, module);
	}

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

	@RequiredUIAccess
	@Nullable
	@Override
	public Component createConfigurationComponent(@Nonnull Disposable disposable, @Nonnull Runnable runnable)
	{
		return VerticalLayout.create().add(Label.create("Unsupported platform"));
	}

	@RequiredUIAccess
	@Nullable
	@Override
	public JComponent createConfigurablePanel(@Nonnull Disposable disposable, @Nonnull Runnable runnable)
	{
		return JBUI.Panels.verticalPanel().addComponent(ModuleExtensionSdkBoxBuilder.createAndDefine(this, runnable).build());
	}

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

	@Override
	public boolean isModified(@Nonnull Play1ModuleExtension moduleExtension)
	{
		return isModifiedImpl(moduleExtension);
	}
}

@@ -832,24 +832,85 @@
 Disposable;%0A
+import consulo.extension.ui.ModuleExtensionBundleBoxBuilder;%0A
 import consu
@@ -947,32 +947,32 @@
 nSdkBoxBuilder;%0A
-
 import consulo.m
@@ -1524,37 +1524,8 @@
 ion%3E
-, SwingMutableModuleExtension
 %0A%7B%0A%09
@@ -1971,23 +1971,16 @@
 e)%0A%09%7B%0A%09%09
-return 
 Vertical
@@ -1989,261 +1989,55 @@
 yout
-.create().add(Label.create(%22Unsupported platform%22));%0A%09%7D%0A%0A%09@RequiredUIAccess%0A%09@Nullable%0A%09@Override%0A%09public JComponent createConfigurablePanel(@Nonnull Disposable disposable, @Nonnull Runnable runnable)%0A%09%7B%0A%09%09return JBUI.Panels.verticalPanel().addComponent
+ layout = VerticalLayout.create();%0A%09%09layout.add
 (Mod
@@ -2040,35 +2040,38 @@
 (ModuleExtension
-Sdk
+Bundle
 BoxBuilder.creat
@@ -2086,16 +2086,28 @@
 ne(this,
+ disposable,
  runnabl
@@ -2119,16 +2119,33 @@
 ild());%0A
+%09%09return layout;%0A
 %09%7D%0A%0A%09@Ov

use new ui