private void createUI_60_PaintingMethod(final Composite parent) {
final Display display = parent.getDisplay();
/*
* checkbox: paint tour method
*/
final Group groupMethod = new Group(parent, SWT.NONE);
GridDataFactory.fillDefaults().applyTo(groupMethod);
groupMethod.setText(Messages.Pref_MapLayout_Label_TourPaintMethod);
// groupMethod.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
{
_editorTourPaintMethod = new RadioGroupFieldEditor(
ITourbookPreferences.MAP_LAYOUT_TOUR_PAINT_METHOD,
UI.EMPTY_STRING,
2,
new String[][] {
{ Messages.Pref_MapLayout_Label_TourPaintMethod_Simple, TOUR_PAINT_METHOD_SIMPLE },
{ Messages.Pref_MapLayout_Label_TourPaintMethod_Complex, TOUR_PAINT_METHOD_COMPLEX } },
groupMethod);
addField(_editorTourPaintMethod);
_pageBookPaintMethod = new PageBook(groupMethod, SWT.NONE);
GridDataFactory.fillDefaults()//
.grab(true, false)
.span(2, 1)
.hint(350, SWT.DEFAULT)
.indent(16, 0)
.applyTo(_pageBookPaintMethod);
// use a bulleted list to display this info
final StyleRange style = new StyleRange();
style.metrics = new GlyphMetrics(0, 0, 10);
final Bullet bullet = new Bullet(style);
/*
* simple painting method
*/
String infoText = Messages.Pref_MapLayout_Label_TourPaintMethod_Simple_Tooltip;
int lineCount = Util.countCharacter(infoText, '\n');
_pageSimple = new StyledText(_pageBookPaintMethod, SWT.READ_ONLY | SWT.WRAP | SWT.MULTI);
GridDataFactory.fillDefaults().grab(true, false).applyTo(_pageSimple);
_pageSimple.setText(infoText);
_pageSimple.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
_pageSimple.setLineBullet(0, lineCount + 1, bullet);
_pageSimple.setLineWrapIndent(0, lineCount + 1, 10);
/*
* complex painting method
*/
infoText = Messages.Pref_MapLayout_Label_TourPaintMethod_Complex_Tooltip;
lineCount = Util.countCharacter(infoText, '\n');
_pageComplex = new StyledText(_pageBookPaintMethod, SWT.READ_ONLY | SWT.WRAP | SWT.MULTI);
GridDataFactory.fillDefaults().grab(true, false).applyTo(_pageComplex);
_pageComplex.setText(infoText);
_pageComplex.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
_pageComplex.setLineBullet(0, lineCount + 1, bullet);
_pageComplex.setLineWrapIndent(0, lineCount + 1, 10);
}
// set group margin after the fields are created
GridLayoutFactory.swtDefaults().margins(0, 5).numColumns(2).applyTo(groupMethod);
}
PrefPageMap2Appearance.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:mytourbook
作者:
评论列表
文章目录