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


Java ControlDecoration.setShowOnlyOnFocus方法代码示例

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


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

示例1: createContentAssistDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private ControlDecoration createContentAssistDecoration(StyledText styledText) {
	final ControlDecoration result = new ControlDecoration(styledText, SWT.TOP | SWT.LEFT);
	result.setShowHover(true);
	result.setShowOnlyOnFocus(true);

	final Image image = ImageDescriptor
			.createFromFile(XtextStyledTextCellEditor.class, "images/content_assist_cue.gif").createImage();
	result.setImage(image);
	result.setDescriptionText("Content Assist Available (CTRL + Space)");
	result.setMarginWidth(2);
	styledText.addDisposeListener(new DisposeListener() {
		public void widgetDisposed(DisposeEvent e) {
			if (getDecoration() != null) {
				getDecoration().dispose();
			}
			if (image != null) {
				image.dispose();
			}
		}
	});
	return result;
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:23,代码来源:StyledTextXtextAdapter.java

示例2: createContentAssistDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void createContentAssistDecoration(StyledText styledText) {
	decoration = new ControlDecoration(styledText, SWT.TOP | SWT.LEFT);
	decoration.setShowHover(true);
	decoration.setShowOnlyOnFocus(true);

	final Image image = ImageDescriptor.createFromFile(XtextStyledTextCellEditor.class,
			"images/content_assist_cue.gif").createImage();
	decoration.setImage(image);
	decoration.setDescriptionText("Content Assist Available (CTRL + Space)");
	decoration.setMarginWidth(2);
	styledText.addDisposeListener(new DisposeListener() {
		public void widgetDisposed(DisposeEvent e) {
			if (decoration != null) {
				decoration.dispose();
			}
			if (image != null) {
				image.dispose();
			}
		}
	});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:StyledTextXtextAdapter.java

示例3: showErrorDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void showErrorDecoration( AssistField smartField, boolean show )
{
	FieldDecoration dec = smartField.getErrorDecoration( );
	ControlDecoration cd = smartField.controlDecoration;
	if ( show )
	{
		cd.setImage( dec.getImage( ) );
		cd.setDescriptionText( dec.getDescription( ) );
		cd.setShowOnlyOnFocus( false );
		cd.show( );
	}
	else
	{
		cd.hide( );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:FieldAssistHelper.java

示例4: showWarningDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void showWarningDecoration( AssistField smartField, boolean show )
{
	FieldDecoration dec = smartField.getWarningDecoration( );
	ControlDecoration cd = smartField.controlDecoration;
	if ( show )
	{
		cd.setImage( dec.getImage( ) );
		cd.setDescriptionText( dec.getDescription( ) );
		cd.setShowOnlyOnFocus( false );
		cd.show( );
	}
	else
	{
		cd.hide( );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:FieldAssistHelper.java

示例5: showContentAssistDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void showContentAssistDecoration( AssistField smartField,
		boolean show )
{
	FieldDecoration dec = getCueDecoration( );
	ControlDecoration cd = smartField.controlDecoration;
	if ( show )
	{
		cd.setImage( dec.getImage( ) );
		cd.setDescriptionText( dec.getDescription( ) );
		cd.setShowOnlyOnFocus( true );
		cd.show( );
	}
	else
	{
		cd.hide( );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:FieldAssistHelper.java

示例6: createContentProposalDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * Adds the content proposal field decoration to a given control.
 *
 * @param control
 *            The control to decorate
 */
private ControlDecoration createContentProposalDecoration(Control control) {
	ControlDecoration decoration = new ControlDecoration(control, SWT.TOP | SWT.LEFT);
	decoration.setImage(contentProposalDecorationImage);
	decoration.setShowOnlyOnFocus(true);
	return decoration;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:WorkspaceWizardPage.java

示例7: addBulbDecorator

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void addBulbDecorator(final Control control, final String tooltip) {
	ControlDecoration dec = new ControlDecoration(control, SWT.TOP | SWT.LEFT);

	dec.setImage(FieldDecorationRegistry.getDefault()
			.getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL).getImage());

	dec.setShowOnlyOnFocus(true);
	dec.setShowHover(true);

	dec.setDescriptionText(tooltip);
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:12,代码来源:BookmarksView.java

示例8: createDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/***************************************************************************
 * Create decoration for the input field
 **************************************************************************/
private void createDecoration()
{
	// Field decoration
	deco = new ControlDecoration(m_contents, SWT.RIGHT);
	deco.setDescriptionText("Use CTRL+Space to see the possible commands");
	deco.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION)
	        .getImage());
	deco.setShowOnlyOnFocus(false);
	deco.setShowHover(true);

	KeyStroke keyStroke;
	ArrayList<String> possibleCommandsList = new ArrayList<String>();
	for (GuiExecutorCommand cmd : GuiExecutorCommand.values())
	{
		possibleCommandsList.add(cmd.label.toLowerCase());
	}
	String[] possibleCommands = possibleCommandsList.toArray(new String[0]);
	char[] autoActivationCharacters = new char[0];
	
	provider = new SimpleContentProposalProvider(possibleCommands);
	
	try
	{
		keyStroke = KeyStroke.getInstance("Ctrl+Space");
		adp = new ContentProposalAdapter(m_contents, new TextContentAdapter(), provider, keyStroke,
		        autoActivationCharacters);
		
		adp.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
		adp.addContentProposalListener((IContentProposalListener) m_contents.getParent().getParent());
	}
	catch (Exception ex)
	{
		ex.printStackTrace();
	}
}
 
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:39,代码来源:PromptField.java

示例9: TextEditorErrorListener

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * Creates a new text editor error listener.
 * 
 * @param textCellEditor
 *            the associated text cell editor
 * @param decor
 *            the control decoration
 */
public TextEditorErrorListener(TextCellEditor textCellEditor, ControlDecoration decor) {
	this.textCellEditor = textCellEditor;
	textCtrl = (Text) textCellEditor.getControl();
	this.decor = decor;
	decor.setImage(DECOR_IMG);
	decor.setShowOnlyOnFocus(true);
	decor.setShowHover(true);
	decor.hide();
	decor.hideHover();
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:19,代码来源:TextEditorErrorListener.java

示例10: addDecorationInfo

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * Decorates the specified control with a info marker displaying the
 * specified text as mouse over.
 * 
 * @param inControl
 *            the Control to decorate
 * @param inInfo
 *            String the information text to display as mouse over
 * @return ControlDecoration the hint decoration
 */
public final static ControlDecoration addDecorationInfo(
        final Control inControl, final String inInfo) {
	final ControlDecoration outDecoration = new ControlDecoration(
	        inControl, SWT.LEFT | SWT.TOP);
	outDecoration.setImage(IMG_INFO);
	outDecoration.setDescriptionText(inInfo);
	outDecoration.setShowOnlyOnFocus(true);
	return outDecoration;
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:20,代码来源:FormUtility.java

示例11: addDecorationHint

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * Decorates the specified control with a hint displaying the specified text
 * as mouse over.
 * 
 * @param inControl
 *            the Control to decorate
 * @param inHint
 *            String the hint text to display as mouse over
 * @return ControlDecoration the hint decoration
 */
public final static ControlDecoration addDecorationHint(
        final Control inControl, final String inHint) {
	final ControlDecoration outDecoration = new ControlDecoration(
	        inControl, SWT.LEFT | SWT.TOP);
	outDecoration.setImage(IMG_HINT);
	outDecoration.setDescriptionText(inHint);
	outDecoration.setShowOnlyOnFocus(true);
	return outDecoration;
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:20,代码来源:FormUtility.java


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