diff --git a/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties b/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
index 8ea9c0c..ef63727 100644
--- a/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
+++ b/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
@@ -1,98 +1,98 @@
-Label_JBoss_Runtime_Load_Error=Error occurred while loading JBoss ESB {0} runtime . Please select a correct JBoss ESB runtime or JBoss ESB server location
-
-Error_JBoss_Basic_Editor_Composite=Parent control should be Composite
-Error_JBoss_Basic_Editor_Support=Editor supports only grid layout
-Error_JBoss_Basic_Editor_Different=Parent for label is different
-JBoss_Runtime_List_Field_Editor_Name=Name
-JBoss_Runtime_List_Field_Editor_Version=Version
-JBoss_Runtime_List_Field_Editor_Version2=Version:
-JBoss_Runtime_List_Field_Editor_Configuration=Configuration:
-JBoss_Runtime_List_Field_Editor_Path=Path
-JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be_List=inputElement must be an instance of List<JBossRuntime>.
-JBoss_Runtime_Delete_Confirm_Title=Confirm Runtime Delete
-JBoss_Runtime_Delete_Used_Confirm=Runtime ''{0}'' is used by JBoss ESB projects. Are you sure you want to delete it?
-JBoss_Runtime_Delete_Not_Used_Confirm=Are you sure you want to delete runtime ''{0}''?
-JBoss_Runtime_List_Field_Editor_Edit_Runtime=Edit JBoss ESB Runtime
-JBoss_Runtime_List_Field_Editor_Modify_Runtime=Modify your ESB runtime
-JBoss_Runtime_List_Field_Editor_New_Runtime=New JBoss ESB Runtime
-JBoss_Runtime_List_Field_Editor_Configuration_Description=Only for JBoss AS contained ESB runtime
-Error_JBoss_Runtime_List_Field_Editor_Path_To_Home_Diretory_Cannot_Be_Empty=Path to JBoss ESB runtime home directory cannot be empty
-JBoss_Runtime_List_Field_Editor_Runtime_Already_Exists=JBoss ESB Runtime ''{0}'' already exists
-JBoss_Runtime_List_Field_Editor_Runtime=JBoss ESB Runtime
-Error_JBoss_Runtime_List_Field_Editor_Runtime_Name_Is_Not_Correct=Runtime name is not correct
-Error_JBoss_Runtime_List_Field_Editor_Name_Cannot_Be_Empty=Name cannot be empty
-Error_JBoss_Runtime_List_Field_Editor_Version_Cannot_Be_Empty=Version cannot be empty
-JBoss_Runtime_List_Field_Editor_Create_A_Runtime=Create a JBoss ESB Runtime
-JBoss_Runtime_List_Field_Editor_Home_Folder=Home Folder:
-JBoss_Composite_Editor_This_Method_Can_Be_Invoked=This method can be invoked after getEditorControls(parent) only
-JBoss_Button_Field_Editor_Browse=Browse...
-# START NON-TRANSLATABLE
-JBoss_ESBRuntime_Classpath_Container_5=esb_runtime
-# END NON-TRANSLATABLE
-JBoss_ESBRuntime_Classpath_Container_Manage_Runtimes_Button=Manage ESB Runtimes
-JBoss_ESBRuntime_Classpath_Container_Description=Select a ESB runtime to add to the project classpath
-JBoss_ESBRuntime_Classpath_Container_Name=Name
-JBoss_ESBRuntime_Classpath_Container_RuntimeType=Runtime Type
-JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly=ESB Libraries Only
-JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained=Server Contained
-JBoss_ESBRuntime_Classpath_Container_Title=JBoss ESB Library
-Error_JBoss_Button_Field_Editor_Not_Implemented_Yet=Not implemented yet. Please setup real acion for editor.
-JBoss_SWT_Field_Editor_Factory_Browse=Browse...
-JBoss_SWT_Field_Editor_Factory_Select_Home_Folder=Select JBoss ESB runtime Home Folder
-JBoss_Runtime_List_Field_Editor_Name2=Name:
-JBoss_Runtime_Check_Field_Default_Classpath=Customize JBoss ESB runtime jars
-JBoss_Preference_Page_Runtimes=JBoss ESB Runtimes
-JBossLibraryListFieldEditor_ActionAdd=&Add
-JBossLibraryListFieldEditor_ActionRemove=&Remove
-JBossLibraryListFieldEditor_LIBRARY_JARS=Library Jars
-JBossRuntimeListFieldEditor_ActionAdd=&Add
-JBossRuntimeListFieldEditor_ActionEdit=&Edit
-JBossRuntimeListFieldEditor_ActionRemove=&Remove
-JBossRuntimeListFieldEditor_ErrorMessageAtLeastOneJar=The library must contain at least one jar.
-
- 
-ESBDomParser_Actions_Node_Label=Actions
-ESBDomParser_Listeners_Node_Label=Listeners
-ESBDomParser_Providers_Label=Providers
-ESBDomParser_Services_Label=Services
-ESBFacetInstallationPage_Button_Text_New=New
-ESBFacetInstallationPage_Default_SRC_Folder=src
-ESBFacetInstallationPage_Description=Configure project structure and classpath
-ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime=The project primary target runtime is not specified, Server supplied ESB runtime will not be installed correctly.
-ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime=The specified target runtime does not contain a valid ESB {0} runtime .
-ESBFacetInstallationPage_Error_Message_No_Target_Runtime=No target runtime was specified.
-ESBFacetInstallationPage_Error_Message_Specify_Content_Folder=Please specify a valid content folder.
-ESBFacetInstallationPage_Error_Message_Specify_ESB_Runtime=Please specify a ESB runtime
-ESBFacetInstallationPage_Error_Message_Specify_Source_Folder=Please specify a valid source folder.
-ESBFacetInstallationPage_Group_Runtime_Text=JBoss ESB Runtime
-ESBFacetInstallationPage_Group_Text_Folder=Project Folders
-ESBFacetInstallationPage_Label_Content_Directory=Content Directory
-ESBFacetInstallationPage_Label_Server_Supplied_Runtime=Server supplied ESB Runtime
-ESBFacetInstallationPage_Label_Source_Directory=Java Source Directory
-ESBFacetInstallationPage_Title=Install ESB Facet
-
-ESBRuntimeContainerPage_Button_Text=Create an ESB Runtime
-
-
-ESBProjectFirstPage_Description=Create a new JBoss ESB project.
-ESBProjectFirstPage_Title=JBoss ESB Project
-
-
-ESBProjectWizard_Title=New ESB Project Wizard
-ESBExportWizard_NotValidProject=Project "{0}" is not a valid ESB Project
-ESBExportWizard_Title=ESB Export
-ESBExportWizard_Description=Export an ESB project to the local file system.
-ESBExportWizard_ESBProject=ESB Project\: 
-ESBVisualizerView_Change_Layout_Action_Label=Change Layout
-ESBVisualizerView_DoubleClick_Toggle_Action_label=Freeze Node on Double-click
-ESBVisualizerView_EmptyNodeLabel=Select an ESB Configuration file in the navigator\n or use the 'Open JBoss ESB Configuration' view menu\n to show a configuration graphically.
-ESBVisualizerView_Open_ESB_Config_Action_Label=Open ESB Configuration
-ESBVisualizerView_Open_ESB_Config_Dialog_Field_Text=Select ESB file:
-ESBVisualizerView_Open_ESB_Config_Dialog_Title=Open ESB Configuration
-ESBVisualizerView_Open_ESB_Editor_Action_Label=Open ESB Editor
-ESBVisualizerView_Refresh_Layout_Action_Label=Refresh Layout
-ESBVisualizerView_Select_ESB_File_Warning=Please select an ESB configuration file.
-ESBVisualizerView_Use_Horizontal_Tree_Layout_Action_Label=Use Horizontal Tree Layout
-ESBVisualizerView_Use_Radial_Layout_Action_Label=Use Radial Layout
-ESBVisualizerView_Use_Vertical_Tree_Layout_Action_Label=Use Vertical Tree Layout
-WorkbenchFileSelectionDialog_Title=Select a File
+Label_JBoss_Runtime_Load_Error=Error occurred while loading JBoss ESB {0} runtime . Please select a correct JBoss ESB runtime or JBoss ESB server location
+
+Error_JBoss_Basic_Editor_Composite=Parent control should be Composite
+Error_JBoss_Basic_Editor_Support=Editor supports only grid layout
+Error_JBoss_Basic_Editor_Different=Parent for label is different
+JBoss_Runtime_List_Field_Editor_Name=Name
+JBoss_Runtime_List_Field_Editor_Version=Version
+JBoss_Runtime_List_Field_Editor_Version2=Version:
+JBoss_Runtime_List_Field_Editor_Configuration=Configuration:
+JBoss_Runtime_List_Field_Editor_Path=Path
+JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be_List=inputElement must be an instance of List<JBossRuntime>.
+JBoss_Runtime_Delete_Confirm_Title=Confirm Runtime Delete
+JBoss_Runtime_Delete_Used_Confirm=Runtime ''{0}'' is used by JBoss ESB projects. Are you sure you want to delete it?
+JBoss_Runtime_Delete_Not_Used_Confirm=Are you sure you want to delete runtime ''{0}''?
+JBoss_Runtime_List_Field_Editor_Edit_Runtime=Edit JBoss ESB Runtime
+JBoss_Runtime_List_Field_Editor_Modify_Runtime=Modify your ESB runtime
+JBoss_Runtime_List_Field_Editor_New_Runtime=New JBoss ESB Runtime
+JBoss_Runtime_List_Field_Editor_Configuration_Description=Only for JBoss AS contained ESB runtime
+Error_JBoss_Runtime_List_Field_Editor_Path_To_Home_Diretory_Cannot_Be_Empty=Path to JBoss ESB runtime home directory cannot be empty
+JBoss_Runtime_List_Field_Editor_Runtime_Already_Exists=JBoss ESB Runtime ''{0}'' already exists
+JBoss_Runtime_List_Field_Editor_Runtime=JBoss ESB Runtime
+Error_JBoss_Runtime_List_Field_Editor_Runtime_Name_Is_Not_Correct=Runtime name is not correct
+Error_JBoss_Runtime_List_Field_Editor_Name_Cannot_Be_Empty=Name cannot be empty
+Error_JBoss_Runtime_List_Field_Editor_Version_Cannot_Be_Empty=Version cannot be empty
+JBoss_Runtime_List_Field_Editor_Create_A_Runtime=Create a JBoss ESB Runtime
+JBoss_Runtime_List_Field_Editor_Home_Folder=Home Folder:
+JBoss_Composite_Editor_This_Method_Can_Be_Invoked=This method can be invoked after getEditorControls(parent) only
+JBoss_Button_Field_Editor_Browse=Browse...
+# START NON-TRANSLATABLE
+JBoss_ESBRuntime_Classpath_Container_5=esb_runtime
+# END NON-TRANSLATABLE
+JBoss_ESBRuntime_Classpath_Container_Manage_Runtimes_Button=Manage ESB Runtimes
+JBoss_ESBRuntime_Classpath_Container_Description=Select a ESB runtime to add to the project classpath
+JBoss_ESBRuntime_Classpath_Container_Name=Name
+JBoss_ESBRuntime_Classpath_Container_RuntimeType=Runtime Type
+JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly=ESB Libraries Only
+JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained=Server Contained
+JBoss_ESBRuntime_Classpath_Container_Title=JBoss ESB Library
+Error_JBoss_Button_Field_Editor_Not_Implemented_Yet=Not implemented yet. Please setup real acion for editor.
+JBoss_SWT_Field_Editor_Factory_Browse=Browse...
+JBoss_SWT_Field_Editor_Factory_Select_Home_Folder=Select JBoss ESB runtime Home Folder
+JBoss_Runtime_List_Field_Editor_Name2=Name:
+JBoss_Runtime_Check_Field_Default_Classpath=Customize JBoss ESB runtime jars
+JBoss_Preference_Page_Runtimes=JBoss ESB Runtimes
+JBossLibraryListFieldEditor_ActionAdd=&Add
+JBossLibraryListFieldEditor_ActionRemove=&Remove
+JBossLibraryListFieldEditor_LIBRARY_JARS=Library Jars
+JBossRuntimeListFieldEditor_ActionAdd=&Add
+JBossRuntimeListFieldEditor_ActionEdit=&Edit
+JBossRuntimeListFieldEditor_ActionRemove=&Remove
+JBossRuntimeListFieldEditor_ErrorMessageAtLeastOneJar=The library must contain at least one jar.
+
+ 
+ESBDomParser_Actions_Node_Label=Actions
+ESBDomParser_Listeners_Node_Label=Listeners
+ESBDomParser_Providers_Label=Providers
+ESBDomParser_Services_Label=Services
+ESBFacetInstallationPage_Button_Text_New=New
+ESBFacetInstallationPage_Default_SRC_Folder=src
+ESBFacetInstallationPage_Description=Configure project structure and classpath
+ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime=The project primary target runtime is not specified, Server supplied ESB runtime will not be installed correctly.
+ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime=The specified target runtime does not contain a valid ESB {0} runtime .
+ESBFacetInstallationPage_Error_Message_No_Target_Runtime=No target runtime was specified.
+ESBFacetInstallationPage_Error_Message_Specify_Content_Folder=Please specify a valid content folder.
+ESBFacetInstallationPage_Error_Message_Specify_ESB_Runtime=Please specify an ESB runtime
+ESBFacetInstallationPage_Error_Message_Specify_Source_Folder=Please specify a valid source folder.
+ESBFacetInstallationPage_Group_Runtime_Text=JBoss ESB Runtime
+ESBFacetInstallationPage_Group_Text_Folder=Project Folders
+ESBFacetInstallationPage_Label_Content_Directory=Content Directory
+ESBFacetInstallationPage_Label_Server_Supplied_Runtime=Server supplied ESB Runtime
+ESBFacetInstallationPage_Label_Source_Directory=Java Source Directory
+ESBFacetInstallationPage_Title=Install ESB Facet
+
+ESBRuntimeContainerPage_Button_Text=Create an ESB Runtime
+
+
+ESBProjectFirstPage_Description=Create a new JBoss ESB project.
+ESBProjectFirstPage_Title=JBoss ESB Project
+
+
+ESBProjectWizard_Title=New ESB Project Wizard
+ESBExportWizard_NotValidProject=Project "{0}" is not a valid ESB Project
+ESBExportWizard_Title=ESB Export
+ESBExportWizard_Description=Export an ESB project to the local file system.
+ESBExportWizard_ESBProject=ESB Project\: 
+ESBVisualizerView_Change_Layout_Action_Label=Change Layout
+ESBVisualizerView_DoubleClick_Toggle_Action_label=Freeze Node on Double-click
+ESBVisualizerView_EmptyNodeLabel=Select an ESB Configuration file in the navigator\n or use the 'Open JBoss ESB Configuration' view menu\n to show a configuration graphically.
+ESBVisualizerView_Open_ESB_Config_Action_Label=Open ESB Configuration
+ESBVisualizerView_Open_ESB_Config_Dialog_Field_Text=Select ESB file:
+ESBVisualizerView_Open_ESB_Config_Dialog_Title=Open ESB Configuration
+ESBVisualizerView_Open_ESB_Editor_Action_Label=Open ESB Editor
+ESBVisualizerView_Refresh_Layout_Action_Label=Refresh Layout
+ESBVisualizerView_Select_ESB_File_Warning=Please select an ESB configuration file.
+ESBVisualizerView_Use_Horizontal_Tree_Layout_Action_Label=Use Horizontal Tree Layout
+ESBVisualizerView_Use_Radial_Layout_Action_Label=Use Radial Layout
+ESBVisualizerView_Use_Vertical_Tree_Layout_Action_Label=Use Vertical Tree Layout
+WorkbenchFileSelectionDialog_Title=Select a File
diff --git a/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java b/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
index b0657d0..afea959 100644
--- a/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
+++ b/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
@@ -1,651 +1,652 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.esb.project.ui.wizards.pages;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.EventObject;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.common.project.facet.JavaFacetUtils;
-import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
-import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
-import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.tools.esb.core.ESBProjectConstant;
-import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
-import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
-import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
-import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
-import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
-import org.jboss.tools.esb.project.ui.preference.controls.JBossRuntimeListFieldEditor;
-
-public class ESBFacetInstallationPage extends AbstractFacetWizardPage implements IFacetWizardPage, IJBossESBFacetDataModelProperties {
-
-	private Label contextRootLabel;
-	private Text contentFolder;
-	private IDataModel model;
-	private boolean hasValidContentFolder = true;
-	private boolean hasValidSrc = true;
-	private boolean hasRuntime = false;
-	private Combo cmbRuntimes;
-	private Button btnUserSupplied;
-	private Button btnServerSupplied;
-	private Button btnNew;
-
-	private Combo cmbConfigVersions;
-
-	private IFacetedProjectListener fpListerner;
-	private IFacetedProjectWorkingCopy fpwc;
-	
-	public ESBFacetInstallationPage() {
-		super( "esb.facet.install.page"); //$NON-NLS-1$
-		setTitle(JBossESBUIMessages.ESBFacetInstallationPage_Title);
-		setDescription(JBossESBUIMessages.ESBFacetInstallationPage_Description);
-		
-	}
-
-	private void setDefaultOutputFolder(){
-		JavaFacetInstallConfig cfg = findJavaFacetInstallConfig();
-		if(cfg != null){
-			cfg.setDefaultOutputFolder(new Path(ESBProjectConstant.BUILD_CLASSES));
-		}
-	}
-
-	protected Composite createTopLevelComposite(Composite parent) {
-		//setInfopopID(IWstWebUIContextIds.NEW_STATIC_WEB_PROJECT_PAGE3);
-		final Composite composite = new Composite(parent, SWT.NONE);
-		composite.setLayout(new GridLayout(1, false));
-		
-		createProjectGroup(composite);
-		createRuntimeGroup(composite);
-		createConfigVersionGroup(composite);
-		setPageComplete(false);
-		setDefaultOutputFolder();
-		
-		//synchHelper.synchText(configFolder, CONTENT_DIR, null);
-	    Dialog.applyDialogFont(parent);
-	    
-	    // add listener to listen the changes on the project facet
-	    fpwc = getFacetedProjectWorkingCopy();
-	    if(fpListerner == null){
-	    	fpListerner = new IFacetedProjectListener(){
-
-				public void handleEvent(IFacetedProjectEvent event) {
-					IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
-					final IProjectFacetVersion version = fpwc.getProjectFacetVersion(facet);
-					Display.getDefault().asyncExec(new Runnable() {
-
-						public void run() {
-							if(version != null){
-								initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
-								initializeConfigVersionCombo(cmbConfigVersions, null, version.getVersionString());
-								
-							}else{
-								initializeRuntimesCombo(cmbRuntimes, null);
-								initializeConfigVersionCombo(cmbConfigVersions, null);
-							}
-							changePageStatus();
-						}
-						
-					});
-					
-				}
-			};
-	    }
-	    
-	    if(fpwc != null){
-	    	fpwc.addListener(fpListerner, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED, 
-	    			IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
-	    }
-		//set page status
-		changePageStatus();
-		
-		return composite;
-	}
-	
-	private void createProjectGroup(Composite parent){
-		
-		Group prjGroup = new Group(parent, SWT.NONE);
-		prjGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Text_Folder);
-		prjGroup.setLayout(new GridLayout(1, false));
-		prjGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		
-		
-		this.contextRootLabel = new Label(prjGroup, SWT.NONE);
-		this.contextRootLabel.setText(JBossESBUIMessages.ESBFacetInstallationPage_Label_Content_Directory);
-		this.contextRootLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-		this.contentFolder = new Text(prjGroup, SWT.BORDER);
-		this.contentFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		this.contentFolder.setData("label", this.contextRootLabel); //$NON-NLS-1$
-		this.contentFolder.setText(model.getStringProperty(ESB_CONTENT_FOLDER));
-		contentFolder.addModifyListener(new ModifyListener(){
-			public void modifyText(ModifyEvent e){
-				 String content = contentFolder.getText();
-				 if(content != null && !content.equals("")){ //$NON-NLS-1$
-					 model.setProperty(ESB_CONTENT_FOLDER, content);
-				 }
-				 changePageStatus();
-			}
-		});
-		
-	}
-	
-	
-	private IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy(){
-		Object obj = model.getProperty(IFacetDataModelProperties.FACETED_PROJECT_WORKING_COPY);
-		if(obj instanceof IFacetedProjectWorkingCopy){
-			return (IFacetedProjectWorkingCopy)obj;
-		}
-		
-		return null;
-	}
-	private JavaFacetInstallConfig findJavaFacetInstallConfig()
-	{
-        final IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
-        if( fpjwc != null )
-        {
-            final IFacetedProject.Action javaInstallAction
-                = fpjwc.getProjectFacetAction( JavaFacetUtils.JAVA_FACET );
-            
-            if(javaInstallAction == null) return null;
-            
-            final Object config = javaInstallAction.getConfig();
-            
-            if( config instanceof JavaFacetInstallConfig )
-            {
-                return (JavaFacetInstallConfig) config;
-            }
-            else
-            {
-                return (JavaFacetInstallConfig) Platform.getAdapterManager().getAdapter( config, JavaFacetInstallConfig.class );
-            }
-        }
-        
-        return null;
-	}
-
-	private void createRuntimeGroup(Composite parent){
-		
-		Group runtimeGroup = new Group(parent, SWT.NONE);
-		runtimeGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Runtime_Text);
-		runtimeGroup.setLayout(new GridLayout(3, false));
-		runtimeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		
-		btnServerSupplied = new Button(runtimeGroup, SWT.RADIO);
-		btnServerSupplied.addMouseListener(new MouseAdapter(){
-			public void mouseDown(MouseEvent e) {
-				setServerSuppliedSelection(e);
-			}
-		});
-		GridData gd = new GridData();
-
-		gd.horizontalSpan = 1;
-		btnServerSupplied.setLayoutData(gd);
-
-		Label lblServerSupplied = new Label(runtimeGroup, SWT.NONE);
-		lblServerSupplied.addMouseListener(new MouseAdapter(){
-			public void mouseDown(MouseEvent e) {
-				btnServerSupplied.setSelection(true);
-				setServerSuppliedSelection(e);
-			}
-		});
-		
-		lblServerSupplied.setText(JBossESBUIMessages.ESBFacetInstallationPage_Label_Server_Supplied_Runtime);
-		gd = new GridData(GridData.FILL_HORIZONTAL);
-		gd.horizontalSpan = 2;
-		lblServerSupplied.setLayoutData(gd);
-
-		btnUserSupplied = new Button(runtimeGroup, SWT.RADIO);
-		btnUserSupplied.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				setUserSuppliedSelection(e);
-			}
-		});
-
-		cmbRuntimes = new Combo(runtimeGroup, SWT.READ_ONLY);
-		cmbRuntimes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		cmbRuntimes.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				String runtimeName = cmbRuntimes.getText();
-				JBossESBRuntime jr = (JBossESBRuntime) cmbRuntimes
-						.getData(runtimeName);
-				saveJBossESBRuntimeToModel(jr);
-				changePageStatus();
-			}
-		});
-		initializeRuntimesCombo(cmbRuntimes, null);
-
-		btnNew = new Button(runtimeGroup, SWT.NONE);
-		btnNew.setText(JBossESBUIMessages.ESBFacetInstallationPage_Button_Text_New);
-		btnNew.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				newJBossRuntime();
-				changePageStatus();
-			}
-		});
-		
-		if("".equals(cmbRuntimes.getText())){ //$NON-NLS-1$
-			hasRuntime = false;
-		}
-		
-		//set default ESB runtime option
-		btnServerSupplied.setSelection(true);
-		enableUserSupplied(false);
-		
-	}
- 
-	protected void setServerSuppliedSelection(EventObject e) {
-		btnServerSupplied.setSelection(true);
-		btnUserSupplied.setSelection(false);
-		model
-				.setBooleanProperty(
-						IJBossESBFacetDataModelProperties.RUNTIME_IS_SERVER_SUPPLIED,
-						true);
-		//remove user supplied properties
-		model.setStringProperty(
-				IJBossESBFacetDataModelProperties.RUNTIME_ID, null);
-		model.setStringProperty(
-				IJBossESBFacetDataModelProperties.RUNTIME_HOME,	null);		
-		enableUserSupplied(false);		
-		//checkServerSuppliedESBRuntime();
-		changePageStatus();
-
-	}
-
-	protected void setUserSuppliedSelection(EventObject e) {
-		btnServerSupplied.setSelection(false);
-		btnUserSupplied.setSelection(true);
-		model
-				.setBooleanProperty(
-						IJBossESBFacetDataModelProperties.RUNTIME_IS_SERVER_SUPPLIED,
-						false);
-		String runtimename = cmbRuntimes.getText();	
-		if(runtimename == null || runtimename.equals("")){ //$NON-NLS-1$
-			hasRuntime = false;
-		}
-		JBossESBRuntime jbRuntime = JBossRuntimeManager.getInstance().findRuntimeByName(runtimename);
-		
-		
-		if (jbRuntime != null) {
-			saveJBossESBRuntimeToModel(jbRuntime);
-		}
-		enableUserSupplied(true);
-		changePageStatus();
-
-	}
-	
-	private boolean checkServerSuppliedESBRuntime() {
-
-		try {
-			IFacetedProjectWorkingCopy ifpwc = getFacetedProjectWorkingCopy();
-			//when the UI is loaded from esb project creation wizard
-			if (ifpwc != null) {
-				IRuntime runtime = ifpwc.getPrimaryRuntime();
-				if (runtime == null) {
-					setMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime, WARNING);
-					hasRuntime = true;
-					setPageComplete(isPageComplete());
-					return false;
-				}
-
-				org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
-						.findRuntime(runtime.getProperty("id")); //$NON-NLS-1$
-				IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
-
-				if (!JBossRuntimeManager.isValidESBServer(serverRuntime
-						.getLocation().toOSString(), getSelectedESBVersion().getVersionString(), jbossRuntime.getJBossConfiguration())) {
-					hasRuntime = true;
-					setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime, getSelectedESBVersion().getVersionString()), WARNING);
-					setPageComplete(isPageComplete());
-					return true;
-				}
-			} 
-			// when the UI loaded from project facet properties page 
-			else {
-				String prjname = model.getStringProperty(FACET_PROJECT_NAME);
-				IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjname);
-				IFacetedProject fp = ProjectFacetsManager.create(project);
-				// if fp != null , the UI will be loaded for an exist project
-				if (fp != null) {
-					IRuntime runtime = fp.getPrimaryRuntime();
-					if (runtime == null) {
-						setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_No_Target_Runtime);
-						hasRuntime = false;
-						setPageComplete(isPageComplete());
-						return false;
-					}
-					org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
-							.findRuntime(runtime.getProperty("id"));
-					IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
-
-					if (!JBossRuntimeManager.isValidESBServer(serverRuntime
-							.getLocation().toOSString(), getSelectedESBVersion().getVersionString(), jbossRuntime.getJBossConfiguration())) {
-						setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime, getSelectedESBVersion().getVersionString()), WARNING);
-						hasRuntime = true;
-						setPageComplete(isPageComplete());
-						return true;
-					}
-				} 
-			}
-			
-		} catch (CoreException e) {
-			ESBProjectPlugin.getDefault().getLog().log(e.getStatus());
-			return false;
-		}
-		// remove the warning message when users change server runtime to a server runtime that contains  ESB runtime 
-		setMessage(null);
-		return true;
-
-	}
-	
-	
-	
-	private void enableUserSupplied(boolean enabled){
-		cmbRuntimes.setEnabled(enabled);
-		btnNew.setEnabled(enabled);
-	}
-	/*
-	 * create a new jboss ESB runtime and set user supplied runtime to the new one
-	 */
-	protected void newJBossRuntime() {
-		List<JBossESBRuntime> exists = new ArrayList<JBossESBRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes()));
-		List<JBossESBRuntime> added = new ArrayList<JBossESBRuntime>();
-		
-		JBossRuntimeListFieldEditor.JBossRuntimeNewWizard newRtwizard = new JBossRuntimeListFieldEditor.JBossRuntimeNewWizard(
-				exists, added) {
-			public boolean performFinish() {
-				JBossESBRuntime rt = getRuntime();
-				rt.setDefault(true);
-				JBossRuntimeManager.getInstance().addRuntime(rt);
-				JBossRuntimeManager.getInstance().save();
-
-				return true;
-			}
-		};
-		WizardDialog dialog = new WizardDialog(Display.getCurrent()
-				.getActiveShell(), newRtwizard);
-		if (dialog.open() == WizardDialog.OK) {
-			initializeRuntimesCombo(cmbRuntimes, null);
-		}
-	}
-	
-	protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName, String version) {
-		JBossESBRuntime selectedJbRuntime = null;
-		JBossESBRuntime defaultJbws = null;
-		int selectIndex = 0;
-		int defaultIndex = 0;
-		
-		cmRuntime.removeAll();
-		if(runtimeName == null || "".equals(runtimeName)){ //$NON-NLS-1$
-			runtimeName = model.getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
-		}
-		JBossESBRuntime[] runtimes = JBossRuntimeManager.getInstance()
-				.findRuntimeByVersion(version);
-		for (int i = 0; i < runtimes.length; i++) {
-			JBossESBRuntime jr = runtimes[i];
-			cmRuntime.add(jr.getName());
-			cmRuntime.setData(jr.getName(), jr);
-			
-			if(jr.getName().equals(runtimeName)){
-				selectedJbRuntime = jr;
-				selectIndex = i;
-			}
-			// get default jbossws runtime from esb runtime preference 
-			if (jr.isDefault()) {
-				defaultJbws = jr;
-				defaultIndex = i;
-			}
-		}
-		
-		if(selectedJbRuntime != null){
-			cmRuntime.select(selectIndex);
-			if(btnUserSupplied.getSelection()){
-				saveJBossESBRuntimeToModel(selectedJbRuntime);
-			}
-		}else if(defaultJbws != null){
-			cmRuntime.select(defaultIndex);
-			if(btnUserSupplied.getSelection()){
-				saveJBossESBRuntimeToModel(defaultJbws);
-			}
-		}
-	}
-	
-	
-	protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName) {
-		IProjectFacetVersion version = getSelectedESBVersion();
-		if(version != null){
-			initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
-
-		}else{
-			initializeRuntimesCombo(cmbRuntimes, null, ""); //$NON-NLS-1$
-
-		}
-	}
-	private IProjectFacetVersion getSelectedESBVersion(){
-		IFacetedProjectWorkingCopy fpwc = getFacetedProjectWorkingCopy();
-		IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
-		if(fpwc != null){
-			return fpwc.getProjectFacetVersion(facet);
-		}else{
-			return null;
-		}
-		
-	}
-	
-	protected void saveJBossESBRuntimeToModel(JBossESBRuntime jbws) {
-
-		if (jbws != null) {
-			model.setStringProperty(
-					IJBossESBFacetDataModelProperties.RUNTIME_HOME,
-					jbws.getHomeDir());
-			model.setStringProperty(
-					IJBossESBFacetDataModelProperties.RUNTIME_ID, jbws
-							.getName());
-			hasRuntime = true;
-		}else{
-			model.setStringProperty(
-					IJBossESBFacetDataModelProperties.RUNTIME_ID, null);
-			model.setStringProperty(
-					IJBossESBFacetDataModelProperties.RUNTIME_HOME,	null);
-			hasRuntime = false;
-		}
-	}
-	
-	
-	 
-	private void changePageStatus(){
-		//String duplicateMsg = "";
-		/*try {
-			duplicateMsg = ESBProjectUtil.getDuplicateJars(model, cmbRuntimes.getText());
-		} catch (JavaModelException e1) {
-			JBossESBPlugin.getDefault().getLog().log(
-					StatusUtils.errorStatus(e1));
-		}*/
-		
-		if(!validFolderName(contentFolder.getText())){
-			setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Specify_Content_Folder);
-			hasValidContentFolder = false;
-			setPageComplete(isPageComplete());
-		}
-//		else if(!validFolderName(configFolder.getText())){
-//			setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Specify_Source_Folder);
-//			hasValidSrc = false;
-//			setPageComplete(isPageComplete());
-//		}
-		else if(btnUserSupplied.getSelection() && !hasRuntime){
-			setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Specify_ESB_Runtime);
-			setPageComplete(isPageComplete());
-		}else if(btnServerSupplied.getSelection() && !checkServerSuppliedESBRuntime()){
-			return;
-		}else{
-			setErrorMessage(null);
-			// try to remove the warning message once the target server runtime doesn't contains a ESB runtime.
-			if(btnUserSupplied.getSelection()){
-				setMessage(null);
-			}
-			hasRuntime = true;
-			hasValidSrc = true;
-			hasValidContentFolder = true;
-			setPageComplete(isPageComplete());
-
-		}
-	}
-	
-	private boolean validFolderName(String folderName) {
-		IWorkspace ws = ResourcesPlugin.getWorkspace();
-		return ws.validateName(folderName, IResource.FOLDER).isOK();
-	}
-	
-	@Override
-	public boolean isPageComplete() {
-		return hasValidContentFolder 
-					&& hasValidSrc
-						&& hasRuntime;
-	}
-
-
-/*	private void fillMessageGroup(Composite parent){
-		Group messageGroup = new Group(parent, SWT.);
-		messageGroup.setText("Target Message Product");
-		messageGroup.setLayout(new GridLayout(1, false));
-		messageGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-		
-	}
-*/
-	
-	public void setConfig(Object config) {
-		this.model = (IDataModel)config;
-	}
-
-	
-	public void createControl(Composite parent) {
-
-		setControl(createTopLevelComposite(parent));
-	}
-
-
-	public Object create() throws CoreException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public void dispose() {
-		if(fpwc != null){
-			fpwc.removeListener(fpListerner);
-		}
-		super.dispose();
-	}
-
-	private void createConfigVersionGroup(Composite parent) {		
-		Group configGroup = new Group(parent, SWT.NONE);
-		configGroup.setText("ESB Config Version"); //TODO move to messages
-		configGroup.setLayout(new GridLayout(3, false));
-		configGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		
-		GridData gd = new GridData();
-
-		cmbConfigVersions = new Combo(configGroup, SWT.READ_ONLY);
-		cmbConfigVersions.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		cmbConfigVersions.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				String convigVersionName = cmbConfigVersions.getText();
-				saveESBConfigVersionToModel(convigVersionName);
-				changePageStatus();
-			}
-		});
-		initializeConfigVersionCombo(cmbConfigVersions, null);
-	}
-
-	protected void saveESBConfigVersionToModel(String convigVersionName) {
-		model.setStringProperty(
-				IJBossESBFacetDataModelProperties.ESB_CONFIG_VERSION, convigVersionName);
-	}
- 
-	protected void initializeConfigVersionCombo(Combo cmVersions, String runtimeName) {
-		IProjectFacetVersion version = getSelectedESBVersion();
-		if(version != null) {
-			initializeConfigVersionCombo(cmbConfigVersions, null, version.getVersionString());
-
-		} else {
-			initializeConfigVersionCombo(cmbConfigVersions, null, ""); //$NON-NLS-1$
-		}
-	}
-
-	protected void initializeConfigVersionCombo(Combo cmVersions, String currentName, String version) {
-		cmVersions.removeAll();
-		cmVersions.add("1.0.1"); //$NON-NLS-1$
-		double versionNumber = 0.0;
-		try{
-		    versionNumber = Double.valueOf(version);
-		}
-		catch(NumberFormatException ex){
-			versionNumber = 0.0;
-		}
-		if(versionNumber >= 4.5) { //$NON-NLS-1$
-			cmVersions.add("1.1.0"); //$NON-NLS-1$
-		}
-		if(versionNumber >= 4.7){
-			cmVersions.add("1.2.0"); //$NON-NLS-1$
-		}
-		if(versionNumber >= 4.9 || versionNumber == 4.10){
-			cmVersions.add("1.3.0"); //$NON-NLS-1$
-		}
-		if(versionNumber >= 4.11){
-			cmVersions.add("1.3.1"); //$NON-NLS-1$
-		}
-		int index = cmVersions.getItemCount() - 1;
-		String convigVersionName = cmVersions.getItem(index);
-		cmVersions.select(index);
-		saveESBConfigVersionToModel(convigVersionName);
-	}
-	 
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.project.ui.wizards.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EventObject;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jst.common.project.facet.JavaFacetUtils;
+import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
+import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.tools.esb.core.ESBProjectConstant;
+import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
+import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
+import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
+import org.jboss.tools.esb.project.ui.preference.controls.JBossRuntimeListFieldEditor;
+
+public class ESBFacetInstallationPage extends AbstractFacetWizardPage implements IFacetWizardPage, IJBossESBFacetDataModelProperties {
+
+	private Label contextRootLabel;
+	private Text contentFolder;
+	private IDataModel model;
+	private boolean hasValidContentFolder = true;
+	private boolean hasValidSrc = true;
+	private boolean hasRuntime = false;
+	private Combo cmbRuntimes;
+	private Button btnUserSupplied;
+	private Button btnServerSupplied;
+	private Button btnNew;
+
+	private Combo cmbConfigVersions;
+
+	private IFacetedProjectListener fpListerner;
+	private IFacetedProjectWorkingCopy fpwc;
+	
+	public ESBFacetInstallationPage() {
+		super( "esb.facet.install.page"); //$NON-NLS-1$
+		setTitle(JBossESBUIMessages.ESBFacetInstallationPage_Title);
+		setDescription(JBossESBUIMessages.ESBFacetInstallationPage_Description);
+		
+	}
+
+	private void setDefaultOutputFolder(){
+		JavaFacetInstallConfig cfg = findJavaFacetInstallConfig();
+		if(cfg != null){
+			cfg.setDefaultOutputFolder(new Path(ESBProjectConstant.BUILD_CLASSES));
+		}
+	}
+
+	protected Composite createTopLevelComposite(Composite parent) {
+		//setInfopopID(IWstWebUIContextIds.NEW_STATIC_WEB_PROJECT_PAGE3);
+		final Composite composite = new Composite(parent, SWT.NONE);
+		composite.setLayout(new GridLayout(1, false));
+		
+		createProjectGroup(composite);
+		createRuntimeGroup(composite);
+		createConfigVersionGroup(composite);
+		setPageComplete(false);
+		setDefaultOutputFolder();
+		
+		//synchHelper.synchText(configFolder, CONTENT_DIR, null);
+	    Dialog.applyDialogFont(parent);
+	    
+	    // add listener to listen the changes on the project facet
+	    fpwc = getFacetedProjectWorkingCopy();
+	    if(fpListerner == null){
+	    	fpListerner = new IFacetedProjectListener(){
+
+				public void handleEvent(IFacetedProjectEvent event) {
+					IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
+					final IProjectFacetVersion version = fpwc.getProjectFacetVersion(facet);
+					Display.getDefault().asyncExec(new Runnable() {
+
+						public void run() {
+							if(version != null){
+								initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
+								initializeConfigVersionCombo(cmbConfigVersions, null, version.getVersionString());
+								
+							}else{
+								initializeRuntimesCombo(cmbRuntimes, null);
+								initializeConfigVersionCombo(cmbConfigVersions, null);
+							}
+							changePageStatus();
+						}
+						
+					});
+					
+				}
+			};
+	    }
+	    
+	    if(fpwc != null){
+	    	fpwc.addListener(fpListerner, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED, 
+	    			IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
+	    }
+		//set page status
+		changePageStatus();
+		
+		return composite;
+	}
+	
+	private void createProjectGroup(Composite parent){
+		
+		Group prjGroup = new Group(parent, SWT.NONE);
+		prjGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Text_Folder);
+		prjGroup.setLayout(new GridLayout(1, false));
+		prjGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		
+		
+		this.contextRootLabel = new Label(prjGroup, SWT.NONE);
+		this.contextRootLabel.setText(JBossESBUIMessages.ESBFacetInstallationPage_Label_Content_Directory);
+		this.contextRootLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+		this.contentFolder = new Text(prjGroup, SWT.BORDER);
+		this.contentFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		this.contentFolder.setData("label", this.contextRootLabel); //$NON-NLS-1$
+		this.contentFolder.setText(model.getStringProperty(ESB_CONTENT_FOLDER));
+		contentFolder.addModifyListener(new ModifyListener(){
+			public void modifyText(ModifyEvent e){
+				 String content = contentFolder.getText();
+				 if(content != null && !content.equals("")){ //$NON-NLS-1$
+					 model.setProperty(ESB_CONTENT_FOLDER, content);
+				 }
+				 changePageStatus();
+			}
+		});
+		
+	}
+	
+	
+	private IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy(){
+		Object obj = model.getProperty(IFacetDataModelProperties.FACETED_PROJECT_WORKING_COPY);
+		if(obj instanceof IFacetedProjectWorkingCopy){
+			return (IFacetedProjectWorkingCopy)obj;
+		}
+		
+		return null;
+	}
+	private JavaFacetInstallConfig findJavaFacetInstallConfig()
+	{
+        final IFacetedProjectWorkingCopy fpjwc = getFacetedProjectWorkingCopy();
+        if( fpjwc != null )
+        {
+            final IFacetedProject.Action javaInstallAction
+                = fpjwc.getProjectFacetAction( JavaFacetUtils.JAVA_FACET );
+            
+            if(javaInstallAction == null) return null;
+            
+            final Object config = javaInstallAction.getConfig();
+            
+            if( config instanceof JavaFacetInstallConfig )
+            {
+                return (JavaFacetInstallConfig) config;
+            }
+            else
+            {
+                return (JavaFacetInstallConfig) Platform.getAdapterManager().getAdapter( config, JavaFacetInstallConfig.class );
+            }
+        }
+        
+        return null;
+	}
+
+	private void createRuntimeGroup(Composite parent){
+		
+		Group runtimeGroup = new Group(parent, SWT.NONE);
+		runtimeGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Runtime_Text);
+		runtimeGroup.setLayout(new GridLayout(3, false));
+		runtimeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		
+		btnServerSupplied = new Button(runtimeGroup, SWT.RADIO);
+		btnServerSupplied.addMouseListener(new MouseAdapter(){
+			public void mouseDown(MouseEvent e) {
+				setServerSuppliedSelection(e);
+			}
+		});
+		GridData gd = new GridData();
+
+		gd.horizontalSpan = 1;
+		btnServerSupplied.setLayoutData(gd);
+
+		Label lblServerSupplied = new Label(runtimeGroup, SWT.NONE);
+		lblServerSupplied.addMouseListener(new MouseAdapter(){
+			public void mouseDown(MouseEvent e) {
+				btnServerSupplied.setSelection(true);
+				setServerSuppliedSelection(e);
+			}
+		});
+		
+		lblServerSupplied.setText(JBossESBUIMessages.ESBFacetInstallationPage_Label_Server_Supplied_Runtime);
+		gd = new GridData(GridData.FILL_HORIZONTAL);
+		gd.horizontalSpan = 2;
+		lblServerSupplied.setLayoutData(gd);
+
+		btnUserSupplied = new Button(runtimeGroup, SWT.RADIO);
+		btnUserSupplied.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				setUserSuppliedSelection(e);
+			}
+		});
+
+		cmbRuntimes = new Combo(runtimeGroup, SWT.READ_ONLY);
+		cmbRuntimes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		cmbRuntimes.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				String runtimeName = cmbRuntimes.getText();
+				JBossESBRuntime jr = (JBossESBRuntime) cmbRuntimes
+						.getData(runtimeName);
+				saveJBossESBRuntimeToModel(jr);
+				changePageStatus();
+			}
+		});
+		initializeRuntimesCombo(cmbRuntimes, null);
+
+		btnNew = new Button(runtimeGroup, SWT.NONE);
+		btnNew.setText(JBossESBUIMessages.ESBFacetInstallationPage_Button_Text_New);
+		btnNew.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				newJBossRuntime();
+				changePageStatus();
+			}
+		});
+		
+		if("".equals(cmbRuntimes.getText())){ //$NON-NLS-1$
+			hasRuntime = false;
+		}
+		
+		//set default ESB runtime option
+		btnServerSupplied.setSelection(true);
+		enableUserSupplied(false);
+		
+	}
+ 
+	protected void setServerSuppliedSelection(EventObject e) {
+		btnServerSupplied.setSelection(true);
+		btnUserSupplied.setSelection(false);
+		model
+				.setBooleanProperty(
+						IJBossESBFacetDataModelProperties.RUNTIME_IS_SERVER_SUPPLIED,
+						true);
+		//remove user supplied properties
+		model.setStringProperty(
+				IJBossESBFacetDataModelProperties.RUNTIME_ID, null);
+		model.setStringProperty(
+				IJBossESBFacetDataModelProperties.RUNTIME_HOME,	null);		
+		enableUserSupplied(false);		
+		//checkServerSuppliedESBRuntime();
+		changePageStatus();
+
+	}
+
+	protected void setUserSuppliedSelection(EventObject e) {
+		btnServerSupplied.setSelection(false);
+		btnUserSupplied.setSelection(true);
+		model
+				.setBooleanProperty(
+						IJBossESBFacetDataModelProperties.RUNTIME_IS_SERVER_SUPPLIED,
+						false);
+		String runtimename = cmbRuntimes.getText();	
+		if(runtimename == null || runtimename.equals("")){ //$NON-NLS-1$
+			hasRuntime = false;
+		}
+		JBossESBRuntime jbRuntime = JBossRuntimeManager.getInstance().findRuntimeByName(runtimename);
+		
+		
+		if (jbRuntime != null) {
+			saveJBossESBRuntimeToModel(jbRuntime);
+		}
+		enableUserSupplied(true);
+		changePageStatus();
+
+	}
+	
+	private boolean checkServerSuppliedESBRuntime() {
+
+		try {
+			IFacetedProjectWorkingCopy ifpwc = getFacetedProjectWorkingCopy();
+			//when the UI is loaded from esb project creation wizard
+			if (ifpwc != null) {
+				IRuntime runtime = ifpwc.getPrimaryRuntime();
+				if (runtime == null) {
+					setMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime, WARNING);
+					hasRuntime = true;
+					setPageComplete(isPageComplete());
+					return false;
+				}
+
+				org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
+						.findRuntime(runtime.getProperty("id")); //$NON-NLS-1$
+				IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+
+				if (!JBossRuntimeManager.isValidESBServer(serverRuntime
+						.getLocation().toOSString(), getSelectedESBVersion().getVersionString(), jbossRuntime.getJBossConfiguration())) {
+					hasRuntime = true;
+					setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime, getSelectedESBVersion().getVersionString()), WARNING);
+					setPageComplete(isPageComplete());
+					return true;
+				}
+			} 
+			// when the UI loaded from project facet properties page 
+			else {
+				String prjname = model.getStringProperty(FACET_PROJECT_NAME);
+				IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjname);
+				IFacetedProject fp = ProjectFacetsManager.create(project);
+				// if fp != null , the UI will be loaded for an exist project
+				if (fp != null) {
+					IRuntime runtime = fp.getPrimaryRuntime();
+					if (runtime == null) {
+						setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_No_Target_Runtime);
+						hasRuntime = false;
+						setPageComplete(isPageComplete());
+						return false;
+					}
+					org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
+							.findRuntime(runtime.getProperty("id"));
+					IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+
+					if (!JBossRuntimeManager.isValidESBServer(serverRuntime
+							.getLocation().toOSString(), getSelectedESBVersion().getVersionString(), jbossRuntime.getJBossConfiguration())) {
+						setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime, getSelectedESBVersion().getVersionString()), WARNING);
+						hasRuntime = true;
+						setPageComplete(isPageComplete());
+						return true;
+					}
+				} 
+			}
+			
+		} catch (CoreException e) {
+			ESBProjectPlugin.getDefault().getLog().log(e.getStatus());
+			return false;
+		}
+		// remove the warning message when users change server runtime to a server runtime that contains  ESB runtime 
+		setMessage(null);
+		return true;
+
+	}
+	
+	
+	
+	private void enableUserSupplied(boolean enabled){
+		cmbRuntimes.setEnabled(enabled);
+		btnNew.setEnabled(enabled);
+	}
+	/*
+	 * create a new jboss ESB runtime and set user supplied runtime to the new one
+	 */
+	protected void newJBossRuntime() {
+		List<JBossESBRuntime> exists = new ArrayList<JBossESBRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes()));
+		List<JBossESBRuntime> added = new ArrayList<JBossESBRuntime>();
+		
+		JBossRuntimeListFieldEditor.JBossRuntimeNewWizard newRtwizard = new JBossRuntimeListFieldEditor.JBossRuntimeNewWizard(
+				exists, added) {
+			public boolean performFinish() {
+				JBossESBRuntime rt = getRuntime();
+				rt.setDefault(true);
+				JBossRuntimeManager.getInstance().addRuntime(rt);
+				JBossRuntimeManager.getInstance().save();
+
+				return true;
+			}
+		};
+		WizardDialog dialog = new WizardDialog(Display.getCurrent()
+				.getActiveShell(), newRtwizard);
+		if (dialog.open() == WizardDialog.OK) {
+			initializeRuntimesCombo(cmbRuntimes, null);
+		}
+	}
+	
+	protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName, String version) {
+		JBossESBRuntime selectedJbRuntime = null;
+		JBossESBRuntime defaultJbws = null;
+		int selectIndex = 0;
+		int defaultIndex = 0;
+		
+		cmRuntime.removeAll();
+		if(runtimeName == null || "".equals(runtimeName)){ //$NON-NLS-1$
+			runtimeName = model.getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
+		}
+		JBossESBRuntime[] runtimes = JBossRuntimeManager.getInstance()
+				.findRuntimeByVersion(version);
+		for (int i = 0; i < runtimes.length; i++) {
+			JBossESBRuntime jr = runtimes[i];
+			cmRuntime.add(jr.getName());
+			cmRuntime.setData(jr.getName(), jr);
+			
+			if(jr.getName().equals(runtimeName)){
+				selectedJbRuntime = jr;
+				selectIndex = i;
+			}
+			// get default jbossws runtime from esb runtime preference 
+			if (jr.isDefault()) {
+				defaultJbws = jr;
+				defaultIndex = i;
+			}
+		}
+		
+		if(selectedJbRuntime != null){
+			cmRuntime.select(selectIndex);
+			if(btnUserSupplied.getSelection()){
+				saveJBossESBRuntimeToModel(selectedJbRuntime);
+			}
+		}else if(defaultJbws != null){
+			cmRuntime.select(defaultIndex);
+			if(btnUserSupplied.getSelection()){
+				saveJBossESBRuntimeToModel(defaultJbws);
+			}
+		}
+	}
+	
+	
+	protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName) {
+		IProjectFacetVersion version = getSelectedESBVersion();
+		if(version != null){
+			initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
+
+		}else{
+			initializeRuntimesCombo(cmbRuntimes, null, ""); //$NON-NLS-1$
+
+		}
+	}
+	private IProjectFacetVersion getSelectedESBVersion(){
+		IFacetedProjectWorkingCopy fpwc = getFacetedProjectWorkingCopy();
+		IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
+		if(fpwc != null){
+			return fpwc.getProjectFacetVersion(facet);
+		}else{
+			return null;
+		}
+		
+	}
+	
+	protected void saveJBossESBRuntimeToModel(JBossESBRuntime jbws) {
+
+		if (jbws != null) {
+			model.setStringProperty(
+					IJBossESBFacetDataModelProperties.RUNTIME_HOME,
+					jbws.getHomeDir());
+			model.setStringProperty(
+					IJBossESBFacetDataModelProperties.RUNTIME_ID, jbws
+							.getName());
+			hasRuntime = true;
+		}else{
+			model.setStringProperty(
+					IJBossESBFacetDataModelProperties.RUNTIME_ID, null);
+			model.setStringProperty(
+					IJBossESBFacetDataModelProperties.RUNTIME_HOME,	null);
+			hasRuntime = false;
+		}
+	}
+	
+	
+	 
+	private void changePageStatus(){
+		//String duplicateMsg = "";
+		/*try {
+			duplicateMsg = ESBProjectUtil.getDuplicateJars(model, cmbRuntimes.getText());
+		} catch (JavaModelException e1) {
+			JBossESBPlugin.getDefault().getLog().log(
+					StatusUtils.errorStatus(e1));
+		}*/
+		
+		if(!validFolderName(contentFolder.getText())){
+			setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Specify_Content_Folder);
+			hasValidContentFolder = false;
+			setPageComplete(isPageComplete());
+		}
+//		else if(!validFolderName(configFolder.getText())){
+//			setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Specify_Source_Folder);
+//			hasValidSrc = false;
+//			setPageComplete(isPageComplete());
+//		}
+		else if(btnUserSupplied.getSelection() && !hasRuntime){
+			setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Specify_ESB_Runtime);
+			setPageComplete(isPageComplete());
+		}else if(btnServerSupplied.getSelection() && !checkServerSuppliedESBRuntime()){
+            setErrorMessage(null);
+			return;
+		}else{
+			setErrorMessage(null);
+			// try to remove the warning message once the target server runtime doesn't contains a ESB runtime.
+			if(btnUserSupplied.getSelection()){
+				setMessage(null);
+			}
+			hasRuntime = true;
+			hasValidSrc = true;
+			hasValidContentFolder = true;
+			setPageComplete(isPageComplete());
+
+		}
+	}
+	
+	private boolean validFolderName(String folderName) {
+		IWorkspace ws = ResourcesPlugin.getWorkspace();
+		return ws.validateName(folderName, IResource.FOLDER).isOK();
+	}
+	
+	@Override
+	public boolean isPageComplete() {
+		return hasValidContentFolder 
+					&& hasValidSrc
+						&& hasRuntime;
+	}
+
+
+/*	private void fillMessageGroup(Composite parent){
+		Group messageGroup = new Group(parent, SWT.);
+		messageGroup.setText("Target Message Product");
+		messageGroup.setLayout(new GridLayout(1, false));
+		messageGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
+		
+	}
+*/
+	
+	public void setConfig(Object config) {
+		this.model = (IDataModel)config;
+	}
+
+	
+	public void createControl(Composite parent) {
+
+		setControl(createTopLevelComposite(parent));
+	}
+
+
+	public Object create() throws CoreException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void dispose() {
+		if(fpwc != null){
+			fpwc.removeListener(fpListerner);
+		}
+		super.dispose();
+	}
+
+	private void createConfigVersionGroup(Composite parent) {		
+		Group configGroup = new Group(parent, SWT.NONE);
+		configGroup.setText("ESB Config Version"); //TODO move to messages
+		configGroup.setLayout(new GridLayout(3, false));
+		configGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		
+		GridData gd = new GridData();
+
+		cmbConfigVersions = new Combo(configGroup, SWT.READ_ONLY);
+		cmbConfigVersions.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		cmbConfigVersions.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				String convigVersionName = cmbConfigVersions.getText();
+				saveESBConfigVersionToModel(convigVersionName);
+				changePageStatus();
+			}
+		});
+		initializeConfigVersionCombo(cmbConfigVersions, null);
+	}
+
+	protected void saveESBConfigVersionToModel(String convigVersionName) {
+		model.setStringProperty(
+				IJBossESBFacetDataModelProperties.ESB_CONFIG_VERSION, convigVersionName);
+	}
+ 
+	protected void initializeConfigVersionCombo(Combo cmVersions, String runtimeName) {
+		IProjectFacetVersion version = getSelectedESBVersion();
+		if(version != null) {
+			initializeConfigVersionCombo(cmbConfigVersions, null, version.getVersionString());
+
+		} else {
+			initializeConfigVersionCombo(cmbConfigVersions, null, ""); //$NON-NLS-1$
+		}
+	}
+
+	protected void initializeConfigVersionCombo(Combo cmVersions, String currentName, String version) {
+		cmVersions.removeAll();
+		cmVersions.add("1.0.1"); //$NON-NLS-1$
+		double versionNumber = 0.0;
+		try{
+		    versionNumber = Double.valueOf(version);
+		}
+		catch(NumberFormatException ex){
+			versionNumber = 0.0;
+		}
+		if(versionNumber >= 4.5) { //$NON-NLS-1$
+			cmVersions.add("1.1.0"); //$NON-NLS-1$
+		}
+		if(versionNumber >= 4.7){
+			cmVersions.add("1.2.0"); //$NON-NLS-1$
+		}
+		if(versionNumber >= 4.9 || versionNumber == 4.10){
+			cmVersions.add("1.3.0"); //$NON-NLS-1$
+		}
+		if(versionNumber >= 4.11){
+			cmVersions.add("1.3.1"); //$NON-NLS-1$
+		}
+		int index = cmVersions.getItemCount() - 1;
+		String convigVersionName = cmVersions.getItem(index);
+		cmVersions.select(index);
+		saveESBConfigVersionToModel(convigVersionName);
+	}
+	 
 }
\ No newline at end of file