new Label(s, SWT.NONE);
final Text t = new Text(s, SWT.BORDER | SWT.WRAP | SWT.MULTI);
t.setText("Sample Text");
t.setFont(SWTResourceManager.getFont("Courier New", 8, SWT.NORMAL));
t.setForeground(new Color(d, this.foreGround));
t.setFont(new Font(d, this.fontData));
t.setForeground(new Color(d, this.foreGround));
GridData gd_t = new GridData(SWT.FILL, SWT.FILL, false, false, 10, 1);
gd_t.heightHint = 74;
t.setLayoutData(gd_t);
new Label(s, SWT.NONE);
final Button btnChange = new Button(s, SWT.PUSH | SWT.BORDER);
btnChange.setText("Change Font");
btnChange.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
FontDialog fd = new FontDialog(s, SWT.NONE);
fd.setText("Select Font");
fd.setRGB(t.getForeground().getRGB());
fd.setFontList(t.getFont().getFontData());
FontData newFont = fd.open();
if(newFont==null)
return;
t.setFont(new Font(d, newFont));
t.setForeground(new Color(d, fd.getRGB()));
}
});
Button btnSave = new Button(s, SWT.NONE);
btnSave.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
saveFontData(t.getFont().getFontData()[0],t.getForeground().getRGB());
s.dispose();
}
});
btnSave.setText("Save");
Button btnReset = new Button(s, SWT.NONE);
btnReset.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
t.setFont(new Font(d, fontData));
t.setForeground(new Color(d, aktForeGround));
}
});
btnReset.setText("Reset");
Button btnCancel = new Button(s, SWT.NONE);