ダイアログ その 3

で、中身を作り込んでいくわけですが、分からん ^^;;;;;;

とりあえず、home という Composite オブジェクトを作成して、そこに GridLayout クラスを使って 3 列で並べていきました。

        Composite composite = (Composite)super.createDialogArea(parent);

        Composite home = new Composite(composite, SWT.NONE);
        GridData data = new GridData(GridData.FILL_BOTH);
        data.horizontalSpan = 1;
        home.setLayoutData(data);

        home.setLayout(new GridLayout(3, true));
        
        Label jarFilenameLabel = new Label(home, SWT.LEFT);
        jarFilenameLabel.setText("JAR Filename:");
        jarFilenameText = new Text(home, SWT.BORDER);
        Button jarFilenameBrowseButton = new Button(home, SWT.LEFT);
        jarFilenameBrowseButton.setText("Browse...");
        
        Label titleLabel = new Label(home, SWT.LEFT);
        titleLabel.setText("Application Title:");
        titleText = new Text(home, SWT.BORDER);
        Label dummyLabel = new Label(home, SWT.NONE);

        Label mainClassLabel = new Label(home, SWT.LEFT);
        mainClassLabel.setText("Main Class:");
        mainClassText = new Text(home, SWT.BORDER);
        Button mainClassSearchButton = new Button(home, SWT.LEFT);
        mainClassSearchButton.setText("Search...");

        Label iconFilenameLabel = new Label(home, SWT.LEFT);
        iconFilenameLabel.setText("Icon Filename:");
        iconFilenameText = new Text(home, SWT.BORDER);
        Button iconFilenameBrowseButton = new Button(home, SWT.LEFT);
        iconFilenameBrowseButton.setText("Browse...");

        Label configFilenameLabel = new Label(home, SWT.LEFT);
        configFilenameLabel.setText("Config Filename:");
        configFilenameText = new Text(home, SWT.BORDER);
        Button configFilenameBrowseButton = new Button(home, SWT.LEFT);
        configFilenameBrowseButton.setText("Browse...");

さて、これで実行すると...

Dialog

なぜ、ダイアログいっぱいにひょうじされないんだぁぁぁぁぁぁ !!

GridData.minimumWidth を大きめに設定してみたのですが、何も変化なし。かといって、home を作らずに composite に直接ウィジェットを貼るわけにもいかないし... どうすればいいんでしょ?

composite には home 以外に Label オブジェクトが貼ってあるので、これの GridData オブジェクトを調べてみると

GridData {horizontalAlignment=SWT.FILL grabExcessHorizontalSpace=true verticalAlignment=GridData.CENTER}

そうかというわけで、同じ設定にしてみましたが、変化なし。うーん、手詰まり。どうすればいいんだろう。

まぁ、いいや、レイアウトなんて。あとにしよ、あと。