Button pick_color = new Button(tab_ax_container, SWT.NONE);
pick_color.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ColorDialog dlg = new ColorDialog(HTMLPropertiesPage.this.getShell());
dlg.setRGB(ax_bcolor.getRGB());
dlg.setText("Pick a Color");
RGB rgb = dlg.open();
if (rgb != null) {
ax_bcolor.dispose();
ax_bcolor = new Color(HTMLPropertiesPage.this.getShell().getDisplay(), rgb);
ax_background.setBackground(ax_bcolor);
}
}
});
pick_color.setText("Pick a color");
Label lab_enginP = new Label(tab_ax_container, SWT.NONE);
lab_enginP.setLayoutData(gd11v10h20);
lab_enginP.setText("Engine params");
ax_engineP = new Text(tab_ax_container, SWT.BORDER);
ax_engineP.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
Label lab_userP = new Label(tab_ax_container, SWT.NONE);
lab_userP.setLayoutData(gd11v10h20);
lab_userP.setText("User params");
ax_userP = new Text(tab_ax_container, SWT.BORDER);
ax_userP.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
//*********** HTML SECTION ***********
TabItem tbtmHtml = new TabItem(tabFolder, SWT.NONE);
tbtmHtml.setText("HTML");
Composite tab_html_container = new Composite(tabFolder, SWT.NONE);
tbtmHtml.setControl(tab_html_container);
tab_html_container.setLayout(lay);
Label hl_descr = new Label(tab_html_container, SWT.NONE);
hl_descr.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
hl_descr.setText("Specify the parameters for your HTML page");
hl_descr.setLocation(0, 0);
Label lab_margin = new Label(tab_html_container, SWT.NONE);
lab_margin.setLayoutData(gd11v10h20);
lab_margin.setText("Margin");
hl_margin = new Text(tab_html_container, SWT.BORDER);
hl_margin.setLayoutData(gd11v10);
hl_margin_abs = new Button(tab_html_container, SWT.CHECK);
hl_margin_abs.setLayoutData(gd11v10);
hl_margin_abs.setText("absolute");
Label lab_padding = new Label(tab_html_container, SWT.NONE);
lab_padding.setLayoutData(gd11v10h20);
lab_padding.setText("Padding");
lab_padding.setLocation(0, 0);
hl_padding = new Text(tab_html_container, SWT.BORDER);
hl_padding .setLayoutData(gd11v10);
hl_padding_abs = new Button(tab_html_container, SWT.CHECK);
hl_padding_abs.setLayoutData(gd11v10);
hl_padding_abs.setText("absolute");
Label lab_scroll = new Label(tab_html_container, SWT.NONE);
lab_scroll.setLayoutData(gd11v10h20);
lab_scroll.setText("Enable scroll");
hl_scroll = new Button(tab_html_container, SWT.CHECK);
hl_scroll.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
Label lab = new Label(tab_html_container, SWT.NONE);
lab.setLayoutData(gd11v10h20);
lab.setText("Background");
hl_background = new Label(tab_html_container, SWT.BORDER);
hl_background.setBackground(this.hl_bcolor);
hl_background.setText(" ");
Button btnPickAColor = new Button(tab_html_container, SWT.NONE);
btnPickAColor.setText("Pick a color");
btnPickAColor.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ColorDialog dlg = new ColorDialog(HTMLPropertiesPage.this.getShell());
dlg.setRGB(hl_bcolor.getRGB());
dlg.setText("Pick a Color");
RGB rgb = dlg.open();
if (rgb != null) {
hl_bcolor.dispose();
hl_bcolor = new Color(HTMLPropertiesPage.this.getShell().getDisplay(), rgb);
hl_background.setBackground(hl_bcolor);
}