[uruma-dev:103] DateTimeコントロールの組み込みに関して

yazaki [E-MAIL ADDRESS DELETED]
2008年 3月 17日 (月) 11:39:47 JST


小森さん
はじめまして。矢崎と申します。

社内で使用する小さなシステムに、試験的にurumaを使用させていただいております。 


必要最低限のコードで、意図したGUIプログラムを作成できるのはとてもすばらしいと思います。

DateTimeコントロールの組み込みに成功しましたので、ソースコードをお送りします。 

//SWT自体最近はじめたばかりなので、不足な部分はは多々あるかもしれませんが。。。 

お役立ていただければ幸いです。

1)org.seasar.uruma.component.factory.UrumaTagHandlerRule#UrumaTagHandlerRule()
// l147あたりに次の行を追加
        addTagHandler("datetime",
                new GenericTagHandler(DateTimeComponent.class));

2)org.seasar.uruma.component.jface#DateTimeComponent.java
添付します。

3)org.seasar.uruma.renderer.RendererFactory#static
// l136あたりに次の行を追加
        addRenderer(DateTimeComponent.class, new DateTimeRenderer());

4)org.seasar.uruma.renderer.impl.DateTimeRenderer.java
添付します。

5)org.seasar.uruma.component.factory.uruma.xsd
//858行目あたりに次の行を追加
  <!-- datetime  -->
  <xs:element name="datetime" substitutionGroup="tns:control">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="tns:ControlClass">
          <xs:sequence>
            <xs:group ref="tns:controlElems" />
          </xs:sequence>
          <xs:attribute name="year" type="xs:int" />
          <xs:attribute name="month" type="xs:int" />
          <xs:attribute name="day" type="xs:int" />
          <xs:attribute name="hours" type="xs:int" />
          <xs:attribute name="minutes" type="xs:int" />
          <xs:attribute name="seconds" type="xs:int" />
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>



あと、暫定的に、XML構文エラーを出せるようにするため、次のコードを追加しました。 

// log4Jを使った形で反映いただけると助かります。
org.seasar.uruma.component.factory.ComponentTreeBuilder#build(final String 
path)
// l62あたりの次の行を追加
        } catch (Exception e) {
            e.printStackTrace();
            return null;

ウルスタの完成楽しみにしています。
これからもがんばってください。

-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: DateTimeComponent.java
型:         application/octet-stream
サイズ:     2613 バイト
説明:       無し
URL:        http://ml.seasar.org/archives/uruma-dev/attachments/20080317/1f3cd69a/attachment.obj 
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: DateTimeRenderer.java
型:         application/octet-stream
サイズ:     1802 バイト
説明:       無し
URL:        http://ml.seasar.org/archives/uruma-dev/attachments/20080317/1f3cd69a/attachment-0001.obj 


uruma-dev メーリングリストの案内