HDのマウント
mount -t ext2 /dev/hdd1 /home/share/smb
ディレクトリのマウント
mount -o /src /tgt
マウント解除
umount /src
HDのマウント
mount -t ext2 /dev/hdd1 /home/share/smb
ディレクトリのマウント
mount -o /src /tgt
マウント解除
umount /src
更新チェック
yum check-update
インストール済みチェック
yum list installed
みちる
中身のWidgetのサイズ設定
1 |
topSash.setWeights(new int[]{90,10}); |
パーセントで指定
Eclipse本家から
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// this button is always 400 x 400. Scrollbars appear if the window is resized to be // too small to show part of the button ScrolledComposite c1 = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL); Button b1 = new Button(c1, SWT.PUSH); b1.setText("fixed size button"); b1.setSize(400, 400); c1.setContent(b1); // this button has a minimum size of 400 x 400. If the window is resized to be big // enough to show more than 400 x 400, the button will grow in size. If the window // is made too small to show 400 x 400, scrollbars will appear. ScrolledComposite c2 = new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); Button b2 = new Button(c2, SWT.PUSH); b2.setText("expanding button"); c2.setContent(b2); c2.setExpandHorizontal(true); c2.setExpandVertical(true); c2.setMinWidth(400); c2.setMinHeight(400); |
例1
Minとか指定せず中身のサイズのみ指定すると中身のサイズ以下の時にスクロールバー
中身はそれ以上に広がらない
例2
Minを指定するとそれ以下の時スクロールバーがでる
1 2 |
c2.setExpandHorizontal(true); c2.setExpandVertical(true); |
を指定すると指定した方向のが幅いっぱいまで広がる
縦横両方Expandに設定するときは中身のサイズを指定しなくてもいいけどExpand指定しないときは中身のサイズを指定してやらないと表示されない(サイズが特定できないためっぽい)
表示位置設定
1 |
topSash.setOrigin(0,0); |
変更済みだけどSWTサンプル集から
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
public class ViewerMain { public static void main(String[] args) { ViewerMain main = new ViewerMain(); } private ViewerMain() { display = new Display(); shell = new Shell(display); shell.setText("タイトル"); shell.setLayout(new FillLayout()); shell.setSize(800,600); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } } |
Shellスタイルは
BORDER 枠が立体的になる
CLOSE 閉じるボタン。無いと困る
MIN 最小化ボタン
MAX 最大化ボタン
NO_TRIM 何も無し
RESIZE リサイズを可能にする
TITLE タイトルバー
以下たぶん子ウインドウの動作の違い
親に指定すると枠が黒い線、立体的ではない
APPLICATION_MODAL
MODELESS
PRIMARY_MODAL
SYSTEM_MODAL
基本スタイルに
SHELL_TRIM CLOSE | TITLE | MIN | MAX | RESIZE
DIALOG_TRIM TITLE | CLOSE | BORDER
がある。スタイルを指定しなければたぶんSHELL_TRIM が設定。