Google Web ツールキット内で jquery プラグインを使用することは可能ですか?
日付/時刻ピッカー、検索可能なドロップダウンなど、さまざまな UI ウィジェットで使用できる優れたプラグインが多数あります。多くの場合、これらのプラグインには独自の CSS スタイルも付属しています。これらのプラグインを使用して、gwt アプリケーションでその値を取得できるようにしたいと考えています。
はい.. GWT プロジェクトで Javascript ライブラリを使用できます。その lib を html ファイルまたは GWT.xml にインポートするだけです。以下のようにmodule.xmlファイルで..
<module rename-to='TestingProject'>
<inherits name='com.google.gwt.user.User'/>
<entry-point class='test.Gwt.testingSample.client.TestingProjectEntry'/>
<inherits name="com.google.gwt.user.theme.standard.Standard" />
<source path='client'/>
<source path='shared'/>
<script src="/js/jquery-1.10.min.js"></script>
</module>
HTMLファイルでテストします..
<body>
<center>
<div id= "start"></div>
</center>
<script type="text/javascript">
$(document).ready(function(){
$("div#start").html("<font color = 'green' font-weight = 'bold' size = '12'>
Hello World !</font>");
});
</script>
<body>
お役に立ちますように…!
経験から、2 つの選択肢があります。
http://code.google.com/p/gwtquery/
http://code.google.com/p/gwtquery-plugins/
JSNI ドキュメント
http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJSNI.html
jquery関数はGwtQueryでほぼそのまま使用でき、gwtコンパイラーによってコードがコンパイルおよび最適化されることでパフォーマンスがさらに向上するため、GwtQueryを使用することをお勧めします。