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


Java ControlDecoration.setImage方法代码示例

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


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

示例1: createControl

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的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: createControlDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * creates a control decoration to given control. will add the control to
 * decorations map
 *
 * @param control
 *            to add decoration to
 * @param message
 *            to display when decoration is shown
 * @param isRequired
 *            should the required asterisk be shown?
 * @return created decoration
 */
public static ControlDecoration createControlDecoration(final Control control, final String message,
		final boolean isRequired) {
	final ControlDecoration controlDecoration = new ControlDecoration(control, SWT.RIGHT | SWT.BOTTOM);
	final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
			.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
	decorations.put(control, controlDecoration);
	controlDecoration.setImage(fieldDecoration.getImage());
	controlDecoration.hide();
	control.addDisposeListener(new DisposeListener() {

		@Override
		public void widgetDisposed(final DisposeEvent e) {
			final ControlDecoration remove = decorations.remove(control);
			controlDecoration.dispose();
		}

	});
	if (isRequired) {
		createRequiredControlDecoration(control);
	}
	return controlDecoration;
}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:35,代码来源:BindingHelper.java

示例3: createContents

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
protected Control createContents(Composite parent) {
	Control control = super.createContents(parent);

	DataBindingContext binding = new DataBindingContext();

	ControlDecoration controlDecoration = new ControlDecoration(tname, SWT.LEFT | SWT.TOP);
	controlDecoration.setDescriptionText(Messages.ThemesPreferencePage_duplicateName);
	FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
			FieldDecorationRegistry.DEC_ERROR);
	controlDecoration.setImage(fieldDecoration.getImage());

	binding.bindValue(SWTObservables.observeText(tname, SWT.Modify), PojoObservables.observeValue(this, "themename"), //$NON-NLS-1$
			new UpdateValueStrategy().setAfterConvertValidator(new StringRequiredValidator(Messages.ThemesPreferencePage_enternameMessage,
					controlDecoration, getButton(IDialogConstants.OK_ID))), null);

	return control;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:ThemesPreferencePage.java

示例4: 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

示例5: updateDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的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

示例6: 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

示例7: 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

示例8: 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

示例9: initDecorators

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void initDecorators() {
	FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
			.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);

	cbProjectDecoration = new ControlDecoration(cbProject, SWT.TOP | SWT.RIGHT);
	cbProjectDecoration.setImage(fieldDecoration.getImage());
	cbProjectDecoration.setDescriptionText("Please first create a Maven project");
	cbProjectDecoration.hide();

	cbVersionDecoration = new ControlDecoration(cbVersion, SWT.TOP | SWT.RIGHT);
	cbVersionDecoration.setImage(fieldDecoration.getImage());
	cbVersionDecoration.setDescriptionText(
			"Please first add maven dependency of " + AsposeConstants.API_NAME + " for java API");
	cbVersionDecoration.hide();

	examplesTreeDecoration = new ControlDecoration(examplesTree, SWT.TOP | SWT.RIGHT);
	examplesTreeDecoration.setImage(fieldDecoration.getImage());
	examplesTreeDecoration.setDescriptionText("Please select one example category");
	examplesTreeDecoration.hide();
}
 
开发者ID:aspose-tasks,项目名称:Aspose.Tasks-for-Java,代码行数:21,代码来源:AsposeExampleWizardPage.java

示例10: 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

示例11: addDecorator

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * This Method use to create error message decorator,Its show an error image with message on applied controller field. 
 * @param control
 * @param message
 * @return ControlDecoration
 */

public static ControlDecoration addDecorator(Control control,String message){
	ControlDecoration txtDecorator = new ControlDecoration(control,SWT.LEFT);
	FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
	Image img = fieldDecoration.getImage();
	txtDecorator.setImage(img);
	txtDecorator.setDescriptionText(message);
	return txtDecorator; 
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:16,代码来源:WidgetUtility.java

示例12: addDecorator

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private ControlDecoration addDecorator(Control control, String message) {
	ControlDecoration txtDecorator = new ControlDecoration(control, SWT.LEFT);
	FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
			FieldDecorationRegistry.DEC_ERROR);
	Image img = fieldDecoration.getImage();
	txtDecorator.setImage(img);
	txtDecorator.setDescriptionText(message);
	txtDecorator.setMarginWidth(3);
	return txtDecorator;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:ViewDataPreferencesDialog.java

示例13: createControl

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
protected Control createControl(Composite parent) {
    super.createControl(parent);
    deco = new ControlDecoration(text, decoStyle);      
    deco.setImage(getErrorImage());
    deco.hide();
    return text;
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:9,代码来源:TextCellEditorWithValidation.java

示例14: 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

示例15: update

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * Updates the visibility, image, and description text of the given
 * ControlDecoration to represent the given status.
 * 
 * @param decoration
 *            the ControlDecoration to update
 * @param status
 *            the status to be displayed by the decoration
 */
public void update(ControlDecoration decoration, IStatus status)
{
	if (status == null || status.isOK())
	{
		decoration.hide();
	} else
	{
		decoration.setImage(getImage(status));
		decoration.setDescriptionText(getDescriptionText(status));
		decoration.show();
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:22,代码来源:BackgroundControlDecorationUpdater.java


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