public void createPartControl(Composite parent) {
parent.setLayout(new FillLayout());
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpContextIDs.HELP_PLUGIN_ID + "." + IHelpContextIDs.WELCOME_SCREEN);
this.boldFont = SWTResourceManager.getBoldFont(Display.getCurrent().getSystemFont());
this.normalFont = Display.getCurrent().getSystemFont();
scrolledComposite = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
scrolledComposite.setLayout(new FillLayout());
scrolledComposite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
canvas = new Canvas(scrolledComposite, SWT.NONE);
scrolledComposite.setContent(canvas);
canvas.setLayout(new FormLayout());
canvas.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
{
Image bg_image = ResourceManager.getPluginImage(Activator.getDefault().getBundle().getSymbolicName(), "icons/intro/header_bg.png");
topArea = new Canvas(canvas, SWT.NO_REDRAW_RESIZE);
{
FormData formData = new FormData();
formData.height = 25;
formData.right = new FormAttachment(100);
formData.left = new FormAttachment(0);
topArea.setLayoutData(formData);
}
topArea.setBackgroundImage(bg_image);
GridLayout gridLayout = new GridLayout(2, false);
gridLayout.marginHeight = 0;
gridLayout.verticalSpacing = 0;
topArea.setLayout(gridLayout);
{
Canvas title = new Canvas(topArea, SWT.TRANSPARENT);
title.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1));
title.setBackgroundImage(bg_image);
title.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
e.gc.drawImage(ResourceManager.getPluginImage(Activator.getDefault().getBundle().getSymbolicName(),
"icons/intro/header_title.png"), 0, 0);
}
});
}
{
Canvas title = new Canvas(topArea, SWT.NO_REDRAW_RESIZE);
title.setBackgroundImage(ResourceManager.getPluginImage(Activator.getDefault().getBundle().getSymbolicName(),
"icons/intro/bg_topline.png"));
title.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
e.gc.drawImage(ResourceManager.getPluginImage(Activator.getDefault().getBundle().getSymbolicName(), "icons/intro/close.png"),
0, 0);
}
});
title.setBounds(0, 0, 19, 19);
title.setCursor(new Cursor(Display.getCurrent(), SWT.CURSOR_HAND));
{
GridData gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gridData.heightHint = 19;
gridData.widthHint = 19;
title.setLayoutData(gridData);
}
title.addMouseListener(new MouseAdapter() {
@Override
public void mouseUp(MouseEvent e) {
new CloseWelcomeScreenAction().run();
}
});
}
}
...
}