@Override
public void createPartControl(Composite parent) {
parent.setLayout(new FormLayout());
User user = new User("ToaoT");
try {
user = TwitterFactory.getTwitter().getUser("ToaoT");
} catch (Exception e) {
e.printStackTrace();
System.out.println("Excpetion calling the Twitter API.");
}
// Screen name
text_1 = new Text(parent, SWT.BORDER | SWT.SINGLE);
FormData fd = new FormData();
fd.top = new FormAttachment(0, 49);
fd.right = new FormAttachment(100, -123);
text_1.setLayoutData(fd);
String temp = user.getScreenName();
text_1.setText((temp == null) ? "{screen name}" : temp);
// Location
text_2 = new Text(parent, SWT.BORDER | SWT.SINGLE);
fd.bottom = new FormAttachment(text_2, -6);
fd.left = new FormAttachment(text_2, 0, SWT.LEFT);
fd = new FormData();
fd.top = new FormAttachment(0, 74);
fd.left = new FormAttachment(0, 10);
fd.right = new FormAttachment(100, -123);
text_2.setLayoutData(fd);
temp = user.getLocation();
text_2.setText((temp == null) ? "{location}" : temp);
// Web site
text_3 = new Text(parent, SWT.BORDER | SWT.SINGLE);
fd.bottom = new FormAttachment(text_3, -6);
fd = new FormData();
fd.top = new FormAttachment(0, 99);
fd.left = new FormAttachment(0, 10);
fd.right = new FormAttachment(100, -123);
text_3.setLayoutData(fd);
URI temp2 = user.getWebsite();
text_3.setText((temp2 == null) ? "{web site}" : temp2.toASCIIString());
// Description
text_4 = new Text(parent, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
fd.bottom = new FormAttachment(text_4, -6);
fd = new FormData();
fd.height = 50;
fd.top = new FormAttachment(0, 124);
fd.left = new FormAttachment(0, 10);
fd.right = new FormAttachment(100, -10);
fd.bottom = new FormAttachment(100, -281);
text_4.setLayoutData(fd);
temp = user.getDescription();
text_4.setText((temp == null) ? "{description}" : temp);
Canvas canvas = new Canvas(parent, SWT.BORDER | SWT.NO_REDRAW_RESIZE);
FormData fd_canvas = new FormData();
fd_canvas.bottom = new FormAttachment(text_3, 0, SWT.BOTTOM);