本文整理汇总了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();
}
}
示例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();
}
}
示例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;
}
示例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);
}
示例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);
}