Css GWT中suggestboxPopup的边界问题
我在GWT中使用SuggestBox。我还继承SuggestBox.GWT.xml中的标准主题作为Css GWT中suggestboxPopup的边界问题,css,gwt,suggestbox,Css,Gwt,Suggestbox,我在GWT中使用SuggestBox。我还继承SuggestBox.GWT.xml中的标准主题作为 <inherits name='com.google.gwt.user.theme.standard.Standard'/> 那么我该如何解决这个问题呢?请帮助我。 感谢Rahul用于弹出窗口的类是DefaultSuggestionDisplayforDefaultSuggestBox。它使用一个装饰的PopupPanel,正如您在第392行附近的SuggestBox.java中
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
那么我该如何解决这个问题呢?请帮助我。
感谢Rahul用于弹出窗口的类是DefaultSuggestionDisplayforDefaultSuggestBox。它使用一个装饰的PopupPanel,正如您在第392行附近的SuggestBox.java中看到的那样 为了避免“重”边框,您必须创建/覆盖使用非修饰popupPanel的SuggestionDisplay,并将其传递给SuggestionBox构造函数
public SuggestBox(SuggestOracle oracle, TextBoxBase box,SuggestionDisplay suggestDisplay);
比如说,“border”是不够的,因为decoratedpoppanel使用多个单元格来设置边框,正如您在CSS中看到的那样。因此,您可能可以直接更新CSS,但它将应用于所有项目,因为SuggestBox似乎不会直接处理资源包。用于弹出窗口的类是DefaultSuggestDisplay for default SuggestBox。它使用一个装饰的PopupPanel,正如您在第392行附近的SuggestBox.java中看到的那样 为了避免“重”边框,您必须创建/覆盖使用非修饰popupPanel的SuggestionDisplay,并将其传递给SuggestionBox构造函数
public SuggestBox(SuggestOracle oracle, TextBoxBase box,SuggestionDisplay suggestDisplay);
比如说,“border”是不够的,因为decoratedpoppanel使用多个单元格来设置边框,正如您在CSS中看到的那样。因此,您可能可以直接更新CSS,但它将应用于所有项目,因为SuggestBox似乎不会直接处理资源包。创建customSuggestionDisplay类
public static class CustomSuggestionDisplay extends SuggestBox.DefaultSuggestionDisplay {
private PopupPanel suggestionPopupRef;
public CustomSuggestionDisplay() {
suggestionPopupRef = getPopupPanel();
}
public void removeBorder() {
((Element)suggestionPopupRef.getElement().getChild(0)).getStyle().setBackgroundColor("white");
NodeList<com.google.gwt.dom.client.Element> tdList = suggestionPopupRef.getElement().getElementsByTagName("td");
for (int tdIndex = 0; tdIndex < tdList.getLength(); ++tdIndex) {
Element tdElement = (Element) tdList.getItem(tdIndex);
if (tdElement.getClassName().startsWith("suggestPopup"))
tdElement.removeClassName(tdElement.getClassName());
}
}
}
显示建议时调用removeBorder
if (m_field.isSuggestionListShowing())
suggestionDisplay.removeBorder();
创建customSuggestionDisplay类
public static class CustomSuggestionDisplay extends SuggestBox.DefaultSuggestionDisplay {
private PopupPanel suggestionPopupRef;
public CustomSuggestionDisplay() {
suggestionPopupRef = getPopupPanel();
}
public void removeBorder() {
((Element)suggestionPopupRef.getElement().getChild(0)).getStyle().setBackgroundColor("white");
NodeList<com.google.gwt.dom.client.Element> tdList = suggestionPopupRef.getElement().getElementsByTagName("td");
for (int tdIndex = 0; tdIndex < tdList.getLength(); ++tdIndex) {
Element tdElement = (Element) tdList.getItem(tdIndex);
if (tdElement.getClassName().startsWith("suggestPopup"))
tdElement.removeClassName(tdElement.getClassName());
}
}
}
显示建议时调用removeBorder
if (m_field.isSuggestionListShowing())
suggestionDisplay.removeBorder();
你能帮我写下你是如何改变css的吗?你能帮我写下你是如何改变css的吗?