반응형

Dialog

    JFACE new Window의 다이얼로그 생성

    독립창으로 다이얼로그 생성새로운 독립창에 dialog를 생성하고 싶은 경우에는 다음과 같이 설정한다. 예를들어 a 라는 다이얼로그를 생성할 때, parent Shell을 null 값을 전달하며 새로운 창에 다이얼로그가 생성된다. Dialog a = new Dialog(null);a.open(); 생성된 다이얼로그는 독립된 task bar에 아이콘을 가지게 된다. 다른 창보다 강제로 상위에 표시a.forceActive();a.forceFocus(); blocking 해제 방법a.setBlockOnOpen(false);

    rcp dialog 화면 가운데 출력

    public Point getCenterPoint() { Shell parentShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); Rectangle shellBounds = parentShell.getBounds(); return new Point(shellBounds.x + shellBounds.width / 2, (shellBounds.y + shellBounds.height) / 2); }Then simply override the getInitialLocation method of Dialog; @Override protected Point getInitialLocation(Point initialSize) { Poin..

반응형