Author: scabanovich
Date: 2011-12-06 16:34:18 -0500 (Tue, 06 Dec 2011)
New Revision: 37017
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityConfigurationBlock.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityPreferencePage.java
Log:
JBIDE-10364
https://issues.jboss.org/browse/JBIDE-10364
Initialized filter text field input in Preferences dialog invoked by "Configure
Problem Severity" quick fix.
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityConfigurationBlock.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityConfigurationBlock.java 2011-12-06
21:29:36 UTC (rev 37016)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityConfigurationBlock.java 2011-12-06
21:34:18 UTC (rev 37017)
@@ -84,7 +84,11 @@
protected PixelConverter fPixelConverter;
protected FilteredPreferenceTree fFilteredPrefTree;
-
+ /**
+ * Text control retrieved from fFilteredPrefTree.
+ */
+ protected Text filterControl;
+
public SeverityConfigurationBlock(IStatusChangeListener context,
IProject project, Key[] allKeys,
IWorkbenchPreferenceContainer container) {
@@ -110,8 +114,13 @@
addMaxNumberOfMarkersField(c);
}
addWrongBuilderOrderField(c);
+
+ Control[] currentControls = folder.getChildren();
fFilteredPrefTree = new FilteredPreferenceTree(this, folder, getCommonDescription());
+
+ filterControl = findText(folder, currentControls.length);
+
final ScrolledPageContent sc1 = fFilteredPrefTree.getScrolledPageContent();
Composite composite = sc1.getBody();
@@ -129,6 +138,22 @@
return sc1;
}
+ Text findText(Composite composite, int startFromIndex) {
+ Control[] cs = composite.getChildren();
+ for (int i = startFromIndex; i < cs.length; i++) {
+ Control cl = cs[i];
+ if(cl instanceof Text) {
+ return (Text)cl;
+ } else if(cl instanceof Composite) {
+ Text t = findText((Composite)cl, 0);
+ if(t != null) {
+ return t;
+ }
+ }
+ }
+ return null;
+ }
+
protected Composite createInnerComposite(ExpandableComposite excomposite, int nColumns,
Font font) {
Composite inner= new Composite(excomposite, SWT.NONE);
inner.setFont(font);
@@ -301,6 +326,10 @@
key = getKey(pluginId, keyName);
}
}
+
+ public Text getFilterControl() {
+ return filterControl;
+ }
public void doFilter(String prefId){
String qualifier = getQualifier();
@@ -314,8 +343,13 @@
if(combo != null){
String value = ((Label)fLabels.get(combo)).getText();
- if(value != null)
- fFilteredPrefTree.doFilter(value);
+ if(value != null) {
+ if(filterControl != null) {
+ filterControl.setText(value);
+ } else {
+ fFilteredPrefTree.doFilter(value);
+ }
+ }
}
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityPreferencePage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityPreferencePage.java 2011-12-06
21:29:36 UTC (rev 37016)
+++
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/preferences/SeverityPreferencePage.java 2011-12-06
21:34:18 UTC (rev 37017)
@@ -164,4 +164,12 @@
super.applyData(data);
}
}
-}
\ No newline at end of file
+
+ /**
+ * Used by test.
+ * @return
+ */
+ public String getFilterText() {
+ return getConfigurationBlock().getFilterControl().getText();
+ }
+}