import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
public class AboutDialog {
private static Shell dialog = null;
private static String textContents = ""; //$NON-NLS-1$
- private static int width = 436; //149 + 287
- private static int height = 290; // 180 + 110
+ private static int WIDTH = 436; //149 + 287
+ private static int HEIGHT = 290; // 180 + 110
static {
About.initAboutContents();
textContents = Messages.getString("AboutDialog.2") + About.getInstance().getAboutVersion() //$NON-NLS-1$
dialog = new Shell(MainDialog.getShell(),
SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
dialog.setText(Messages.getString("AboutDialog.4")); //$NON-NLS-1$
- dialog.setSize(width, height);
+ dialog.setSize(WIDTH, HEIGHT);
dialog.setLayout(getGridLayout(1, false));
Composite upperComposite = new Composite(dialog, SWT.NONE);
upperComposite.setLayout(getGridLayout(2, false));
- upperComposite.setSize(width, 181);
+ upperComposite.setSize(WIDTH, 181);
upperComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
if (!(EmulatorManager.isMac())) {
private static void makeTextContents(Composite upperComposite) {
Composite textComposite = new Composite(upperComposite, SWT.NONE);
- GridLayout layout = getGridLayout(1, true);
- layout.marginLeft = 5;
- layout.marginRight = 10;
- textComposite.setLayout(layout);
- textComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ textComposite.setLayout(new FormLayout());
+ textComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
textComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ FormData data = null;
+ int spacing = 10;
// basic info - version , build time
Label contents = new Label(textComposite, SWT.NONE);
- contents.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ data = new FormData();
+ data.top = new FormAttachment(0, 5);
+ data.left = new FormAttachment(0, spacing);
+ contents.setLayoutData(data);
contents.setText(textContents);
contents.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
// workspace path
- Link workspace = new Link(textComposite, SWT.NONE);
- workspace.setLayoutData(new GridData(280, SWT.DEFAULT));
+ Link workspace = new Link(textComposite, SWT.WRAP);
+ data = new FormData();
+ data.top = new FormAttachment(contents, spacing);
+ data.left = new FormAttachment(0, spacing);
+ data.width = 280;
+ workspace.setLayoutData(data);
workspace.setText(Messages.getString("AboutDialog.5") + //$NON-NLS-1$
"<a>" + FilePathResources.getTizenVmsPath() + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$
workspace.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
// link to tizen developer site
Link visit = new Link(textComposite, SWT.NONE);
- visit.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, false));
- visit.setText(StringResources.NEW_LINE +
- Messages.getString("AboutDialog.8")
- + StringResources.NEW_LINE);
+ data = new FormData();
+ data.top = new FormAttachment(workspace, spacing);
+ data.left = new FormAttachment(0, spacing);
+ visit.setLayoutData(data);
+ visit.setText(Messages.getString("AboutDialog.8"));
visit.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
visit.addSelectionListener(new SelectionListener(){
@Override
list = list + p.getPlatformName() + ": " + p.getPackageVersion();
}
plugin.setText(list);
- plugin.setLayoutData(new GridData(270, 38));
+ data = new FormData();
+ data.top = new FormAttachment(visit, spacing);
+ data.left = new FormAttachment(0, spacing);
+ data.width = 240;
+ data.height = 40;
+ plugin.setLayoutData(data);
}
private static GridLayout getGridLayout(int numColumns, boolean makeColumnEqualWidth) {