Exemple #1
0
        public TreeBar(FDMenus menus, ProjectContextMenu treeMenu)
        {
            this.treeMenu         = treeMenu;
            this.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
            this.Size             = new Size(200, 26);
            this.Renderer         = new DockPanelStripRenderer();
            this.GripStyle        = ToolStripGripStyle.Hidden;
            this.Padding          = new Padding(2, 1, 2, 1);
            this.CanOverflow      = false;

            RefreshSelected             = new ToolStripButton(Icons.Refresh.Img);
            RefreshSelected.ToolTipText = TextHelper.GetString("ToolTip.Refresh");
            RefreshSelected.Padding     = new Padding(0);

            ShowHidden             = new ToolStripButton(Icons.HiddenItems.Img);
            ShowHidden.ToolTipText = TextHelper.GetString("ToolTip.ShowHiddenItems");
            ShowHidden.Padding     = new Padding(0);

            ProjectProperties             = new ToolStripButton(Icons.Options.Img);
            ProjectProperties.ToolTipText = TextHelper.GetString("ToolTip.ProjectProperties");
            ProjectProperties.Padding     = new Padding(0);
            PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.Properties", ProjectProperties);

            Synchronize             = new ToolStripButton(Icons.SyncToFile.Img);
            Synchronize.ToolTipText = TextHelper.GetString("ToolTip.Synchronize");
            Synchronize.Padding     = new Padding(0);
            Synchronize.Checked     = PluginMain.Settings.TrackActiveDocument;
            PluginBase.MainForm.RegisterShortcutItem("ProjectTree.LocateActiveFile", Keys.Shift | Keys.Alt | Keys.L);
            PluginBase.MainForm.RegisterSecondaryItem("ProjectTree.LocateActiveFile", Synchronize);

            SynchronizeMain             = new ToolStripButton(Icons.ActionScriptCompile.Img);
            SynchronizeMain.ToolTipText = TextHelper.GetString("ToolTip.SynchronizeMain");
            SynchronizeMain.Padding     = new Padding(0);

            CollapseAll             = new ToolStripButton(Icons.CollapseAll.Img);
            CollapseAll.ToolTipText = TextHelper.GetString("FlashDevelop.Label.CollapseAll");
            CollapseAll.Padding     = new Padding(0);

            ProjectTypes             = new ToolStripButton(Icons.AllClasses.Img);
            ProjectTypes.ToolTipText = TextHelper.GetString("ToolTip.ProjectTypes");
            ProjectTypes.Alignment   = ToolStripItemAlignment.Right;
            ProjectTypes.Padding     = new Padding(0);
            PluginBase.MainForm.RegisterSecondaryItem("FlashToolsMenu.TypeExplorer", ProjectTypes);

            Separator        = new ToolStripSeparator();
            Separator.Margin = new Padding(0, 0, 1, 0);

            Items.Add(ShowHidden);
            Items.Add(Synchronize);
            Items.Add(SynchronizeMain);
            Items.Add(RefreshSelected);
            Items.Add(CollapseAll);
            Items.Add(Separator);
            Items.Add(ProjectProperties);
            Items.Add(ProjectTypes);
        }
Exemple #2
0
        public TreeBar(FDMenus menus, ProjectContextMenu treeMenu)
        {
            this.treeMenu = treeMenu;
            this.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
            this.Size = new Size(200, 26);
            this.Renderer = new DockPanelStripRenderer();
            this.GripStyle = ToolStripGripStyle.Hidden;
            this.Padding = new Padding(2, 1, 2, 1);
            this.CanOverflow = false;

            RefreshSelected = new ToolStripButton(Icons.Refresh.Img);
            RefreshSelected.ToolTipText = TextHelper.GetString("ToolTip.Refresh");
            RefreshSelected.Padding = new Padding(0);

            ShowHidden = new ToolStripButton(Icons.HiddenItems.Img);
            ShowHidden.ToolTipText = TextHelper.GetString("ToolTip.ShowHiddenItems");
            ShowHidden.Padding = new Padding(0);

            ProjectProperties = new ToolStripButton(Icons.Options.Img);
            ProjectProperties.ToolTipText = TextHelper.GetString("ToolTip.ProjectProperties");
            ProjectProperties.Padding = new Padding(0);
            PluginBase.MainForm.RegisterSecondaryItem("ProjectMenu.Properties", ProjectProperties);

            Synchronize = new ToolStripButton(Icons.SyncToFile.Img);
            Synchronize.ToolTipText = TextHelper.GetString("ToolTip.Synchronize");
            Synchronize.Padding = new Padding(0);
            Synchronize.Checked = PluginMain.Settings.TrackActiveDocument;
            PluginBase.MainForm.RegisterShortcutItem("ProjectTree.LocateActiveFile", Keys.Shift | Keys.Alt | Keys.L);
            PluginBase.MainForm.RegisterSecondaryItem("ProjectTree.LocateActiveFile", Synchronize);

            SynchronizeMain = new ToolStripButton(Icons.ActionScriptCompile.Img);
            SynchronizeMain.ToolTipText = TextHelper.GetString("ToolTip.SynchronizeMain");
            SynchronizeMain.Padding = new Padding(0);

            CollapseAll = new ToolStripButton(Icons.CollapseAll.Img);
            CollapseAll.ToolTipText = TextHelper.GetString("FlashDevelop.Label.CollapseAll");
            CollapseAll.Padding = new Padding(0);

            ProjectTypes = new ToolStripButton(Icons.AllClasses.Img);
            ProjectTypes.ToolTipText = TextHelper.GetString("ToolTip.ProjectTypes");
            ProjectTypes.Alignment = ToolStripItemAlignment.Right;
            ProjectTypes.Padding = new Padding(0);
            PluginBase.MainForm.RegisterSecondaryItem("FlashToolsMenu.TypeExplorer", ProjectTypes);
            
            Separator = new ToolStripSeparator();
            Separator.Margin = new Padding(0, 0, 1, 0);

            Items.Add(ShowHidden);
            Items.Add(Synchronize);
            Items.Add(SynchronizeMain);
            Items.Add(RefreshSelected);
            Items.Add(CollapseAll);
            Items.Add(Separator);
            Items.Add(ProjectProperties);
            Items.Add(ProjectTypes);
        }
		public BuildActions(IMainForm mainForm, FDMenus menus)
		{
			this.mainForm = mainForm;
            this.menus = menus;

			// setup FDProcess helper class
			this.fdProcess = new FDProcessRunner(mainForm);

            // setup remoting service so FDBuild can use our in-memory services like FlexCompilerShell
            this.ipcName = Guid.NewGuid().ToString();
            SetupRemotingServer();
		}
Exemple #4
0
        public TreeBar(FDMenus menus, ProjectContextMenu treeMenu)
        {
            this.treeMenu         = treeMenu;
            this.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
            this.Size             = new Size(200, 26);
            this.Renderer         = new DockPanelStripRenderer();
            this.GripStyle        = ToolStripGripStyle.Hidden;
            this.Padding          = new Padding(2, 1, 2, 1);
            this.CanOverflow      = false;

            RefreshSelected             = new ToolStripButton(Icons.Refresh.Img);
            RefreshSelected.ToolTipText = TextHelper.GetString("ToolTip.Refresh");
            RefreshSelected.Padding     = new Padding(0);

            ShowHidden             = new ToolStripButton(Icons.HiddenItems.Img);
            ShowHidden.ToolTipText = TextHelper.GetString("ToolTip.ShowHiddenItems");
            ShowHidden.Padding     = new Padding(0);

            ProjectProperties             = new ToolStripButton(Icons.Options.Img);
            ProjectProperties.ToolTipText = TextHelper.GetString("ToolTip.ProjectProperties");
            ProjectProperties.Padding     = new Padding(0);

            Synchronize             = new ToolStripButton(Icons.SyncToFile.Img);
            Synchronize.ToolTipText = TextHelper.GetString("ToolTip.Synchronize");
            Synchronize.Padding     = new Padding(0);

            SynchronizeMain             = new ToolStripButton(Icons.ActionScriptCompile.Img);
            SynchronizeMain.ToolTipText = TextHelper.GetString("ToolTip.Synchronize");
            SynchronizeMain.Padding     = new Padding(0);

            ProjectTypes             = new ToolStripButton(Icons.AllClasses.Img);
            ProjectTypes.ToolTipText = TextHelper.GetString("ToolTip.ProjectTypes");
            ProjectTypes.Alignment   = ToolStripItemAlignment.Right;
            ProjectTypes.Padding     = new Padding(0);

            Separator        = new ToolStripSeparator();
            Separator.Margin = new Padding(0, 0, 1, 0);

            Items.Add(ShowHidden);
            Items.Add(Synchronize);
            Items.Add(SynchronizeMain);
            Items.Add(RefreshSelected);
            Items.Add(Separator);
            Items.Add(ProjectProperties);
            Items.Add(ProjectTypes);
        }
Exemple #5
0
        public TreeBar(FDMenus menus, ProjectContextMenu treeMenu)
        {
            this.treeMenu = treeMenu;
            this.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
            this.Size = new Size(200, 26);
            this.Renderer = new DockPanelStripRenderer();
            this.GripStyle = ToolStripGripStyle.Hidden;
            this.Padding = new Padding(2, 1, 2, 1);
            this.CanOverflow = false;

            RefreshSelected = new ToolStripButton(Icons.Refresh.Img);
            RefreshSelected.ToolTipText = TextHelper.GetString("ToolTip.Refresh");
            RefreshSelected.Padding = new Padding(0);

            ShowHidden = new ToolStripButton(Icons.HiddenItems.Img);
            ShowHidden.ToolTipText = TextHelper.GetString("ToolTip.ShowHiddenItems");
            ShowHidden.Padding = new Padding(0);

            ProjectProperties = new ToolStripButton(Icons.Options.Img);
            ProjectProperties.ToolTipText = TextHelper.GetString("ToolTip.ProjectProperties");
            ProjectProperties.Padding = new Padding(0);

            Synchronize = new ToolStripButton(Icons.SyncToFile.Img);
            Synchronize.ToolTipText = TextHelper.GetString("ToolTip.Synchronize");
            Synchronize.Padding = new Padding(0);

            SynchronizeMain = new ToolStripButton(Icons.ActionScriptCompile.Img);
            SynchronizeMain.ToolTipText = TextHelper.GetString("ToolTip.Synchronize");
            SynchronizeMain.Padding = new Padding(0);

            ProjectTypes = new ToolStripButton(Icons.AllClasses.Img);
            ProjectTypes.ToolTipText = TextHelper.GetString("ToolTip.ProjectTypes");
            ProjectTypes.Alignment = ToolStripItemAlignment.Right;
            ProjectTypes.Padding = new Padding(0);
            
            Separator = new ToolStripSeparator();
            Separator.Margin = new Padding(0, 0, 1, 0);

            Items.Add(ShowHidden);
            Items.Add(Synchronize);
            Items.Add(SynchronizeMain);
            Items.Add(RefreshSelected);
            Items.Add(Separator);
            Items.Add(ProjectProperties);
            Items.Add(ProjectTypes);
        }
Exemple #6
0
		public void Initialize()
		{
            LoadSettings();
            pluginImage = MainForm.FindImage("100");
            pluginDesc = TextHelper.GetString("Info.Description");
            openFileQueue = new Queue<String>();

            Icons.Initialize(MainForm);
            EventManager.AddEventHandler(this, eventMask);

            showProjectClasspaths = Settings.ShowProjectClasspaths;
            showGlobalClasspaths = Settings.ShowGlobalClasspaths;

            #region Actions and Event Listeners

            menus = new FDMenus(MainForm);
            menus.ProjectMenu.ProjectItemsEnabled = false;
            menus.TestMovie.Enabled = false;
            menus.TestMovie.Click += delegate { TestMovie(); };
            menus.BuildProject.Enabled = false;
            menus.BuildProject.Click += delegate { BuildProject(); };
            menus.View.Click += delegate { OpenPanel(); };
            menus.GlobalClasspaths.Click += delegate { OpenGlobalClasspaths(); };
            menus.ConfigurationSelector.SelectedIndexChanged += delegate 
            {
                bool isDebug = menus.ConfigurationSelector.Text == TextHelper.GetString("Info.Debug");
                FlexCompilerShell.Cleanup();
                pluginUI.IsTraceDisabled = !isDebug;
                Project project = activeProject;
                if (project != null) project.TraceEnabled = isDebug;
            };
            menus.TargetBuildSelector.KeyDown += new KeyEventHandler(TargetBuildSelector_KeyDown);
            menus.TargetBuildSelector.SelectedIndexChanged += delegate { ApplyTargetBuild(); };
            menus.TargetBuildSelector.LostFocus += delegate { ApplyTargetBuild(); };
            
            menus.ProjectMenu.NewProject.Click += delegate { NewProject(); };
            menus.ProjectMenu.OpenProject.Click += delegate { OpenProject(); };
            menus.ProjectMenu.ImportProject.Click += delegate { ImportProject(); };
            menus.ProjectMenu.CloseProject.Click += delegate { CloseProject(false); };
            menus.ProjectMenu.OpenResource.Click += delegate { OpenResource(); };
            menus.ProjectMenu.TestMovie.Click += delegate { TestMovie(); };
            menus.ProjectMenu.RunProject.Click += delegate { RunProject(); };
            menus.ProjectMenu.BuildProject.Click += delegate { BuildProject(); };
            menus.ProjectMenu.CleanProject.Click += delegate { CleanProject(); };
            menus.ProjectMenu.Properties.Click += delegate { OpenProjectProperties(); };
            menus.RecentProjects.ProjectSelected += delegate(string projectPath) { OpenProjectSilent(projectPath); };

            buildActions = new BuildActions(MainForm,menus);
            buildActions.BuildComplete += BuildComplete;
            buildActions.BuildFailed += BuildFailed;

            flashDevelopActions = new FlashDevelopActions(MainForm);

            fileActions = new FileActions(MainForm,flashDevelopActions);
            fileActions.OpenFile += OpenFile;
            fileActions.FileDeleted += FileDeleted;
            fileActions.FileMoved += FileMoved;
            fileActions.FileCopied += FilePasted;

            projectActions = new ProjectActions(pluginUI);

            pluginUI = new PluginUI(this, menus, fileActions, projectActions);
            pluginUI.NewProject += delegate { NewProject(); };
            pluginUI.OpenProject += delegate { OpenProject(); };
            pluginUI.ImportProject += delegate { ImportProject(); };
            pluginUI.Rename += fileActions.Rename;
            pluginUI.TreeBar.ShowHidden.Click += delegate { ToggleShowHidden(); };
            pluginUI.TreeBar.Synchronize.Click += delegate { TreeSyncToCurrentFile(); };
            pluginUI.TreeBar.SynchronizeMain.Click += delegate { TreeSyncToMainFile(); };
            pluginUI.TreeBar.ProjectProperties.Click += delegate { OpenProjectProperties(); };
            pluginUI.TreeBar.RefreshSelected.Click += delegate { TreeRefreshSelectedNode(); };
            pluginUI.TreeBar.ProjectTypes.Click += delegate 
            {
                DataEvent de = new DataEvent(EventType.Command, "ASCompletion.TypesExplorer", null);
                EventManager.DispatchEvent(this, de);
            };

            pluginUI.Menu.Open.Click += delegate { TreeOpenItems(); };
            pluginUI.Menu.Execute.Click += delegate { TreeExecuteItems(); };
            pluginUI.Menu.Insert.Click += delegate { TreeInsertItem(); };
            pluginUI.Menu.AddLibrary.Click += delegate { TreeAddLibraryItems(); };
            pluginUI.Menu.AlwaysCompile.Click += delegate { TreeAlwaysCompileItems(); };
            pluginUI.Menu.SetDocumentClass.Click += delegate { TreeDocumentClass(); };
            pluginUI.Menu.DocumentClass.Click += delegate { TreeDocumentClass(); };
            pluginUI.Menu.Browse.Click += delegate { TreeBrowseItem(); };
            pluginUI.Menu.Cut.Click += delegate { TreeCutItems(); };
            pluginUI.Menu.Copy.Click += delegate { TreeCopyItems(); };
            pluginUI.Menu.Paste.Click += delegate { TreePasteItems(); };
            pluginUI.Menu.Delete.Click += delegate { TreeDeleteItems(); };
            pluginUI.Menu.LibraryOptions.Click += delegate { TreeLibraryOptions(); };
            pluginUI.Menu.HideItem.Click += delegate { TreeHideItems(); };
            pluginUI.Menu.ShowHidden.Click += delegate { ToggleShowHidden(); };
            pluginUI.Menu.AddFileFromTemplate += TreeAddFileFromTemplate;
            pluginUI.Menu.AddNewFolder.Click += delegate { TreeAddFolder(); };
            pluginUI.Menu.AddLibraryAsset.Click += delegate { TreeAddAsset(); };
            pluginUI.Menu.AddExistingFile.Click += delegate { TreeAddExistingFile(); };
            pluginUI.Menu.TestMovie.Click += delegate { TestMovie(); };
            pluginUI.Menu.BuildProject.Click += delegate { 
                BuildProject(); 
            };
            pluginUI.Menu.CloseProject.Click += delegate { CloseProject(false); };
            pluginUI.Menu.Properties.Click += delegate { OpenProjectProperties(); };
            pluginUI.Menu.ShellMenu.Click += delegate { TreeShowShellMenu(); };
            pluginUI.Menu.CommandPrompt.Click += delegate { TreeShowCommandPrompt(); };
            pluginUI.Menu.BuildProjectFile.Click += delegate { BackgroundBuild(); };
            pluginUI.Menu.BuildProjectFiles.Click += delegate { BackgroundBuild(); };
            pluginUI.Menu.BuildAllProjects.Click += delegate { FullBuild(); };
            pluginUI.Menu.TestAllProjects.Click += delegate { TestBuild(); };
            pluginUI.Menu.FindAndReplace.Click += delegate { FindAndReplace(); };
            pluginUI.Menu.FindInFiles.Click += delegate { FindInFiles(); };
            pluginUI.Menu.CopyClassName.Click += delegate { CopyClassName(); };
            pluginUI.Menu.AddSourcePath.Click += delegate { AddSourcePath(); };
            pluginUI.Menu.RemoveSourcePath.Click += delegate { RemoveSourcePath(); };
            pluginUI.Menu.Opening += new CancelEventHandler(this.MenuOpening);

            Tree.MovePath += fileActions.Move;
            Tree.CopyPath += fileActions.Copy;
            Tree.DoubleClick += delegate { TreeDoubleClick(); };

            #endregion

            pluginPanel = MainForm.CreateDockablePanel(pluginUI, Guid, Icons.Project.Img, DockState.DockRight);
            buildQueue = new Queue<String>();
            buildTimer = new Timer();
            buildTimer.Interval = 500;
            buildTimer.Tick += new EventHandler(OnBuildTimerTick);
            buildingAll = false;
            runOutput = false;
        }
Exemple #7
0
        public PluginUI(PluginMain plugin, FDMenus menus, FileActions fileActions, ProjectActions projectActions)
        {
            this.menus = menus;
            this.plugin = plugin;
            this.Text = TextHelper.GetString("Title.PluginPanel");

            #region Build TreeView and Toolbar

            menu = new ProjectContextMenu();
            menu.Rename.Click += RenameNode;

            treeBar = new TreeBar(menus, menu);

            tree = new ProjectTreeView();
            tree.BorderStyle = BorderStyle.None;
            tree.Dock = DockStyle.Fill;
            tree.ImageIndex = 0;
            tree.ImageList = Icons.ImageList;
            tree.LabelEdit = true;
            tree.SelectedImageIndex = 0;
            tree.ShowRootLines = false;
            tree.HideSelection = false;
            tree.ContextMenuStrip = menu;
            tree.AfterLabelEdit += tree_AfterLabelEdit;
            tree.BeforeLabelEdit += tree_BeforeLabelEdit;
            tree.BeforeSelect += tree_BeforeSelect;
            tree.AfterSelect += tree_AfterSelect;

            Panel panel = new Panel();
            panel.Dock = DockStyle.Fill;
            panel.Controls.Add(tree);
            panel.Controls.Add(treeBar);

            menu.ProjectTree = tree;

            #endregion

            #region Instructions

            help = new LinkLabel();
            string[] helpParts = String.Format(TextHelper.GetString("Info.NoProjectsOpenLink"), "\n").Split('|');
            string[] helpActions = { "create", "open", "import" };
            string helpText = "";
            int[] linkStart = { 0, 0, 0 };
            int[] linkLength = { 0, 0, 0 };
            for (int i = 0; i < 3; i++)
            {
                if (helpParts.Length > i * 2)
                {
                    helpText += helpParts[i * 2];
                    linkStart[i] = helpText.Length;
                    helpText += helpParts[i * 2 + 1];
                    linkLength[i] = helpParts[i * 2 + 1].Length;
                }
            }
            help.Text = helpText + helpParts[helpParts.Length - 1];
            for (int i = 0; i < 3; i++)
            {
                help.Links.Add(linkStart[i], linkLength[i], helpActions[i]);
            }
            help.LinkClicked += link_LinkClicked;
            help.Dock = DockStyle.Fill;
            help.TextAlign = ContentAlignment.MiddleCenter;
            help.ContextMenu = new ContextMenu();

            #endregion

            this.Controls.Add(help);
            this.Controls.Add(panel);

            #region Events

            fileActions.FileCreated += NewFileCreated;
            fileActions.ProjectModified += ProjectModified;
            projectActions.ProjectModified += ProjectModified;

            #endregion
        }