本文整理汇总了Java中org.eclipse.swt.custom.StyledText.addSelectionListener方法的典型用法代码示例。如果您正苦于以下问题:Java StyledText.addSelectionListener方法的具体用法?Java StyledText.addSelectionListener怎么用?Java StyledText.addSelectionListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.StyledText
的用法示例。
在下文中一共展示了StyledText.addSelectionListener方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogArea
import org.eclipse.swt.custom.StyledText; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.getShell().addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
lineHighlight.dispose();
}
});
Composite verticalGroup = new Composite(container, SWT.NONE);
verticalGroup.setLayout(new GridLayout());
compositeType = new Composite(verticalGroup, SWT.NONE);
compositeType.setLayout(new RowLayout(SWT.HORIZONTAL));
bSuspendOnType = new Button(compositeType, SWT.CHECK);
bSuspendOnType.setText("Suspend on type");
bSuspendOnType.addSelectionListener(this);
cmbTypes = new Combo(compositeType, SWT.READ_ONLY);
cmbTypes.addSelectionListener(this);
cmbTypes.setEnabled(false);
compositeUnit = new Composite(verticalGroup, SWT.NONE);
compositeUnit.setLayout(new RowLayout(SWT.HORIZONTAL));
bSuspendOnUnit = new Button(compositeUnit, SWT.CHECK);
bSuspendOnUnit.setText("Suspend on unit");
bSuspendOnUnit.setSelection(true);
bSuspendOnUnit.addSelectionListener(this);
cmbClass = new Combo(compositeUnit, SWT.READ_ONLY);
cmbClass.addSelectionListener(this);
cmbMethod = new Combo(compositeUnit, SWT.READ_ONLY);
cmbMethod.addSelectionListener(this);
Label spacer = new Label(verticalGroup, SWT.NONE);
spacer.setText("");
Label label = new Label(verticalGroup, SWT.NONE);
label.setText("Selected the unit to suspend on by clicking on a line below:");
Composite textContainer = new Composite(verticalGroup, SWT.NONE);
textContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1,1));
textContainer.setLayout(new GridLayout());
unitSelectionArea = new StyledText(textContainer, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
unitSelectionArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1,1));
unitSelectionArea.setLayoutData(new GridData(750, 400));
unitSelectionArea.setEditable(false);
unitSelectionArea.addCaretListener(this);
unitSelectionArea.addSelectionListener(this);
fillCombos();
cmbClass.select(0);
cmbMethod.select(0);
cmbTypes.select(0);
return container;
}