|
|
|
@ -22,13 +22,14 @@ using ICSharpCode.SharpDevelop.Gui; |
|
|
|
|
|
|
|
|
|
|
|
namespace SearchAndReplace |
|
|
|
namespace SearchAndReplace |
|
|
|
{ |
|
|
|
{ |
|
|
|
public enum SearchResultPanelViewMode { |
|
|
|
public enum SearchResultPanelViewMode |
|
|
|
|
|
|
|
{ |
|
|
|
Flat, |
|
|
|
Flat, |
|
|
|
PerFile, |
|
|
|
PerFile, |
|
|
|
Structural |
|
|
|
Structural |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class SearchResultPanel : AbstractPadContent |
|
|
|
public class SearchResultPanel : AbstractPadContent, IOwnerState |
|
|
|
{ |
|
|
|
{ |
|
|
|
static SearchResultPanel instance; |
|
|
|
static SearchResultPanel instance; |
|
|
|
|
|
|
|
|
|
|
|
@ -40,6 +41,7 @@ namespace SearchAndReplace |
|
|
|
|
|
|
|
|
|
|
|
Panel myPanel = new Panel(); |
|
|
|
Panel myPanel = new Panel(); |
|
|
|
ExtTreeView resultTreeView = new ExtTreeView(); |
|
|
|
ExtTreeView resultTreeView = new ExtTreeView(); |
|
|
|
|
|
|
|
ToolStrip toolStrip; |
|
|
|
|
|
|
|
|
|
|
|
string curPattern = null; |
|
|
|
string curPattern = null; |
|
|
|
List<SearchResult> curResults = null; |
|
|
|
List<SearchResult> curResults = null; |
|
|
|
@ -139,6 +141,8 @@ namespace SearchAndReplace |
|
|
|
|
|
|
|
|
|
|
|
public void ShowSearchResults(string pattern, List<SearchResult> results) |
|
|
|
public void ShowSearchResults(string pattern, List<SearchResult> results) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
RemoveSpecialPanel(); |
|
|
|
|
|
|
|
|
|
|
|
this.curPattern = pattern; |
|
|
|
this.curPattern = pattern; |
|
|
|
this.curResults = results; |
|
|
|
this.curResults = results; |
|
|
|
if (results == null) { |
|
|
|
if (results == null) { |
|
|
|
@ -167,12 +171,53 @@ namespace SearchAndReplace |
|
|
|
resultTreeView.Dock = DockStyle.Fill; |
|
|
|
resultTreeView.Dock = DockStyle.Fill; |
|
|
|
resultTreeView.Font = ExtTreeNode.Font; |
|
|
|
resultTreeView.Font = ExtTreeNode.Font; |
|
|
|
resultTreeView.IsSorted = false; |
|
|
|
resultTreeView.IsSorted = false; |
|
|
|
ToolStrip toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/SearchResultPanel/Toolbar"); |
|
|
|
toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/SearchResultPanel/Toolbar"); |
|
|
|
toolStrip.Stretch = true; |
|
|
|
toolStrip.Stretch = true; |
|
|
|
toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; |
|
|
|
toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; |
|
|
|
|
|
|
|
|
|
|
|
myPanel.Controls.AddRange(new Control[] { resultTreeView, toolStrip} ); |
|
|
|
myPanel.Controls.AddRange(new Control[] { resultTreeView, toolStrip} ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Special panel mode:
|
|
|
|
|
|
|
|
enum SearchResultPanelOwnerState |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DefaultMode = 1, |
|
|
|
|
|
|
|
SpecialPanelMode = 2, |
|
|
|
|
|
|
|
// warning: OwnerState does a FLAG comparison!
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Control specialPanel; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Enum IOwnerState.InternalState { |
|
|
|
|
|
|
|
get { |
|
|
|
|
|
|
|
return (specialPanel != null) ? SearchResultPanelOwnerState.SpecialPanelMode : SearchResultPanelOwnerState.DefaultMode; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ShowSpecialPanel(Control ctl) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ctl.Dock = DockStyle.Fill; |
|
|
|
|
|
|
|
if (specialPanel == ctl) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
if (specialPanel != null) |
|
|
|
|
|
|
|
myPanel.Controls.Remove(specialPanel); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
myPanel.Controls.Remove(resultTreeView); |
|
|
|
|
|
|
|
specialPanel = ctl; |
|
|
|
|
|
|
|
myPanel.Controls.Add(ctl); |
|
|
|
|
|
|
|
myPanel.Controls.SetChildIndex(ctl, 0); |
|
|
|
|
|
|
|
ToolbarService.UpdateToolbar(toolStrip); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void RemoveSpecialPanel() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (specialPanel != null) { |
|
|
|
|
|
|
|
specialPanel = null; |
|
|
|
|
|
|
|
myPanel.Controls.Remove(specialPanel); |
|
|
|
|
|
|
|
myPanel.Controls.Add(resultTreeView); |
|
|
|
|
|
|
|
myPanel.Controls.SetChildIndex(resultTreeView, 0); |
|
|
|
|
|
|
|
ToolbarService.UpdateToolbar(toolStrip); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|