0

カスタム拡張機能を作成しようとしていますTabLayoutPanel。コードは次のとおりです。

public class ExpandableTabLayoutPanel extends TabLayoutPanel {

    @UiConstructor
    public ExpandableTabLayoutPanel(double barHeight, Unit barUnit) {
        super(barHeight, barUnit);
        addExpandableBehaviour();
    }

    private addExpandableBehaviour(){
      //...
    }
}

ここでは、UIBinder から呼び出します。

<a:ExpandableTabLayoutPanel barHeight="20" barUnit="PX">
    <a:tab>
    <a:header>header</a:header>
        <a:AdvancedRichTextArea styleName="{style.area}" ui:field="area"/>
    </a:tab>
</a:ExpandableTabLayoutPanel>

(パッケージ/ワークスペースでタブとヘッダーが定義されていなくても、a:tab/a:headerの代わりにg:tab/を使用するようにエラーメッセージが表示されましたが、それはおそらく問題ではありません)g:headera:

@UiConstructorリストのように ExpandableTabLayoutPanel に注釈が存在する場合、奇妙なエラーが発生します。

[ERROR] [gwtreproduce] - <a:ExpandableTabLayoutPanel barHeight='20' barUnit='PX'> missing required attribute(s): arg1 barHeight Element <a:ExpandableTabLayoutPanel barHeight='20' barUnit='PX'> (:13)

を無効にする@UiConstructorと、さらに奇妙なエラーが発生します。

[ERROR] [gwtreproduce] - Errors in 'generated://E6338B946DFB2D28988DA492134093C7/reproduce/client/TestView_TestViewUiBinderImpl.java' :             [ERROR] [gwtreproduce] - Line 33: Type mismatch: cannot convert from TabLayoutPanel to ExpandableTabLayoutPanel 

TabLayoutPanel の拡張で何が間違っていますか?

副次的な質問:TabLayoutPanelコンストラクターに @UiConstructor の注釈が付けられておらず、UiBinder で使用できる可能性があるのはなぜですか (UiBinder はどのコンストラクターを呼び出すかをどのように認識していますか)。

4

1 に答える 1