本文整理汇总了Java中org.eclipse.swt.widgets.IME类的典型用法代码示例。如果您正苦于以下问题:Java IME类的具体用法?Java IME怎么用?Java IME使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IME类属于org.eclipse.swt.widgets包,在下文中一共展示了IME类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initStyle
import org.eclipse.swt.widgets.IME; //导入依赖的package包/类
/**
* 初始化默认颜色、字体等
* @param textControl
* ;
*/
private void initStyle(final StyledText textControl, IStyle cellStyle) {
// textControl.setBackground(cellStyle.getAttributeValue(CellStyleAttributes.BACKGROUND_COLOR));
textControl.setBackground(GUIHelper.getColor(210, 210, 240));
textControl.setForeground(cellStyle.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR));
textControl.setLineSpacing(Constants.SEGMENT_LINE_SPACING);
textControl.setLeftMargin(Constants.SEGMENT_LEFT_MARGIN);
textControl.setRightMargin(Constants.SEGMENT_RIGHT_MARGIN);
textControl.setTopMargin(Constants.SEGMENT_TOP_MARGIN);
textControl.setBottomMargin(Constants.SEGMENT_TOP_MARGIN);
// textControl.setLeftMargin(0);
// textControl.setRightMargin(0);
// textControl.setTopMargin(0);
// textControl.setBottomMargin(0);
textControl.setFont(JFaceResources.getFont(net.heartsome.cat.ts.ui.Constants.XLIFF_EDITOR_TEXT_FONT));
textControl.setIME(new IME(textControl, SWT.NONE));
}
示例2: activateCell
import org.eclipse.swt.widgets.IME; //导入依赖的package包/类
@Override
protected Control activateCell(Composite parent, Object originalCanonicalValue, Character initialEditValue) {
if (originalCanonicalValue == null || !(originalCanonicalValue instanceof CellEditorCanonicalValue)) {
return null;
}
StyledText textControl = createTextControl(parent);
// init style
IStyle cellStyle = getCellStyle();
textControl.setBackground(GUIHelper.getColor(210, 210, 240));
textControl.setForeground(cellStyle.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR));
//textControl.setFont(cellStyle.getAttributeValue(CellStyleAttributes.FONT));
textControl.setLineSpacing(TmxEditorConstanst.SEGMENT_LINE_SPACING);
textControl.setLeftMargin(TmxEditorConstanst.SEGMENT_LEFT_MARGIN);
textControl.setRightMargin(TmxEditorConstanst.SEGMENT_RIGHT_MARGIN);
textControl.setTopMargin(TmxEditorConstanst.SEGMENT_TOP_MARGIN);
textControl.setBottomMargin(TmxEditorConstanst.SEGMENT_TOP_MARGIN);
textControl.setIME(new IME(textControl, SWT.NONE));
setCanonicalValue(originalCanonicalValue);
textControl.forceFocus();
return textControl;
}
示例3: FXCanvas2
import org.eclipse.swt.widgets.IME; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public FXCanvas2(Composite parent, int style)
{
super(parent, style);
if (System.getProperty("os.name").toLowerCase().contains("win"))
{
this.ime = new IME(this, SWT.NONE);
this.ime.addListener(SWT.ImeComposition, new org.eclipse.swt.widgets.Listener()
{
@Override
public void handleEvent(org.eclipse.swt.widgets.Event event)
{
switch (event.detail)
{
case SWT.COMPOSITION_CHANGED:
FXCanvas2.this.sendInputMethodEventToFX();
break;
}
}
});
}
else
{
this.ime = null;
}
}