本文整理汇总了Java中org.eclipse.swt.custom.StyledTextContent类的典型用法代码示例。如果您正苦于以下问题:Java StyledTextContent类的具体用法?Java StyledTextContent怎么用?Java StyledTextContent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StyledTextContent类属于org.eclipse.swt.custom包,在下文中一共展示了StyledTextContent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newStyledText
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
/**
* Creates a StyledText instance with a given content, and an SwtWindow
* which will be installed as
* VerifyKeylistener, FocusListener, KeyListener and Mouselistener
*/
public static StyledText newStyledText(final Composite parent,
final int style,
final StyledTextContent styledTextContent,
final SwtWindow swtWindow,
final int firstVisibleLine)
{
if (Thread.currentThread() != getDisplay().getThread())
{
Resultable res = new Resultable() {public void run() {result = newStyledText(parent, style, styledTextContent, swtWindow, firstVisibleLine);}};
getDisplay().syncExec(res);
return (StyledText) res.result;
}
else {
StyledText styledText = new StyledText(parent, style);
styledText.setContent(styledTextContent);
styledText.setTopIndex(firstVisibleLine);
styledText.addVerifyKeyListener(swtWindow);
styledText.addFocusListener(swtWindow);
styledText.addKeyListener(swtWindow);
styledText.addMouseListener(swtWindow);
return styledText;
}
}
示例2: SwtWindowWidget
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public SwtWindowWidget(Composite parent,
StyledTextContent styledTextContent,
int firstVisibleLine)
{
super(parent, 0);
setBackground(new Color(getDisplay(), 0, 0, 0));
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.horizontalSpacing = layout.verticalSpacing = 2;
layout.marginWidth = layout.marginHeight = 2;
setLayout(layout);
styledText = new StyledText(this, SWT.H_SCROLL | SWT.V_SCROLL);
styledText.setContent(styledTextContent);
styledText.setTopIndex(firstVisibleLine);
styledText.setLayoutData(new GridData(GridData.FILL_BOTH));
modeline = new StyledText(this, SWT.SINGLE | SWT.READ_ONLY);
modeline.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
示例3: showTexts
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
/**
* Shows the texts in the GUI from the current cursor position.
*/
public void showTexts(){
for(int i = 0; i < 7; i++){
StyledTextContent field = null;
switch(i){
case CODE: field = gui.getCodeText(); break;
case HEAP: field = gui.getHeapText(); break;
case TRAIL: field = gui.getTrailText(); break;
case RUNTIMEVARS: field = gui.getRuntimeVariablesText(); break;
case TRACE: field = gui.getTraceText(); break;
case STACK: field = gui.getStackText(); break;
case REGISTERS: field = gui.getRegistersText(); break;
}
field.setText(data[i].get(cursor));
}
}
示例4: getSetContentMethod
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
private static Method getSetContentMethod(Object styledTextRenderer) throws NoSuchMethodException {
// if (SET_CONTENT_METHOD == null) {
Method SET_CONTENT_METHOD = styledTextRenderer.getClass().getDeclaredMethod("setContent",
new Class[] { StyledTextContent.class });
SET_CONTENT_METHOD.setAccessible(true);
// }
return SET_CONTENT_METHOD;
}
示例5: setContent
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public static void setContent(final StyledText styledText, final StyledTextContent bufferContent)
{
if (Thread.currentThread() != getDisplay().getThread())
{
Runnable run = new Resultable() {public void run() {setContent (styledText, bufferContent);}};
getDisplay().syncExec(run);
}
else
{
styledText.setContent(bufferContent);
}
}
示例6: getStyledTextContentChangedAndStoreNew
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
private boolean getStyledTextContentChangedAndStoreNew() {
StyledTextContent currentContent = this.styledText.getContent();
StyledTextContent oldContent = this.content;
if (currentContent != oldContent) {
//Important: the content may change during runtime, so, we have to stop listening the old one and
//start listening the new one.
if (oldContent != null) {
oldContent.removeTextChangeListener(this);
}
this.content = currentContent;
currentContent.addTextChangeListener(this);
return true;
}
return false;
}
示例7: getBufferContent
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public StyledTextContent getBufferContent()
{
return bufferContent;
}
示例8: setTextContent
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public void setTextContent(StyledTextContent textContent)
{
this.textContent = textContent;
}
示例9: getTextContent
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public StyledTextContent getTextContent()
{
return textContent;
}
示例10: getCodeText
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public StyledTextContent getCodeText() {
return styledText_5.getContent();
}
示例11: getStackText
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public StyledTextContent getStackText() {
return styledText_3.getContent();
}
示例12: getTraceText
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public StyledTextContent getTraceText() {
return styledText_6.getContent();
}
示例13: getTrailText
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public StyledTextContent getTrailText() {
return styledText_4.getContent();
}
示例14: getRuntimeVariablesText
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public StyledTextContent getRuntimeVariablesText() {
return styledText.getContent();
}
示例15: getRegistersText
import org.eclipse.swt.custom.StyledTextContent; //导入依赖的package包/类
public StyledTextContent getRegistersText() {
return styledText_1.getContent();
}