當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。