org.eclipse.swt.widgets.Dialog Java Examples

The following examples show how to use org.eclipse.swt.widgets.Dialog. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LayoutLogic.java    From logbook with MIT License 5 votes vote down vote up
/**
 * Shellのウインドウ位置とサイズを読み込み適用します
 * 
 * @param clazz ウインドウクラス
 * @param shell Shell
 */
public static void applyWindowLocation(Class<? extends Dialog> clazz, Shell shell) {
    Map<String, WindowLocationBean> map = AppConfig.get().getWindowLocationMap();
    WindowLocationBean location;
    synchronized (map) {
        location = map.get(clazz.getName());
    }
    if (location != null) {
        if ((location.getWidth() > 0) && (location.getHeight() > 0)) {
            shell.setLocation(location.getX(), location.getY());
            shell.setSize(location.getWidth(), location.getHeight());
        }
    }
}
 
Example #2
Source File: LayoutLogic.java    From logbook with MIT License 5 votes vote down vote up
/**
 * Shellのウインドウ位置とサイズを保存します
 * 
 * @param clazz ウインドウクラス
 * @param shell Shell
 */
public static void saveWindowLocation(Class<? extends Dialog> clazz, Shell shell) {
    Map<String, WindowLocationBean> map = AppConfig.get().getWindowLocationMap();
    Point location = shell.getLocation();
    Point size = shell.getSize();
    WindowLocationBean wlocation = new WindowLocationBean();
    wlocation.setX(location.x);
    wlocation.setY(location.y);
    wlocation.setWidth(size.x);
    wlocation.setHeight(size.y);
    synchronized (map) {
        map.put(clazz.getName(), wlocation);
    }
}
 
Example #3
Source File: SaveWindowLocationAdapter.java    From logbook with MIT License 2 votes vote down vote up
/**
 * コンストラクター
 *
 * @param dialogClass ウインドウ
 */
public SaveWindowLocationAdapter(Class<? extends Dialog> dialogClass) {
    this.dialogClass = dialogClass;
}