/// <summary> /// Set the header based on the currently selected snippet. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canDelete = false; string[] snippets = GetSelectedSnippets(); if (snippets.Length > 0) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Delete.png"); presenter.ToolTip = (snippets.Length == 1) ? String.Format("Delete {0}", System.IO.Path.GetFileNameWithoutExtension(snippets[0])) : "Delete selected snippets"; } else { presenter.Header = (snippets.Length == 1) ? String.Format("Delete {0}", System.IO.Path.GetFileNameWithoutExtension(snippets[0])) : "Delete selected snippets"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Delete.png"); } canDelete = true; } IsVisible = canDelete; }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canSave = false; bool isDirty = false; if (CurrentDocument != null) { string name = System.IO.Path.GetFileNameWithoutExtension(CurrentDocument.Path); isDirty = CurrentDocument.IsDirty; if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Save.png"); presenter.ToolTip = String.Format("Save {0}", name); } else { presenter.Header = String.Format("Save {0}", name); presenter.Icon = VisualHelper.CreateIconHeader(null, "Save.png"); presenter.InputGestureText = "Ctrl+S"; } canSave = true; } IsVisible = canSave; IsEnabled = isDirty; }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canSave = false; bool isDirty = false; if (CurrentDocument != null) { Manifest manifest = CurrentDocument.Manifest; isDirty = CurrentDocument.IsDirty; if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Save.png"); presenter.ToolTip = String.Format("Save {0}", manifest.Name); } else { presenter.Header = String.Format("Save {0}", manifest.Name); presenter.Icon = VisualHelper.CreateIconHeader(null, "Save.png"); presenter.InputGestureText = "Ctrl+S"; } canSave = true; } IsVisible = canSave; IsEnabled = isDirty; }
/// <summary> /// Set the header based on the currently selected manifest. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canDelete = false; Manifest[] manifests = GetSelectedManifests(); if (manifests.Length > 0) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Delete.png"); presenter.ToolTip = (manifests.Length == 1) ? String.Format("Delete {0}", manifests[0].Name) : "Delete selected manifests"; } else { presenter.Header = (manifests.Length == 1) ? String.Format("Delete {0}", manifests[0].Name) : "Delete selected manifests"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Delete.png"); } canDelete = true; } IsVisible = canDelete; }
/// <summary> /// Set the header based on the currently selected class. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canDelete = false; SourceFile file = GetSelectedSourceFile(); if (file != null) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Delete.png"); presenter.ToolTip = String.Format("Delete {0}", file.Name); } else { presenter.Header = String.Format("Delete {0}", file.Name); presenter.Icon = VisualHelper.CreateIconHeader(null, "Delete.png"); } canDelete = true; // make sure the file isn't locked Project project = App.Instance.SalesForceApp.CurrentProject; if (project != null && file.CheckedOutBy != null && !file.CheckedOutBy.Equals(project.Client.User)) { canDelete = false; } } IsVisible = canDelete; }
/// <summary> /// Updates the data displayed. /// </summary> private void UpdateDataDisplay() { if (DataResult != null && DataResult.Data != null) { View.Data = DataResult.Data.DefaultView; if (DataResult.Data.Rows.Count == 0) { View.DataResultText = String.Format("{0} total records.", DataResult.Size); } else { View.DataResultText = String.Format("Displaying records {0} through {1} of {2} total records.", DataResult.Index + 1, DataResult.Data.Rows.Count + DataResult.Index, DataResult.Size); } if (String.IsNullOrWhiteSpace(DataResult.Data.TableName)) { Presenter.Header = VisualHelper.CreateIconHeader("SOQL", "Table.png"); Text = "SOQL"; } else { Presenter.Header = VisualHelper.CreateIconHeader(DataResult.Data.TableName, "Table.png"); Text = DataResult.Data.TableName; } } else { View.Data = null; View.DataResultText = String.Empty; } }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool isVisible = false; bool isEnabled = false; if (CurrentDocument is ClassEditorDocument) { isVisible = (CurrentDocument as ClassEditorDocument).IsTest; isEnabled = !CurrentDocument.IsDirty; if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "RunTests.png"); presenter.ToolTip = String.Format("Run tests for {0}", CurrentDocument.File.Name); } else { presenter.Header = String.Format("Run tests for {0}", CurrentDocument.File.Name); presenter.Icon = VisualHelper.CreateIconHeader(null, "RunTests.png"); } } IsVisible = isVisible; IsEnabled = isEnabled; }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { bool canCreate = false; bool isDirty = false; if (CurrentDocument != null) { Manifest manifest = CurrentDocument.Manifest; isDirty = CurrentDocument.IsDirty; if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "NewPackage.png"); presenter.ToolTip = "New package"; } else { presenter.Header = "New package"; presenter.Icon = VisualHelper.CreateIconHeader(null, "NewPackage.png"); } canCreate = true; } IsVisible = canCreate; IsEnabled = !isDirty; }
/// <summary> /// Set the headers. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Update(FunctionHost host, IFunctionPresenter presenter) { ISourceFileEditorDocument document = CurrentDocument; if (document != null) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Cut.png"); presenter.ToolTip = "Cut"; } else { presenter.Header = "Cut"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Cut.png"); presenter.InputGestureText = "Ctrl+X"; } IsVisible = true; IsEnabled = !document.IsReadOnly; } else { IsVisible = false; } }
/// <summary> /// Set the title and view. /// </summary> /// <param name="isFirstUpdate">true if this is the first update.</param> public override void Update(bool isFirstUpdate) { if (isFirstUpdate) { Presenter.Header = VisualHelper.CreateIconHeader("Test Run", "RunTests.png"); Presenter.Content = View; } }
/// <summary> /// Set the title and view. /// </summary> /// <param name="isFirstUpdate">true if this is the first update.</param> public override void Update(bool isFirstUpdate) { if (isFirstUpdate) { Presenter.Header = VisualHelper.CreateIconHeader("Search results", "FindInFiles.png"); Presenter.Content = View; } }
/// <summary> /// Set the title and view. /// </summary> /// <param name="isFirstUpdate">true if this is the first update.</param> public override void Update(bool isFirstUpdate) { if (isFirstUpdate) { Presenter.Header = VisualHelper.CreateIconHeader("Checkpoints", "Checkpoints.png"); Presenter.Content = View; } }
/// <summary> /// Set the title and view. /// </summary> /// <param name="isFirstUpdate">true if this is the first update.</param> public override void Update(bool isFirstUpdate) { if (isFirstUpdate) { Presenter.Header = VisualHelper.CreateIconHeader("Code Coverage", "CodeCoverage.png"); Presenter.Content = View; } }
/// <summary> /// Set the header based on the current state. /// </summary> private void SetHeader() { if (Presenter != null) { Presenter.Header = _isDirty ? VisualHelper.CreateIconHeader(Manifest.Name, "Manifest.png", "*") : VisualHelper.CreateIconHeader(Manifest.Name, "Manifest.png"); Presenter.ToolTip = Manifest.FileName; } }
/// <summary> /// Set the title and view. /// </summary> /// <param name="isFirstUpdate">true if this is the first update.</param> public override void Update(bool isFirstUpdate) { if (isFirstUpdate) { Presenter.Header = VisualHelper.CreateIconHeader(Package.Name, "Package.png"); Presenter.ToolTip = Package.FileName; Presenter.Content = View; } }
/// <summary> /// Do nothing on update. /// </summary> /// <param name="isFirstUpdate">Ignored.</param> public override void Update(bool isFirstUpdate) { if (isFirstUpdate) { Presenter.Header = VisualHelper.CreateIconHeader(_title, _icon); Presenter.ToolTip = _title; Presenter.Content = View; } }
/// <summary> /// Set the title and view. /// </summary> /// <param name="isFirstUpdate">true if this is the first update.</param> public override void Update(bool isFirstUpdate) { if (isFirstUpdate) { Presenter.Header = VisualHelper.CreateIconHeader(Package.Name, "DeployPackage.png"); Presenter.ToolTip = "Deployment Status"; Presenter.Content = View; } }
/// <summary> /// Set the title and view. /// </summary> /// <param name="isFirstUpdate">true if this is the first update.</param> public override void Update(bool isFirstUpdate) { if (isFirstUpdate) { Presenter.Header = VisualHelper.CreateIconHeader(GetTitle(), GetIcon()); Presenter.ToolTip = GetTitle(); Presenter.Content = View; } }
/// <summary> /// Set the title and view. /// </summary> /// <param name="isFirstUpdate">true if this is the first update.</param> public override void Update(bool isFirstUpdate) { if (isFirstUpdate) { Presenter.Header = (File == null) ? VisualHelper.CreateIconHeader("History", "History.png") : VisualHelper.CreateIconHeader(File.FullName, "History.png"); Presenter.Content = View; } }
/// <summary> /// Set header displayed. /// </summary> /// <param name="host">The type of the host.</param> /// <param name="presenter">Presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (_padIcon) { presenter.Header = _text; presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); } else { presenter.Header = _text; } }
/// <summary> /// Setup the header. /// </summary> /// <param name="host">The host for the function.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Menu) { presenter.Header = "Close all documents"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); } else { presenter.Header = "Close all documents"; } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Empty.png"); presenter.ToolTip = "Reload symbols"; } else { presenter.Header = "Reload symbols"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Empty.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "CodeCoverage.png"); presenter.ToolTip = "Show code coverage"; } else { presenter.Header = "Show code coverage"; presenter.Icon = VisualHelper.CreateIconHeader(null, "CodeCoverage.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "NewManifest.png"); presenter.ToolTip = "New manifest from selected report items..."; } else { presenter.Header = "New manifest from selected report items..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "NewManifest.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "AddComment.png"); presenter.ToolTip = "Comment selected lines"; } else { presenter.Header = "Comment selected lines"; presenter.Icon = VisualHelper.CreateIconHeader(null, "AddComment.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "NewSnippet.png"); presenter.ToolTip = "New system snippet..."; } else { presenter.Header = "New system snippet..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "NewSnippet.png"); } }
/// <summary> /// Setup the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Copy.png"); presenter.ToolTip = "Copy results to clipboard"; } else { presenter.Header = "Copy results to clipboard"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Copy.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Delete.png"); presenter.ToolTip = "Delete project..."; } else { presenter.Header = "Delete project..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "Delete.png"); } }
/// <summary> /// Set the visibility of the header. /// </summary> /// <param name="host">The type of host for this function.</param> /// <param name="presenter">The presenter to use when updating the view.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "AddFileToManifest.png"); presenter.ToolTip = "Add manual entry..."; } else { presenter.Header = "Add manual entry..."; presenter.Icon = VisualHelper.CreateIconHeader(null, "AddFileToManifest.png"); } }
/// <summary> /// Set the header. /// </summary> /// <param name="host">The type of host.</param> /// <param name="presenter">The presenter to use.</param> public override void Init(FunctionHost host, IFunctionPresenter presenter) { if (host == FunctionHost.Toolbar) { presenter.Header = VisualHelper.CreateIconHeader(null, "Checkpoints.png"); presenter.ToolTip = "Checkpoints"; } else { presenter.Header = "Checkpoints"; presenter.Icon = VisualHelper.CreateIconHeader(null, "Checkpoints.png"); } }