当前位置: 首页>>代码示例>>Java>>正文


Java StyledText.addKeyListener方法代码示例

本文整理汇总了Java中org.eclipse.swt.custom.StyledText.addKeyListener方法的典型用法代码示例。如果您正苦于以下问题:Java StyledText.addKeyListener方法的具体用法?Java StyledText.addKeyListener怎么用?Java StyledText.addKeyListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.custom.StyledText的用法示例。


在下文中一共展示了StyledText.addKeyListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createPartControl

import org.eclipse.swt.custom.StyledText; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
	super.createPartControl(parent);

	Control adapter = getAdapter(Control.class);
	if (adapter instanceof StyledText) {
		StyledText text = (StyledText) adapter;
		text.addCaretListener(new BatchEditorCaretListener());
	}

	
	activateBatchEditorContext();

	installAdditionalSourceViewerSupport();

	StyledText styledText = getSourceViewer().getTextWidget();
	styledText.addKeyListener(new BatchBracketInsertionCompleter(this));

	/*
	 * register as resource change listener to provide marker change
	 * listening
	 */
	ResourcesPlugin.getWorkspace().addResourceChangeListener(this);

	setTitleImageInitial();
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:27,代码来源:BatchEditor.java

示例2: createPartControl

import org.eclipse.swt.custom.StyledText; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
	super.createPartControl(parent);

	Control adapter = getAdapter(Control.class);
	if (adapter instanceof StyledText) {
		StyledText text = (StyledText) adapter;
		text.addCaretListener(new BashEditorCaretListener());
	}

	activateBashEditorContext();

	installAdditionalSourceViewerSupport();

	StyledText styledText = getSourceViewer().getTextWidget();
	styledText.addKeyListener(new BashBracketInsertionCompleter(this));

	/*
	 * register as resource change listener to provide marker change
	 * listening
	 */
	ResourcesPlugin.getWorkspace().addResourceChangeListener(this);

	setTitleImageInitial();
}
 
开发者ID:de-jcup,项目名称:eclipse-bash-editor,代码行数:26,代码来源:BashEditor.java

示例3: newTextArea

import org.eclipse.swt.custom.StyledText; //导入方法依赖的package包/类
public StyledText newTextArea(Composite composite, boolean editable, int sty) {
    int style = SWT.MULTI | SWT.V_SCROLL;
    if (!editable)
        style |= SWT.READ_ONLY;
    else
        style |= SWT.WRAP;

    StyledText d = new StyledText(composite, style);
    d.setText("To be entered\ntest\n\test\ntest");
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = 80;
    gd.widthHint = 460;
    gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
    d.setEditable(editable);
    d.setLayoutData(gd);
    d.setFont(FontShop.textFont());
    if (keyListener != null)
        d.addKeyListener(keyListener);
    d.setWordWrap(editable);
    WidgetShop.tweakTextWidget(d);
    return d;
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:23,代码来源:GridComposite.java

示例4: TextAreaParameter

import org.eclipse.swt.custom.StyledText; //导入方法依赖的package包/类
public
TextAreaParameter(
	Composite 			composite,
	UITextAreaImpl 		_ui_text_area)
{
	super( "" );

	ui_text_area = _ui_text_area;

	text_area = new StyledText(composite,SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);

	ClipboardCopy.addCopyToClipMenu(
			text_area,
			new ClipboardCopy.copyToClipProvider()
			{
				@Override
				public String
				getText()
				{
					return( text_area.getText().trim());
				}
			});

	text_area.addKeyListener(
			new KeyAdapter()
			{
				@Override
				public void
				keyPressed(
					KeyEvent event )
				{
					int key = event.character;

					if ( key <= 26 && key > 0 ){

						key += 'a' - 1;
					}

					if ( key == 'a' && event.stateMask == SWT.MOD1 ){

						event.doit = false;

						text_area.selectAll();
					}
				}
			});

	text_area.setText(ui_text_area.getText());

	ui_text_area.addPropertyChangeListener(this);
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:52,代码来源:TextAreaParameter.java


注:本文中的org.eclipse.swt.custom.StyledText.addKeyListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。