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


Java FieldDecorationRegistry.getDefault方法代码示例

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


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

示例1: createControl

import org.eclipse.jface.fieldassist.FieldDecorationRegistry; //导入方法依赖的package包/类
@Override
public void createControl(UI_POSITION position, Composite parent) {
  // We add controls only to the BOTTOM position.
  if (position == UI_POSITION.BOTTOM) {
    portLabel = new Label(parent, SWT.NONE);
    portLabel.setVisible(false);
    portLabel.setText(Messages.getString("NEW_SERVER_DIALOG_PORT"));

    portText = new Text(parent, SWT.SINGLE | SWT.BORDER);
    portText.setVisible(false);
    portText.setText(String.valueOf(LocalAppEngineServerBehaviour.DEFAULT_SERVER_PORT));
    portText.addVerifyListener(new PortChangeMonitor());
    portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
    Image errorImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();

    portDecoration = new ControlDecoration(portText, SWT.LEFT | SWT.TOP);
    portDecoration.setDescriptionText(Messages.getString("NEW_SERVER_DIALOG_INVALID_PORT_VALUE"));
    portDecoration.setImage(errorImage);
    portDecoration.hide();
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:24,代码来源:ServerPortExtension.java

示例2: updateDecoration

import org.eclipse.jface.fieldassist.FieldDecorationRegistry; //导入方法依赖的package包/类
protected void updateDecoration(ControlDecoration decoration, RefactoringStatus status) {
	RefactoringStatusEntry highestSeverity= status.getEntryWithHighestSeverity();
	if (highestSeverity != null) {
		Image newImage= null;
		FieldDecorationRegistry registry= FieldDecorationRegistry.getDefault();
		switch (highestSeverity.getSeverity()) {
			case RefactoringStatus.INFO:
				newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage();
				break;
			case RefactoringStatus.WARNING:
				newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
				break;
			case RefactoringStatus.FATAL:
			case RefactoringStatus.ERROR:
				newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
		}
		decoration.setDescriptionText(highestSeverity.getMessage());
		decoration.setImage(newImage);
		decoration.show();
	} else {
		decoration.setDescriptionText(null);
		decoration.hide();
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:ExtractClassWizard.java

示例3: getCueDecoration

import org.eclipse.jface.fieldassist.FieldDecorationRegistry; //导入方法依赖的package包/类
private FieldDecoration getCueDecoration( )
{
	// We use our own decoration which is based on the JFace version.
	FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault( );
	FieldDecoration dec = registry.getFieldDecoration( DEC_CONTENTASSIST_ID );
	if ( dec == null )
	{
		// Get the standard one. We use its image and our own customized
		// text.
		FieldDecoration standardDecoration = registry.getFieldDecoration( FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
		registry.registerFieldDecoration( DEC_CONTENTASSIST_ID,
				Messages.getFormattedString( "ssDecoratorContentAssist", //$NON-NLS-1$
						getTriggerKeyText( ) ),
				standardDecoration.getImage( ) );
		dec = registry.getFieldDecoration( DEC_CONTENTASSIST_ID );
	}
	else
	{
		dec.setDescription( Messages.getFormattedString( "ssDecoratorContentAssist", //$NON-NLS-1$
				getTriggerKeyText( ) ) );
	}
	return dec;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:FieldAssistHelper.java

示例4: showServiceKeyDecorationMessage

import org.eclipse.jface.fieldassist.FieldDecorationRegistry; //导入方法依赖的package包/类
private void showServiceKeyDecorationMessage(String message, boolean isError) {
  FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
  FieldDecoration fieldDecoration = registry.getFieldDecoration(
      isError ? FieldDecorationRegistry.DEC_ERROR : FieldDecorationRegistry.DEC_INFORMATION);

  serviceKeyDecoration.show();
  serviceKeyDecoration.setImage(fieldDecoration.getImage());
  serviceKeyDecoration.setDescriptionText(message);
  serviceKeyDecoration.showHoverText(message);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:11,代码来源:GcpLocalRunTab.java

示例5: setImage

import org.eclipse.jface.fieldassist.FieldDecorationRegistry; //导入方法依赖的package包/类
/**
 * Adds an image to decorated field to be shown in the message area.
 * 
 * @param image
 *            desired image to be shown in the ImageAndMessageArea
 */
public void setImage(Image image) {
	FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
	registry.registerFieldDecoration("messageImage", null, image); //$NON-NLS-1$
	messageField.addFieldDecoration(registry
			.getFieldDecoration("messageImage"), //$NON-NLS-1$
			SWT.LEFT | SWT.TOP, false);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:14,代码来源:ImageAndMessageArea.java


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