忍者ブログ
[1]  [2]  [3
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

とりあえずいろいろ配置してみる

ボタン
<button id="addButton" text="ボタン" />

ラベル
<label text="ラベル"/>

テキスト
<text id="text"/>

コンボボックス
<combo>
  <item text="aaa"/>
  <item text="bbb"/>
</combo>

を記述して実行するとそれぞれが表示されるはず

Menu.xml

<?xml version="1.0" encoding="UTF-8"?>
<template xmlns="http://uruma.sandbox.seasar.org">
 <window title="メインメニュー" background="white" width="800" height="600" x="20" y="20">
  <gridLayout numColumns="1" >
   <gridData horizontalAlignment="FILL"/>
  </gridLayout>

  <composite>
   <rowLayout type="HORIZONTAL" spacing="5">
    <rowData height="24"/>
   </rowLayout>

   <button id="addButton" text="ボタン" />
   <label text="ラベル"/>
   <text id="text"/>
   <combo>
    <item text="aaa"/>
    <item text="bbb"/>
   </combo>
  </composite>
 </window>
</template>

そのほかのコンポーネントはここ

PR

<component>部分を

    <component class="org.seasar.framework.container.autoregister.ComponentAutoRegister">
  <property name="instanceDef">
   @org.seasar.framework.container.deployer.InstanceDefFactory@PROTOTYPE
  </property>
  <initMethod name="addReferenceClass">
      <arg>@gui.test.MainAction@class</arg>
  </initMethod>
        <initMethod name="addClassPattern">
            <arg>"gui.test"</arg>
            <arg>".*Action"</arg>
        </initMethod>
    </component>

のように書くと特定のフォルダのJavaをコンポーネントとして登録できるっぽい。

複数のフォルダを対称にする場合は複数書けばいいのかな・・・?

workbench.xmlがうまく表示できなかった(俺は何を間違えているやら・・・)ので新しくXMLを作成します。

src/main/resourseにgui.test.Menu.xml

src/main/javaにgui.test.MainAction

を作成

gui.test.Menu.xml

<?xml version="1.0" encoding="UTF-8"?>
<template xmlns="http://uruma.sandbox.seasar.org">
 <window title="メインメニュー" background="white" width="800" height="600" x="20" y="20">
  <gridLayout numColumns="1" >
   <gridData horizontalAlignment="FILL"/>
  </gridLayout>

  <composite>
   <fillLayout type="HORIZONTAL" spacing="5" />
   <button id="addButton" text="追加" />
  </composite>
 </window>
</template>

gui.test.MainAction

package gui.test;

import org.seasar.uruma.core.StandAloneUrumaStarter;

public class MainAction {
 public static void main(String[] args) {
  StandAloneUrumaStarter uruma = StandAloneUrumaStarter.getInstance();
  uruma.openWindow("gui/test/Menu.xml");
 }
}


でapp.diconというファイルをresourse直下に配置

app.dicon

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.3//EN"
 "http://www.seasar.org/dtd/components23.dtd">

<components>
</components>


これで Alt+Shift+X,J または実行 → Javaアプリケーションをすると追加っていうボタンが表示されるはず!

とりあえずEclipseまたはAmaterasUrumaをダウンロード(Eclipse3.2だと動かない模様・・・)

Urumaを解凍してEclipseまたはAmaterasのpluginsにjarファイルを配置

EclipseまたはAmaterasを起動して各種設定(ここはめんどいので他のサイトを見てください^^;)

で、パッケージエクスプローラーで右クリック → 新規 → プロジェクト → SVN → SVNからプロジェクトをチェックアウト

新規リポジトリ・ロケーションを生成を選んで次へ

Urlにhttps://www.seasar.org/svn/sandbox/uruma/を入力し次へ

フォルダの選択でtrunk → urumaを選択し、終了

同じくtrunk → org.seaser.uruma.example.blankというブランクプロジェクトを選択し、次へ、名前を指定して終了

終わったらプロジェクトurumaのlibにあるものを全てビルド・パスに追加

urumaプロジェクトで右クリック → プロパティ → プロジェクトタブを選択し、s2-tigerとseaser2を除去

最後にブランクプロジェクトで右クリック → プロパティ → Javaのビルド・パス → プロジェクトタブ → 追加 → urumaプロジェクトを指定する。(urumaプロジェクトをjarにしてビルド・パスも可だと思う)

とりあえずこれで環境はできたのかな?

×ついていたらクリーンしてみてください(=ω=)

作っていて疑問に思ったり、忘れそうなことをつらつらと・・・
<< 前のページ  | HOME | 
カレンダー
03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
ブログ内検索
忍者ブログ [PR]

Graphics by Lame Tea / designed by 26℃