public boolean setDialog(boolean isExport) {
shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
+ int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - this.width)/2;
+ int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - this.height)/2;
+ shell.setLocation(dialogLocationX, dialogLocationY);
shell.setSize(width, height);
shell.setLayout(new FormLayout());
shell.setText(titleText);
import org.tizen.dynamicanalyzer.widgets.progress.Progress;
public class ProgressDialog {
+ private final int WIDTH = 300;
+ private final int HEIGHT = 110;
+
public static final int PROGRESS_STYLE_DEFAULT = 0;// default
public static final int PROGRESS_STYLE_CANCEL = 1;
public static final int PROGRESS_STYLE_WARNING = 2;
public void createProgress(boolean isIndeterminate) {
shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.NO_TRIM );
- shell.setSize(300, 110);
+ int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - WIDTH)/2;
+ int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - HEIGHT)/2;
+ shell.setLocation(dialogLocationX, dialogLocationY);
+ shell.setSize(WIDTH, HEIGHT);
progressComp = new Composite(shell, SWT.NONE);
progressComp.setLayout(new FormLayout());
}
shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.NO_TRIM );
+ int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - 350)/2;
+ int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - sizeInfo.get(0))/2;
+ shell.setLocation(dialogLocationX, dialogLocationY);
shell.setSize(350, sizeInfo.get(0));
msgComp = new Composite(shell, SWT.NONE);