From: Chris M. <cm...@us...> - 2006-05-02 04:47:12
|
User: cmicali Date: 06/05/01 21:47:10 Modified: etc/andromda-dotnet/AndroMDA.VS80AddIn AndroMDA VS2005 Add-In Readme.rtf etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn AddInSettings.cs AndroMDA.VS80AddIn.csproj MDASolutionManager.cs VS80AddIn.cs etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands AboutCommand.cs AddInCommandBase.cs OpenModelCommand.cs etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs GeneralOptionsPage.Designer.cs GeneralOptionsPage.cs MDASolutionWizard.cs etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Resources/mda project.properties Added: etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn WizardSolutionProcessor.cs etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands RunSchemaExportCommand.cs Removed: etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn MDASolutionProcessor.cs Log: - Added schema export button - Made changes to button visibility occur immediatly (no restart of vs) - Renamed MDASolutionProcessor to WizardSolutionProcessor Revision Changes Path No revision No revision No revision No revision 1.3 +6 -0 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/AddInSettings.cs Index: AddInSettings.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/AddInSettings.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- AddInSettings.cs 18 Apr 2006 17:18:50 -0000 1.2 +++ AddInSettings.cs 2 May 2006 04:47:10 -0000 1.3 @@ -201,6 +201,12 @@ set { m_settings.SetBool("ADMAShowOMdl", value); } } + public bool ShowSchemaExportButton + { + get { return m_settings.GetBool("ADMAShowSCEX", true); } + set { m_settings.SetBool("ADMAShowSCEX", value); } + } + /* private string GetCommandSetting(AddInCommandBase command, string setting) { 1.5 +2 -1 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn.csproj Index: AndroMDA.VS80AddIn.csproj =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- AndroMDA.VS80AddIn.csproj 28 Apr 2006 04:40:37 -0000 1.4 +++ AndroMDA.VS80AddIn.csproj 2 May 2006 04:47:10 -0000 1.5 @@ -48,6 +48,7 @@ </Compile> <Compile Include="Commands\AboutCommand.cs" /> <Compile Include="Commands\AddInCommandBase.cs" /> + <Compile Include="Commands\RunSchemaExportCommand.cs" /> <Compile Include="Commands\ReloadMDAConfigCommand.cs" /> <Compile Include="Commands\OpenModelCommand.cs" /> <Compile Include="Commands\ResyncCommand.cs" /> @@ -102,7 +103,7 @@ <Compile Include="MavenProxy.cs" /> <Compile Include="MDAProject.cs" /> <Compile Include="MDASolutionManager.cs" /> - <Compile Include="MDASolutionProcessor.cs" /> + <Compile Include="WizardSolutionProcessor.cs" /> <Compile Include="AddInSettings.cs" /> <Compile Include="Resource1.Designer.cs"> <AutoGen>True</AutoGen> 1.3 +33 -47 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/MDASolutionManager.cs Index: MDASolutionManager.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/MDASolutionManager.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- MDASolutionManager.cs 28 Apr 2006 04:40:37 -0000 1.2 +++ MDASolutionManager.cs 2 May 2006 04:47:10 -0000 1.3 @@ -279,6 +279,24 @@ { } + #region Run schema export methods + + public void RunSchemaExport() + { + if (m_projectProperties["maven.andromda.schemaexport.available"].ToLower().Trim() == "true") + { + string schemaExportProject = FileUtils.CleanDirectory(m_projectProperties["maven.andromda.schemaexport.available"]); + string schamaExportName = FileUtils.GetFilename(schemaExportProject); + string solutionName = VSSolutionUtils.GetSolutionName(m_applicationObject.Solution); + + //m_applicationObject.ActiveWindow.ite + m_applicationObject.ExecuteCommand("Debug.StartNewInstance", "WindowsApplication1.SchemaExport"); + + } + } + + #endregion + #region Run maven methods public void StopMaven() @@ -404,50 +422,9 @@ m_coreProject.GeneratedPathProjectItem, m_coreProject.GeneratedPath, m_coreProject.Name); - /* - foreach (Project p in m_applicationObject.Solution.Projects) - { - if (p.Name == m_coreProject.Name || p.Name == m_commonProject.Name) - { - foreach (ProjectItem item in p.ProjectItems) - { - if (p.Name == m_commonProject.Name && - item.Kind == EnvDTE.Constants.vsProjectItemKindPhysicalFolder && - m_commonProject.GeneratedRelativePath == item.Name) - { - // This is the common/src folder - m_commonProject.FileListHashCodeSrc = ResyncFolder(m_commonProject.FileListHashCodeSrc, item, m_commonProject.ManualPath, p.Name); - } - - if (p.Name == m_commonProject.Name && - item.Kind == EnvDTE.Constants.vsProjectItemKindPhysicalFolder && - m_commonProject.GeneratedRelativePath == item.Name) - { - // This is the common/target folder - m_commonProject.FileListHashCodeTarget = ResyncFolder(m_commonProject.FileListHashCodeTarget, item, m_commonProject.GeneratedPath, p.Name); - } - if (p.Name == m_coreProject.Name && - item.Kind == EnvDTE.Constants.vsProjectItemKindPhysicalFolder && - m_coreProject.ManualRelativePath == item.Name) - { - // This is the core/src folder - m_coreProject.FileListHashCodeSrc = ResyncFolder(m_coreProject.FileListHashCodeSrc, item, m_coreProject.ManualPath, p.Name); - } - - if (p.Name == m_coreProject.Name && - item.Kind == EnvDTE.Constants.vsProjectItemKindPhysicalFolder && - m_coreProject.GeneratedRelativePath == item.Name) - { - // This is the core/target folder - m_coreProject.FileListHashCodeTarget = ResyncFolder(m_coreProject.FileListHashCodeTarget, item, m_coreProject.GeneratedPath, p.Name); - } - - } - } - } - */ m_applicationObject.StatusBar.Progress(false, "AndroMDA: Resync complete", 1, 1); + } private int ResyncFolder(int fileListHashCode, ProjectItem item, string folderPath, string projectName) @@ -456,6 +433,15 @@ { return -1; } + + /* + if (!System.IO.Directory.Exists(folderPath)) + { + item.Remove(); + return 0; + } + */ + UpdateResyncProgressBar(projectName + "/" + item.Name); // Get the UI nodes so we can collapse the projects UIHierarchy solutionExplorer = (UIHierarchy)m_applicationObject.Windows.Item(Constants.vsext_wk_SProjectWindow).Object; 1.4 +2 -1 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/VS80AddIn.cs Index: VS80AddIn.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/VS80AddIn.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- VS80AddIn.cs 28 Apr 2006 16:07:24 -0000 1.3 +++ VS80AddIn.cs 2 May 2006 04:47:10 -0000 1.4 @@ -82,6 +82,7 @@ m_commands.Add(new RunMavenCommand()); m_commands.Add(new ResyncCommand()); m_commands.Add(new StopCommand()); + m_commands.Add(new RunSchemaExportCommand()); m_commands.Add(new OpenModelCommand()); m_commands.Add(new AboutCommand()); // Set the context for each command 1.1 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/WizardSolutionProcessor.cs Index: WizardSolutionProcessor.cs =================================================================== // AndroMDA Visual Studio 2005 Add-In // (c)2006 Sapient Corporation #region Using statements using System; using System.IO; using System.Collections.Generic; using System.Text; using System.Threading; using EnvDTE; using EnvDTE80; using VSLangProj; using ICSharpCode.SharpZipLib.Checksums; using ICSharpCode.SharpZipLib.Zip; #endregion namespace AndroMDA.VS80AddIn { public class WizardSolutionProcessor { #region Member variables private DTE m_applicationObject = null; private System.Threading.Thread m_thread = null; public delegate void SolutionProcessingCompleteHandler(bool success, string errorMessage); public delegate void SolutionProcessingStatusHandler(string status); public event SolutionProcessingCompleteHandler OnSolutionProcessingComplete; public event SolutionProcessingStatusHandler OnSolutionProcessingStatus; private ConfigFile m_configuration = null; #endregion public WizardSolutionProcessor(ConfigFile config, DTE applicationObject) { m_configuration = config; m_applicationObject = applicationObject; } private void AddToStatus(string message) { if (OnSolutionProcessingStatus != null) { if (OnSolutionProcessingStatus.Target is System.Windows.Forms.Control) { System.Windows.Forms.Control target = OnSolutionProcessingStatus.Target as System.Windows.Forms.Control; target.BeginInvoke(OnSolutionProcessingStatus, new Object[] { message }); } else { OnSolutionProcessingStatus(message); } } System.Threading.Thread.Sleep(100); } public void EnableSolutionForMDA() { m_thread = new System.Threading.Thread(new ThreadStart(this.UpdateSolutionThread)); m_thread.Start(); } private void UpdateSolutionThread() { bool success = false; string errorMessage = string.Empty; try { UpdateSolution(); success = true; } catch (Exception e) { errorMessage = "An error occured while attempting to update the solution: " + e.ToString(); } finally { // Fire the processing complete event if (OnSolutionProcessingComplete != null) { if (OnSolutionProcessingComplete.Target is System.Windows.Forms.Control) { System.Windows.Forms.Control target = OnSolutionProcessingComplete.Target as System.Windows.Forms.Control; target.BeginInvoke(OnSolutionProcessingComplete, new Object[] { success, errorMessage }); } else { OnSolutionProcessingComplete(success, errorMessage); } } } } private void UpdateSolution() { string basePath = m_configuration["solution.path"]; AddToStatus("Adding AndroMDA support to solution..."); Project commonProject = null; Project coreProject = null; Project schemaExportProject = null; // Create/find the common project if (m_configuration["projects.common.create"] == "true") { AddToStatus("Creating common project " + m_configuration["projects.common.name"] + "..."); commonProject = VSSolutionUtils.AddClassLibraryProjectToSolution(m_configuration["projects.common.name"], (Solution2)m_applicationObject.Solution); } else { AddToStatus("Using existing common project " + m_configuration["projects.common.name"] + "..."); commonProject = VSSolutionUtils.FindProjectByName(m_configuration["projects.common.name"], m_applicationObject.Solution); } //CreateDirectory(basePath + "\\" + m_configuration["projects.common.dir"] + "\\src"); //CreateDirectory(basePath + "\\" + m_configuration["projects.common.dir"] + "\\target"); commonProject.ProjectItems.AddFolder("src", Constants.vsProjectItemKindPhysicalFolder); commonProject.ProjectItems.AddFolder("target", Constants.vsProjectItemKindPhysicalFolder); WriteFile(basePath + "\\" + m_configuration["projects.common.dir"] + "\\project.xml", ParseVariables(Resource1.common_project_xml)); // Create/find the common project if (m_configuration["projects.core.create"] == "true") { AddToStatus("Creating core project " + m_configuration["projects.core.name"] + "..."); coreProject = VSSolutionUtils.AddClassLibraryProjectToSolution(m_configuration["projects.core.name"], (Solution2)m_applicationObject.Solution); } else { AddToStatus("Using existing core project " + m_configuration["projects.core.name"] + "..."); coreProject = VSSolutionUtils.FindProjectByName(m_configuration["projects.core.name"], m_applicationObject.Solution); } //CreateDirectory(basePath + "\\" + m_configuration["projects.core.dir"] + "\\src"); //CreateDirectory(basePath + "\\" + m_configuration["projects.core.dir"] + "\\target"); coreProject.ProjectItems.AddFolder("src", Constants.vsProjectItemKindPhysicalFolder); coreProject.ProjectItems.AddFolder("target", Constants.vsProjectItemKindPhysicalFolder); WriteFile(basePath + "\\" + m_configuration["projects.core.dir"] + "\\project.xml", ParseVariables(Resource1.core_project_xml)); // Create the schema export project if (m_configuration["projects.schemaexport.create"] == "true") { AddToStatus("Creating schema export project " + m_configuration["projects.schemaexport.name"] + "..."); schemaExportProject = VSSolutionUtils.AddConsoleAppProjectToSolution(m_configuration["projects.schemaexport.name"], (Solution2)m_applicationObject.Solution); WriteFile(basePath + "\\" + m_configuration["projects.schemaexport.dir"] + "\\App.config", ParseVariables(Resource1.SchemaExport_App_config)); WriteFile(basePath + "\\" + m_configuration["projects.schemaexport.dir"] + "\\nhibernate.config", ParseVariables(Resource1.SchemaExport_nhibernate_config)); WriteFile(basePath + "\\" + m_configuration["projects.schemaexport.dir"] + "\\Program.cs", ParseVariables(Resource1.SchemaExport_Program_cs)); ProjectItem appConfig = schemaExportProject.ProjectItems.AddFromFile(basePath + "\\" + m_configuration["projects.schemaexport.dir"] + "\\App.config"); ProjectItem nhibernateConfig = schemaExportProject.ProjectItems.AddFromFile(basePath + "\\" + m_configuration["projects.schemaexport.dir"] + "\\nhibernate.config"); // Set the config files 'Copy to Output Directory' property to 'Copy if Newer' appConfig.Properties.Item("CopyToOutputDirectory").Value = 2; appConfig.Properties.Item("BuildAction").Value = VSLangProj.prjBuildAction.prjBuildActionContent; nhibernateConfig.Properties.Item("CopyToOutputDirectory").Value = 2; nhibernateConfig.Properties.Item("BuildAction").Value = VSLangProj.prjBuildAction.prjBuildActionContent; schemaExportProject.ProjectItems.AddFromFile(basePath + "\\" + m_configuration["projects.schemaexport.dir"] + "\\Program.cs"); } // Render /maven.xml WriteFile(basePath + "\\maven.xml", ParseVariables(Resource1.maven_xml)); // Render /project.properties WriteFile(basePath + "\\project.properties", ParseVariables(Resource1.project_properties)); // Render /project.xml WriteFile(basePath + "\\project.xml", ParseVariables(Resource1.project_xml)); // Create mda directory CreateDirectory(basePath + "\\mda"); // Render /mda/maven.xml WriteFile(basePath + "\\mda\\maven.xml", ParseVariables(Resource1.mda_maven_xml)); // Render /mda/project.properties WriteFile(basePath + "\\mda\\project.properties", ParseVariables(Resource1.mda_project_properties)); // Render /mda/project.xml WriteFile(basePath + "\\mda\\project.xml", ParseVariables(Resource1.mda_project_xml)); // Create mda/conf directory CreateDirectory(basePath + "\\mda\\conf"); // Render /mda/conf/andromda.xml WriteFile(basePath + "\\mda\\conf\\andromda.xml", ParseVariables(Resource1.mda_conf_andromda_xml)); // Create mda/src directory System.IO.Directory.CreateDirectory(basePath + "\\mda\\src"); // Create mda/uml directory System.IO.Directory.CreateDirectory(basePath + "\\mda\\src\\uml"); // Create the empty model file WriteCompressedFile(m_configuration["application.model.filename.unzipped"], basePath + "\\mda\\src\\uml\\" + m_configuration["application.model.filename"], Resource1.mda_src_uml_empty_model_xml); // Create the lib directory CreateDirectory(basePath + "\\Lib"); // Write the libraries out WriteFile(basePath + "\\Lib\\AndroMDA.NHibernateSupport.dll", Resource1.lib_AndroMDA_NHibernateSupport_dll); WriteFile(basePath + "\\Lib\\Bamboo.Prevalence.dll", Resource1.lib_Bamboo_Prevalence_dll); WriteFile(basePath + "\\Lib\\Castle.DynamicProxy.dll", Resource1.lib_Castle_DynamicProxy_dll); WriteFile(basePath + "\\Lib\\HashCodeProvider.dll", Resource1.lib_HashCodeProvider_dll); WriteFile(basePath + "\\Lib\\Iesi.Collections.dll", Resource1.lib_Iesi_Collections_dll); WriteFile(basePath + "\\Lib\\log4net.dll", Resource1.lib_log4net_dll); WriteFile(basePath + "\\Lib\\NHibernate.Caches.Prevalence.dll", Resource1.lib_NHibernate_Caches_Prevalence_dll); WriteFile(basePath + "\\Lib\\NHibernate.Caches.SysCache.dll", Resource1.lib_NHibernate_Caches_SysCache_dll); WriteFile(basePath + "\\Lib\\NHibernate.dll", Resource1.lib_NHibernate_dll); WriteFile(basePath + "\\Lib\\NHibernate.Nullables2.dll", Resource1.lib_NHibernate_Nullables2_dll); AddToStatus("Adding project references..."); // Add the references to all the DLLs we just put in /Lib AddBinaryReferences(commonProject, basePath); AddBinaryReferences(coreProject, basePath); // Add a reference from the core project to the common project AddProjectReference(coreProject, commonProject); // If we created the schema export project if (schemaExportProject != null) { // Add the references to the DLLs AddBinaryReferences(schemaExportProject, basePath); // Add references to the core and common projects AddProjectReference(schemaExportProject, commonProject); AddProjectReference(schemaExportProject, coreProject); } } private void AddProjectReference(Project destination, Project projectToReference) { VSProject proj = destination.Object as VSProject; proj.References.AddProject(projectToReference); } private void AddBinaryReferences(Project p, string basePath) { VSProject proj = p.Object as VSProject; proj.References.Add(basePath + "\\Lib\\AndroMDA.NHibernateSupport.dll"); proj.References.Add(basePath + "\\Lib\\Castle.DynamicProxy.dll"); proj.References.Add(basePath + "\\Lib\\HashCodeProvider.dll"); proj.References.Add(basePath + "\\Lib\\Iesi.Collections.dll"); proj.References.Add(basePath + "\\Lib\\log4net.dll"); proj.References.Add(basePath + "\\Lib\\NHibernate.Caches.SysCache.dll"); proj.References.Add(basePath + "\\Lib\\NHibernate.dll"); proj.References.Add(basePath + "\\Lib\\NHibernate.Nullables2.dll"); } private void CreateDirectory(string directoryName) { if (System.IO.Directory.Exists(directoryName)) { AddToStatus("Skipping " + directoryName + " (directory already exists)..."); } else { AddToStatus("Creating directory " + directoryName + "..."); } AddToStatus("Creating directory " + directoryName + "..."); try { System.IO.Directory.CreateDirectory(directoryName); } catch { } } private string ParseVariables(string content) { foreach (string key in m_configuration.Keys) { string variableKey = "${wizard." + key + "}"; if (content.Contains(variableKey)) { content = content.Replace(variableKey, m_configuration[key]); } } return content; } private void WriteFile(string filePath, string fileContent) { if (System.IO.File.Exists(filePath)) { AddToStatus("Skipping " + filePath + " (file already exists)..."); } else { AddToStatus("Creating " + filePath + "..."); } StreamWriter sw = new StreamWriter(filePath, false); sw.Write(ParseVariables(fileContent)); sw.Close(); } private void WriteCompressedFile(string fileNameInZip, string destinationFile, string fileContent) { if (System.IO.File.Exists(destinationFile)) { AddToStatus("Skipping " + fileNameInZip + " (file already exists)..."); } else { AddToStatus("Compressing " + fileNameInZip + "..."); } ZipOutputStream zip = new ZipOutputStream(File.Create(destinationFile)); zip.SetLevel(6); System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); byte[] modelData = encoding.GetBytes(Resource1.mda_src_uml_empty_model_xml); ZipEntry entry = new ZipEntry(fileNameInZip); entry.DateTime = DateTime.Now; entry.Size = modelData.Length; Crc32 crc = new Crc32(); crc.Reset(); crc.Update(modelData); entry.Crc = crc.Value; zip.PutNextEntry(entry); zip.Write(modelData, 0, modelData.Length); zip.Finish(); zip.Close(); } private void WriteFile(string filePath, Byte[] fileContent) { if (System.IO.File.Exists(filePath)) { AddToStatus("Skipping " + filePath + " (file already exists)..."); } else { AddToStatus("Creating " + filePath + "..."); } FileStream fs = new FileStream(filePath, FileMode.Create); fs.Write(fileContent, 0, fileContent.Length); fs.Close(); } } } 1.2 +9 -0 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/AboutCommand.cs Index: AboutCommand.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/AboutCommand.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- AboutCommand.cs 18 Apr 2006 16:14:44 -0000 1.1 +++ AboutCommand.cs 2 May 2006 04:47:10 -0000 1.2 @@ -29,6 +29,15 @@ a.ShowDialog(); } + public override void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText) + { + base.QueryStatus(commandName, neededText, ref status, ref commandText); + if (!m_addInSettings.ShowAboutButton) + { + status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusInvisible; + } + } + public override void AddToToolbar(CommandBar toolbar, int position) { if (m_addInSettings.ShowAboutButton) 1.3 +1 -1 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/AddInCommandBase.cs Index: AddInCommandBase.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/AddInCommandBase.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- AddInCommandBase.cs 28 Apr 2006 04:40:37 -0000 1.2 +++ AddInCommandBase.cs 2 May 2006 04:47:10 -0000 1.3 @@ -139,7 +139,7 @@ /// <param name="neededText">The needed text.</param> /// <param name="status">The status.</param> /// <param name="commandText">The command text.</param> - public void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText) + public virtual void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText) { if (commandName == m_fullName && neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone) { 1.3 +10 -0 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/OpenModelCommand.cs Index: OpenModelCommand.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/OpenModelCommand.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- OpenModelCommand.cs 18 Apr 2006 17:18:51 -0000 1.2 +++ OpenModelCommand.cs 2 May 2006 04:47:10 -0000 1.3 @@ -51,6 +51,16 @@ } } + + public override void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText) + { + base.QueryStatus(commandName, neededText, ref status, ref commandText); + if (!m_addInSettings.ShowOpenModelButton) + { + status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusInvisible; + } + } + public override void AddToToolbar(CommandBar toolbar, int position) { if (m_addInSettings.ShowOpenModelButton) 1.1 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Commands/RunSchemaExportCommand.cs Index: RunSchemaExportCommand.cs =================================================================== // AndroMDA Visual Studio 2005 Add-In // (c)2006 Sapient Corporation #region Using statements using System; using System.Collections.Generic; using System.Text; using EnvDTE; using Microsoft.VisualStudio.CommandBars; #endregion namespace AndroMDA.VS80AddIn { public class RunSchemaExportCommand : AddInCommandBase { public RunSchemaExportCommand() { Init("RunSchemaExport", "Export Schema", "Export Schema", 4005, AddInCommandBase.AddInCommandType.MDAEnabledWhileMavenNotRunning); m_isStartOfGroup = true; } public override void Exec(vsCommandExecOption executeOption, ref object varIn, ref object varOut) { m_solutionManager.RunSchemaExport(); } public override void QueryStatus(string commandName, vsCommandStatusTextWanted neededText, ref vsCommandStatus status, ref object commandText) { base.QueryStatus(commandName, neededText, ref status, ref commandText); if (!m_addInSettings.ShowSchemaExportButton) { status = vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusInvisible; } } public override void AddToToolbar(CommandBar toolbar, int position) { if (m_addInSettings.ShowSchemaExportButton) { base.AddToToolbar(toolbar, position); } } } } 1.2 +94 -81 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs/GeneralOptionsPage.Designer.cs Index: GeneralOptionsPage.Designer.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs/GeneralOptionsPage.Designer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- GeneralOptionsPage.Designer.cs 18 Apr 2006 17:18:51 -0000 1.1 +++ GeneralOptionsPage.Designer.cs 2 May 2006 04:47:10 -0000 1.2 @@ -29,26 +29,58 @@ private void InitializeComponent() { this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.cbShowSchemaExportButton = new System.Windows.Forms.CheckBox(); + this.cbShowOpenModelButton = new System.Windows.Forms.CheckBox(); + this.cbShowAboutButton = new System.Windows.Forms.CheckBox(); this.label2 = new System.Windows.Forms.Label(); this.txtResyncIgnoreList = new System.Windows.Forms.TextBox(); - this.cbShowAboutButton = new System.Windows.Forms.CheckBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.cbShowOpenModelButton = new System.Windows.Forms.CheckBox(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // groupBox1 // + this.groupBox1.Controls.Add(this.cbShowSchemaExportButton); this.groupBox1.Controls.Add(this.cbShowOpenModelButton); this.groupBox1.Controls.Add(this.cbShowAboutButton); this.groupBox1.Location = new System.Drawing.Point(0, 72); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(395, 68); + this.groupBox1.Size = new System.Drawing.Size(395, 92); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; this.groupBox1.Text = "Appearance"; // + // cbShowSchemaExportButton + // + this.cbShowSchemaExportButton.AutoSize = true; + this.cbShowSchemaExportButton.Location = new System.Drawing.Point(12, 65); + this.cbShowSchemaExportButton.Name = "cbShowSchemaExportButton"; + this.cbShowSchemaExportButton.Size = new System.Drawing.Size(208, 17); + this.cbShowSchemaExportButton.TabIndex = 0; + this.cbShowSchemaExportButton.Text = "Show s&chema export button on toolbar"; + this.cbShowSchemaExportButton.UseVisualStyleBackColor = true; + // + // cbShowOpenModelButton + // + this.cbShowOpenModelButton.AutoSize = true; + this.cbShowOpenModelButton.Location = new System.Drawing.Point(11, 42); + this.cbShowOpenModelButton.Name = "cbShowOpenModelButton"; + this.cbShowOpenModelButton.Size = new System.Drawing.Size(194, 17); + this.cbShowOpenModelButton.TabIndex = 0; + this.cbShowOpenModelButton.Text = "Show &open model button on toolbar"; + this.cbShowOpenModelButton.UseVisualStyleBackColor = true; + // + // cbShowAboutButton + // + this.cbShowAboutButton.AutoSize = true; + this.cbShowAboutButton.Location = new System.Drawing.Point(11, 19); + this.cbShowAboutButton.Name = "cbShowAboutButton"; + this.cbShowAboutButton.Size = new System.Drawing.Size(166, 17); + this.cbShowAboutButton.TabIndex = 0; + this.cbShowAboutButton.Text = "&Show about button on toolbar"; + this.cbShowAboutButton.UseVisualStyleBackColor = true; + // // label2 // this.label2.AutoSize = true; @@ -65,16 +97,6 @@ this.txtResyncIgnoreList.Size = new System.Drawing.Size(359, 20); this.txtResyncIgnoreList.TabIndex = 1; // - // cbShowAboutButton - // - this.cbShowAboutButton.AutoSize = true; - this.cbShowAboutButton.Location = new System.Drawing.Point(11, 19); - this.cbShowAboutButton.Name = "cbShowAboutButton"; - this.cbShowAboutButton.Size = new System.Drawing.Size(166, 17); - this.cbShowAboutButton.TabIndex = 0; - this.cbShowAboutButton.Text = "&Show about button on toolbar"; - this.cbShowAboutButton.UseVisualStyleBackColor = true; - // // groupBox2 // this.groupBox2.Controls.Add(this.label2); @@ -86,16 +108,6 @@ this.groupBox2.TabStop = false; this.groupBox2.Text = "General"; // - // cbShowOpenModelButton - // - this.cbShowOpenModelButton.AutoSize = true; - this.cbShowOpenModelButton.Location = new System.Drawing.Point(11, 42); - this.cbShowOpenModelButton.Name = "cbShowOpenModelButton"; - this.cbShowOpenModelButton.Size = new System.Drawing.Size(194, 17); - this.cbShowOpenModelButton.TabIndex = 0; - this.cbShowOpenModelButton.Text = "Show &open model button on toolbar"; - this.cbShowOpenModelButton.UseVisualStyleBackColor = true; - // // GeneralOptionsPage // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -120,5 +132,6 @@ private System.Windows.Forms.CheckBox cbShowAboutButton; private System.Windows.Forms.CheckBox cbShowOpenModelButton; private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.CheckBox cbShowSchemaExportButton; } } 1.2 +5 -2 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs/GeneralOptionsPage.cs Index: GeneralOptionsPage.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs/GeneralOptionsPage.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- GeneralOptionsPage.cs 18 Apr 2006 17:18:51 -0000 1.1 +++ GeneralOptionsPage.cs 2 May 2006 04:47:10 -0000 1.2 @@ -41,6 +41,7 @@ m_settings = new AddInSettings(DTEObject); cbShowAboutButton.Checked = m_settings.ShowAboutButton; cbShowOpenModelButton.Checked = m_settings.ShowOpenModelButton; + cbShowSchemaExportButton.Checked = m_settings.ShowSchemaExportButton; txtResyncIgnoreList.Text = m_settings.ResyncIgnoreList; UpdateState(); } @@ -75,9 +76,11 @@ { m_settings.ShowAboutButton = cbShowAboutButton.Checked; m_settings.ShowOpenModelButton = cbShowOpenModelButton.Checked; + m_settings.ShowSchemaExportButton = cbShowSchemaExportButton.Checked; m_settings.ResyncIgnoreList = txtResyncIgnoreList.Text; } #endregion + } } 1.2 +3 -3 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs/MDASolutionWizard.cs Index: MDASolutionWizard.cs =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Dialogs/MDASolutionWizard.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- MDASolutionWizard.cs 18 Apr 2006 16:14:44 -0000 1.1 +++ MDASolutionWizard.cs 2 May 2006 04:47:10 -0000 1.2 @@ -323,9 +323,9 @@ /// </summary> private void UpdateSolution() { - MDASolutionProcessor processor = new MDASolutionProcessor(CreateSolutionWizardConfiguration(), m_applicationObject); - processor.OnSolutionProcessingComplete += new MDASolutionProcessor.SolutionProcessingCompleteHandler(processor_OnSolutionProcessingComplete); - processor.OnSolutionProcessingStatus += new MDASolutionProcessor.SolutionProcessingStatusHandler(processor_OnSolutionProcessingStatus); + WizardSolutionProcessor processor = new WizardSolutionProcessor(CreateSolutionWizardConfiguration(), m_applicationObject); + processor.OnSolutionProcessingComplete += new WizardSolutionProcessor.SolutionProcessingCompleteHandler(processor_OnSolutionProcessingComplete); + processor.OnSolutionProcessingStatus += new WizardSolutionProcessor.SolutionProcessingStatusHandler(processor_OnSolutionProcessingStatus); processor.EnableSolutionForMDA(); } 1.2 +3 -0 plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Resources/mda/project.properties Index: project.properties =================================================================== RCS file: /cvsroot/andromdaplugins/plugins/etc/andromda-dotnet/AndroMDA.VS80AddIn/AndroMDA.VS80AddIn/Resources/mda/project.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- project.properties 18 Apr 2006 16:14:45 -0000 1.1 +++ project.properties 2 May 2006 04:47:10 -0000 1.2 @@ -24,6 +24,9 @@ maven.andromda.web.generated.dir=${maven.andromda.web.dir}/target maven.andromda.web.manual.java.dir=${maven.andromda.web.dir}/src +maven.andromda.schemaexport.dir=${maven.src.dir}/../../${wizard.projects.schemaexport.dir} +maven.andromda.schemaexport.available=${wizard.projects.schemaexport.create} + # The default strategy to use when using inhertiance hibernate.inheritance.strategy=subclass hibernate.db.showSql=true \ No newline at end of file |