Skip to content

Commit 5b10eec

Browse files
committed
Add "In Classpaths only" checkbox on the "Open Resource" dialog
1 parent 865a86a commit 5b10eec

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

External/Plugins/ProjectManager/Controls/OpenResourceForm.cs

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class OpenResourceForm : SmartForm
2121
private System.Windows.Forms.Label infoLabel;
2222
private System.Windows.Forms.TextBox textBox;
2323
private System.Windows.Forms.ListBox listBox;
24+
private System.Windows.Forms.CheckBox cbInClasspathsOnly;
2425
private System.Windows.Forms.CheckBox checkBox;
2526
private System.Windows.Forms.Button refreshButton;
2627

@@ -46,6 +47,7 @@ private void InitializeComponent()
4647
this.infoLabel = new System.Windows.Forms.Label();
4748
this.textBox = new System.Windows.Forms.TextBox();
4849
this.listBox = new System.Windows.Forms.ListBox();
50+
this.cbInClasspathsOnly = new System.Windows.Forms.CheckBox();
4951
this.checkBox = new System.Windows.Forms.CheckBox();
5052
this.refreshButton = new System.Windows.Forms.Button();
5153
this.SuspendLayout();
@@ -75,20 +77,31 @@ private void InitializeComponent()
7577
this.refreshButton.Location = new System.Drawing.Point(465, 30);
7678
this.refreshButton.Name = "refreshButton";
7779
this.refreshButton.Size = new System.Drawing.Size(26, 23);
78-
this.refreshButton.TabIndex = 3;
80+
this.refreshButton.TabIndex = 4;
7981
this.refreshButton.Click += new EventHandler(RefreshButtonClick);
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(279, 9);
87+
this.cbInClasspathsOnly.Size = new System.Drawing.Size(111, 17);
88+
this.cbInClasspathsOnly.AutoSize = true;
89+
this.cbInClasspathsOnly.Name = "cbInClasspathsOnly";
90+
this.cbInClasspathsOnly.TabIndex = 2;
91+
this.cbInClasspathsOnly.Text = "In Classpaths only";
92+
this.cbInClasspathsOnly.CheckedChanged += new System.EventHandler(this.CbInClasspathsOnlyCheckedChanged);
8093
//
8194
// checkBox
8295
//
8396
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);
97+
this.checkBox.Location = new System.Drawing.Point(396, 9);
8598
this.checkBox.Size = new System.Drawing.Size(26, 24);
8699
this.checkBox.CheckAlign = ContentAlignment.MiddleRight;
87100
this.checkBox.TextAlign = ContentAlignment.MiddleLeft;
88101
this.checkBox.Text = "Code files only";
89102
this.checkBox.Name = "checkBox";
90103
this.checkBox.AutoSize = true;
91-
this.checkBox.TabIndex = 2;
104+
this.checkBox.TabIndex = 3;
92105
this.checkBox.Checked = false;
93106
this.checkBox.CheckedChanged += new EventHandler(this.CheckBoxCheckedChanged);
94107
//
@@ -100,7 +113,7 @@ private void InitializeComponent()
100113
this.listBox.Location = new System.Drawing.Point(12, 62);
101114
this.listBox.Name = "listBox";
102115
this.listBox.Size = new System.Drawing.Size(478, 276);
103-
this.listBox.TabIndex = 4;
116+
this.listBox.TabIndex = 5;
104117
this.listBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ListBoxDrawItem);
105118
this.listBox.Resize += new System.EventHandler(this.ListBoxResize);
106119
this.listBox.DoubleClick += new System.EventHandler(this.ListBoxDoubleClick);
@@ -110,6 +123,7 @@ private void InitializeComponent()
110123
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
111124
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
112125
this.ClientSize = new System.Drawing.Size(502, 340);
126+
this.Controls.Add(this.cbInClasspathsOnly);
113127
this.Controls.Add(this.listBox);
114128
this.Controls.Add(this.textBox);
115129
this.Controls.Add(this.refreshButton);
@@ -153,6 +167,7 @@ private void InitializeGraphics()
153167
private void InitializeLocalization()
154168
{
155169
this.infoLabel.Text = TextHelper.GetString("Label.SearchString");
170+
this.cbInClasspathsOnly.Text = TextHelper.GetString("Label.InClasspathsOnly");
156171
this.checkBox.Text = TextHelper.GetString("Label.CodeFilesOnly");
157172
this.Text = " " + TextHelper.GetString("Title.OpenResource");
158173
}
@@ -166,6 +181,15 @@ private void RefreshButtonClick(Object sender, EventArgs e)
166181
this.RefreshListBox();
167182
}
168183

184+
/// <summary>
185+
///
186+
/// </summary>
187+
private void CbInClasspathsOnlyCheckedChanged(Object sender, EventArgs e)
188+
{
189+
this.CreateFileList();
190+
this.RefreshListBox();
191+
}
192+
169193
/// <summary>
170194
///
171195
/// </summary>
@@ -377,7 +401,7 @@ public List<String> GetProjectFolders()
377401
{
378402
String projectFolder = Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath);
379403
List<String> folders = new List<String>();
380-
folders.Add(projectFolder);
404+
if (!cbInClasspathsOnly.Checked) folders.Add(projectFolder);
381405
if (!PluginMain.Settings.SearchExternalClassPath) return folders;
382406
foreach (String path in PluginBase.CurrentProject.SourcePaths)
383407
{

PluginCore/PluginCore/Resources/en_US.resX

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5187,6 +5187,10 @@ Custom locales must be an extension of a default locale, e.g. en-US.</value>
51875187
<value>You are renaming a file. Do you also want to update the references?</value>
51885188
<comment>Added after 4.4.3</comment>
51895189
</data>
5190+
<data name="ProjectManager.Label.InClasspathsOnly" xml:space="preserve">
5191+
<value>In Classpaths only</value>
5192+
<comment>Added after 5.0.2</comment>
5193+
</data>
51905194
<data name="ProjectManager.Label.CodeFilesOnly" xml:space="preserve">
51915195
<value>Code files only</value>
51925196
<comment>Added after 4.4.3</comment>

0 commit comments

Comments
 (0)