0

我有界面如

public interface PopupPanelWithConfirmStyle extends ClientBundle {

  public static final PopupPanelWithConfirmStyle I = GWT.create(PopupPanelWithConfirmStyle.class);

  @Source("PopupPanelWithConfirmStyle.css")
  public Style css();

  public interface Style extends CssResource {

  @ClassName("popupPanelWithConfirmStyle")
  String popupPanelWithConfirmStyle();

  @ClassName("confirmButton")
  String confirmButton();
 }

}

我有标准的 PushButton,它有 gwt-PushButton-up,.gwt-PushButton-up-hovering,.gwt-PushButton-up-disabled,.gwt-PushButton-down,.gwt-PushButton-down-hovering,.gwt- PushButton-down-disabled 和其他样式

所以我设置了 PushButton 样式 - confirmButton 并编写了自己的 css

.popupPanelWithConfirmStyle {
background: none repeat scroll 0 0 white;
padding: 3px;
z-index: 100;
}

.confirmButton{
border-radius: 2px 2px 2px 2px;
margin: 0;
text-decoration: none;
padding: 3px 5px;
}

@external confirmButton-up, confirmButton-up-hovering, confirmButton-up-disabled, confirmButton-down, confirmButton-down-hovering, confirmButton-down-disabled 

.confirmButton-up {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #BBBBBB #BBBBBB #A0A0A0;
border-style: solid;
border-width: 1px;
cursor: pointer;
}

.confirmButton-up-hovering {
border: 1px solid #939393;
cursor: pointer;
}

.confirmButton-up-disabled {
border: 1px solid #BBBBBB;
cursor: default;
opacity: 0.5;
}

.confirmButton-down {
border: 1px inset #666666;
cursor: pointer;
outline: medium none;
padding: 4px 4px 2px 6px;
}

.confirmButton-down-hovering {
-moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #333333 #939393 #939393;
border-right: 1px solid #939393;
border-style: solid;
border-width: 1px;
cursor: pointer;
}

.confirmButton-down-disabled {
border: 1px outset #CCCCCC;
cursor: default;
opacity: 0.5;
}

当我运行 gwt - 我看到了 -

div tabindex="0" class="GGUR4G1EN GGUR4G1EN-up" role="button" aria-pressed="false"

我应该怎么办?.confirmButton-up 将在 GGUR4G1EN-up 中转换

对不起我的英语不好。

4

1 回答 1

1

目前这是不可能的:http ://code.google.com/p/google-web-toolkit/issues/detail?id=4746

如果您想利用依赖样式名称,您必须禁用对类名称的混淆(例如@external,在 CSS 中使用,不仅用于-up-hover等变体,还用于主要样式名称)。然而,这意味着 CSS 资源之间可能存在命名冲突。

于 2012-06-17T09:20:09.880 回答