@@ -21,6 +21,7 @@ public class OpenResourceForm : SmartForm
21
21
private System . Windows . Forms . Label infoLabel ;
22
22
private System . Windows . Forms . TextBox textBox ;
23
23
private System . Windows . Forms . ListBox listBox ;
24
+ private System . Windows . Forms . CheckBox cbInClasspathsOnly ;
24
25
private System . Windows . Forms . CheckBox checkBox ;
25
26
private System . Windows . Forms . Button refreshButton ;
26
27
@@ -46,6 +47,7 @@ private void InitializeComponent()
46
47
this . infoLabel = new System . Windows . Forms . Label ( ) ;
47
48
this . textBox = new System . Windows . Forms . TextBox ( ) ;
48
49
this . listBox = new System . Windows . Forms . ListBox ( ) ;
50
+ this . cbInClasspathsOnly = new System . Windows . Forms . CheckBox ( ) ;
49
51
this . checkBox = new System . Windows . Forms . CheckBox ( ) ;
50
52
this . refreshButton = new System . Windows . Forms . Button ( ) ;
51
53
this . SuspendLayout ( ) ;
@@ -64,31 +66,41 @@ private void InitializeComponent()
64
66
this . textBox . Anchor = ( ( System . Windows . Forms . AnchorStyles ) ( ( ( System . Windows . Forms . AnchorStyles . Top | System . Windows . Forms . AnchorStyles . Left ) | System . Windows . Forms . AnchorStyles . Right ) ) ) ;
65
67
this . textBox . Location = new System . Drawing . Point ( 12 , 32 ) ;
66
68
this . textBox . Name = "textBox" ;
67
- this . textBox . Size = new System . Drawing . Size ( 446 , 22 ) ;
69
+ this . textBox . Size = new System . Drawing . Size ( 466 , 22 ) ;
68
70
this . textBox . TabIndex = 1 ;
69
71
this . textBox . TextChanged += new System . EventHandler ( this . TextBoxTextChanged ) ;
70
72
this . textBox . KeyDown += new System . Windows . Forms . KeyEventHandler ( this . TextBoxKeyDown ) ;
71
73
//
72
74
// refreshButton
73
75
//
74
76
this . refreshButton . Anchor = ( ( System . Windows . Forms . AnchorStyles ) ( ( System . Windows . Forms . AnchorStyles . Top | System . Windows . Forms . AnchorStyles . Right ) ) ) ;
75
- this . refreshButton . Location = new System . Drawing . Point ( 465 , 30 ) ;
77
+ this . refreshButton . Location = new System . Drawing . Point ( 485 , 30 ) ;
76
78
this . refreshButton . Name = "refreshButton" ;
77
79
this . refreshButton . Size = new System . Drawing . Size ( 26 , 23 ) ;
78
- this . refreshButton . TabIndex = 3 ;
80
+ this . refreshButton . TabIndex = 4 ;
79
81
this . refreshButton . Click += new EventHandler ( RefreshButtonClick ) ;
80
82
//
83
+ // cbInClasspathsOnly
84
+ //
85
+ this . cbInClasspathsOnly . Anchor = ( ( System . Windows . Forms . AnchorStyles ) ( ( System . Windows . Forms . AnchorStyles . Top | System . Windows . Forms . AnchorStyles . Right ) ) ) ;
86
+ this . cbInClasspathsOnly . Location = new System . Drawing . Point ( 380 , 9 ) ;
87
+ this . cbInClasspathsOnly . Size = new System . Drawing . Size ( 26 , 24 ) ;
88
+ this . cbInClasspathsOnly . Text = "In Classpaths only" ;
89
+ this . cbInClasspathsOnly . Name = "cbInClasspathsOnly" ;
90
+ this . cbInClasspathsOnly . AutoSize = true ;
91
+ this . cbInClasspathsOnly . TabIndex = 2 ;
92
+ this . cbInClasspathsOnly . Checked = false ;
93
+ this . cbInClasspathsOnly . CheckedChanged += new System . EventHandler ( this . CbInClasspathsOnlyCheckedChanged ) ;
94
+ //
81
95
// checkBox
82
96
//
83
97
this . checkBox . Anchor = ( ( System . Windows . Forms . AnchorStyles ) ( ( System . Windows . Forms . AnchorStyles . Top | System . Windows . Forms . AnchorStyles . Right ) ) ) ;
84
- this . checkBox . Location = new System . Drawing . Point ( 464 , 9 ) ;
98
+ this . checkBox . Location = new System . Drawing . Point ( 480 , 9 ) ;
85
99
this . checkBox . Size = new System . Drawing . Size ( 26 , 24 ) ;
86
- this . checkBox . CheckAlign = ContentAlignment . MiddleRight ;
87
- this . checkBox . TextAlign = ContentAlignment . MiddleLeft ;
88
100
this . checkBox . Text = "Code files only" ;
89
101
this . checkBox . Name = "checkBox" ;
90
102
this . checkBox . AutoSize = true ;
91
- this . checkBox . TabIndex = 2 ;
103
+ this . checkBox . TabIndex = 3 ;
92
104
this . checkBox . Checked = false ;
93
105
this . checkBox . CheckedChanged += new EventHandler ( this . CheckBoxCheckedChanged ) ;
94
106
//
@@ -99,8 +111,8 @@ private void InitializeComponent()
99
111
this . listBox . FormattingEnabled = true ;
100
112
this . listBox . Location = new System . Drawing . Point ( 12 , 62 ) ;
101
113
this . listBox . Name = "listBox" ;
102
- this . listBox . Size = new System . Drawing . Size ( 478 , 276 ) ;
103
- this . listBox . TabIndex = 4 ;
114
+ this . listBox . Size = new System . Drawing . Size ( 498 , 276 ) ;
115
+ this . listBox . TabIndex = 5 ;
104
116
this . listBox . DrawItem += new System . Windows . Forms . DrawItemEventHandler ( this . ListBoxDrawItem ) ;
105
117
this . listBox . Resize += new System . EventHandler ( this . ListBoxResize ) ;
106
118
this . listBox . DoubleClick += new System . EventHandler ( this . ListBoxDoubleClick ) ;
@@ -109,15 +121,16 @@ private void InitializeComponent()
109
121
//
110
122
this . AutoScaleDimensions = new System . Drawing . SizeF ( 6F , 13F ) ;
111
123
this . AutoScaleMode = System . Windows . Forms . AutoScaleMode . Font ;
112
- this . ClientSize = new System . Drawing . Size ( 502 , 340 ) ;
124
+ this . ClientSize = new System . Drawing . Size ( 522 , 340 ) ;
125
+ this . Controls . Add ( this . cbInClasspathsOnly ) ;
113
126
this . Controls . Add ( this . listBox ) ;
114
127
this . Controls . Add ( this . textBox ) ;
115
128
this . Controls . Add ( this . refreshButton ) ;
116
129
this . Controls . Add ( this . infoLabel ) ;
117
130
this . Controls . Add ( this . checkBox ) ;
118
131
this . MaximizeBox = false ;
119
132
this . MinimizeBox = false ;
120
- this . MinimumSize = new System . Drawing . Size ( 400 , 300 ) ;
133
+ this . MinimumSize = new System . Drawing . Size ( 480 , 300 ) ;
121
134
this . Name = "OpenResourceForm" ;
122
135
this . ShowIcon = false ;
123
136
this . KeyPreview = true ;
@@ -153,6 +166,7 @@ private void InitializeGraphics()
153
166
private void InitializeLocalization ( )
154
167
{
155
168
this . infoLabel . Text = TextHelper . GetString ( "Label.SearchString" ) ;
169
+ this . cbInClasspathsOnly . Text = TextHelper . GetString ( "Label.InClasspathsOnly" ) ;
156
170
this . checkBox . Text = TextHelper . GetString ( "Label.CodeFilesOnly" ) ;
157
171
this . Text = " " + TextHelper . GetString ( "Title.OpenResource" ) ;
158
172
}
@@ -166,6 +180,15 @@ private void RefreshButtonClick(Object sender, EventArgs e)
166
180
this . RefreshListBox ( ) ;
167
181
}
168
182
183
+ /// <summary>
184
+ ///
185
+ /// </summary>
186
+ private void CbInClasspathsOnlyCheckedChanged ( Object sender , EventArgs e )
187
+ {
188
+ this . CreateFileList ( ) ;
189
+ this . RefreshListBox ( ) ;
190
+ }
191
+
169
192
/// <summary>
170
193
///
171
194
/// </summary>
@@ -377,15 +400,15 @@ public List<String> GetProjectFolders()
377
400
{
378
401
String projectFolder = Path . GetDirectoryName ( PluginBase . CurrentProject . ProjectPath ) ;
379
402
List < String > folders = new List < String > ( ) ;
380
- folders . Add ( projectFolder ) ;
403
+ if ( ! cbInClasspathsOnly . Checked ) folders . Add ( projectFolder ) ;
381
404
if ( ! PluginMain . Settings . SearchExternalClassPath ) return folders ;
382
405
foreach ( String path in PluginBase . CurrentProject . SourcePaths )
383
406
{
384
407
if ( Path . IsPathRooted ( path ) ) folders . Add ( path ) ;
385
408
else
386
409
{
387
410
String folder = Path . GetFullPath ( Path . Combine ( projectFolder , path ) ) ;
388
- if ( ! folder . StartsWith ( projectFolder ) ) folders . Add ( folder ) ;
411
+ if ( cbInClasspathsOnly . Checked || ! folder . StartsWith ( projectFolder ) ) folders . Add ( folder ) ;
389
412
}
390
413
}
391
414
return folders ;
0 commit comments