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


Java ControlDecoration.setMarginWidth方法代码示例

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


在下文中一共展示了ControlDecoration.setMarginWidth方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: validateWidgetText

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * Validate text
 * @param text
 */
public void validateWidgetText(Text text, PropertyDialogButtonBar propertyDialogButtonBar, Cursor cursor,
		ControlDecoration controlDecoration) {
	controlDecoration.setMarginWidth(2);
	ModifyAlphaNumbericTextListener alphaNumbericTextListener = new ModifyAlphaNumbericTextListener();
	ListenerHelper helper = new ListenerHelper();
	helper.put(HelperType.CONTROL_DECORATION, controlDecoration);
	text.addListener(SWT.Modify, alphaNumbericTextListener.getListener(propertyDialogButtonBar, helper, text));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:13,代码来源:FTPWidgetUtility.java

示例4: validateEmptyWidgetText

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * @param text
 * @param propertyDialogButtonBar
 * @param cursor
 */
public void validateEmptyWidgetText(Text text, PropertyDialogButtonBar propertyDialogButtonBar, Cursor cursor, 
		ControlDecoration controlDecoration){
	controlDecoration.setMarginWidth(2);
	ELTModifyListener eltModifyListener = new ELTModifyListener();
	ListenerHelper helper = new ListenerHelper();
	helper.put(HelperType.CONTROL_DECORATION, controlDecoration);
	text.addListener(SWT.Modify, eltModifyListener.getListener(propertyDialogButtonBar, helper, text));
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:FTPWidgetUtility.java

示例5: attachDecoratorToTextbox

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * Attach decorators to the TextBoxes 
 * @param labelName
 * @param textboxWgt
 * @param txtDecorator
 * @return
 */
private ControlDecoration attachDecoratorToTextbox(String labelName, AbstractELTWidget textboxWgt,
		ControlDecoration txtDecorator) {

	txtDecorator = WidgetUtility.addDecorator((Text) textboxWgt.getSWTWidgetControl(),
			Messages.bind(Messages.EMPTY_FIELD, labelName));
	txtDecorator.setMarginWidth(3);
	attachListeners(textboxWgt, txtDecorator);

	return txtDecorator;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:18,代码来源:SelectionDatabaseWidget.java

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

示例7: createErrorDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private static ControlDecoration createErrorDecoration(final Control control, int marginWidth, String description) {
	final ControlDecoration textDecoration = new ControlDecoration(control, SWT.LEFT | SWT.TOP);
	textDecoration.setDescriptionText(description);
	textDecoration.setMarginWidth(marginWidth);
	FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
			FieldDecorationRegistry.DEC_ERROR);
	textDecoration.setImage(fieldDecoration.getImage());
	return textDecoration;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:UIUtil.java

示例8: addDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
public static void addDecoration(Text text) {

		Image imageDecoration = FieldDecorationRegistry.getDefault()
													   .getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION)
													   .getImage();
		ControlDecoration decoration = new ControlDecoration(text, SWT.RIGHT	
					   										     | SWT.TOP);
		decoration.setImage(imageDecoration);
		decoration.setDescriptionText(POINTS);
		decoration.setMarginWidth(2);
	}
 
开发者ID:jaloncad,项目名称:redmine.rap,代码行数:12,代码来源:ViewUtils.java

示例9: createOperationClassComposite

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private OperationClassComposite createOperationClassComposite(
		final ExpandItem expandItem) {
	final OperationClassComposite operationClassComposite=new OperationClassComposite(this,expandBar, 
   			SWT.NONE,mappingSheetRowForOperationClass,getComponent(),widgetConfig,transformMapping);
	expandItem.setData(OUTPUT_TABLE_VIEWER, operationClassComposite.getOutputTableViewer());
	operationClassComposite.getOperationIdTextBox().setText(mappingSheetRowForOperationClass.getOperationID());
	operationClassComposite.getOperationIdTextBox().setData(expandItem); 
	addListenerForRowHighlightingForOperationComposite(operationClassComposite);
	addModifyListenerToOperationClassAndExpressionTextBox(operationClassComposite.getOperationTextBox());
	attachModifyListenerToIdTextBox(mappingSheetRowForOperationClass, operationClassComposite.getOperationIdTextBox());
	attachFocusListenerToIdTextBox(operationClassComposite.getOperationIdTextBox());
	addIsParamSelectionListenerForOperationClassWidget(operationClassComposite.getBtnIsParam(), mappingSheetRowForOperationClass);
	operationalInputFieldTableViewer=operationClassComposite.getInputTableViewer();
   	operationalInputFieldTableViewer = setTableViewer(operationalInputFieldTableViewer,
   			 operationalInputFieldTableViewer.getControl().getParent(), new String[] {Messages.INNER_OPERATION_INPUT_FIELD },
			new ELTFilterContentProvider());
   	if (OSValidator.isMac()) {
		operationalInputFieldTableViewer.getTable().getColumn(0).setWidth(147);
	} else {
		operationalInputFieldTableViewer.getTable().getColumn(0).setWidth(145);
	}
   	 operationalInputFieldTableViewer.setInput(mappingSheetRowForOperationClass.getInputFields());
   	 operationalInputFieldTableViewer.setCellModifier(new ELTCellModifier(operationalInputFieldTableViewer, this,
   			 mappingSheetRowForOperationClass));
   	 operationalInputFieldTableViewer.setLabelProvider(new ELTFilterLabelProvider());
   	 CellEditor[] editor=operationalInputFieldTableViewer.getCellEditors();
		 fieldNameDecorator = WidgetUtility.addDecorator(editor[0].getControl(),Messages.FIELDNAME_SHOULD_NOT_BE_BLANK);
		 isFieldNameAlphanumericDecorator=WidgetUtility.addDecorator(editor[0].getControl(),Messages.FIELDNAME_NOT_ALPHANUMERIC_ERROR);	
		 editors[0].setValidator(new TransformCellEditorFieldValidator(fieldNameDecorator,isFieldNameAlphanumericDecorator));
	 isFieldNameAlphanumericDecorator.setMarginWidth(8);
	 fieldNameDecorator.setMarginWidth(8);
		 
		 operationalOutputFieldTableViewer=operationClassComposite.getOutputTableViewer();
   	 operationalOutputFieldTableViewer = setTableViewer(operationalOutputFieldTableViewer,
   			 operationalOutputFieldTableViewer.getControl().getParent(), new String[] {Messages.INNER_OPERATION_OUTPUT_FIELD },
			new ELTFilterContentProvider());
   	 if (OSValidator.isMac()) {
   		 operationalOutputFieldTableViewer.getTable().getColumn(0).setWidth(147);
		} else {
			operationalOutputFieldTableViewer.getTable().getColumn(0).setWidth(145);
		}
   	 operationalOutputFieldTableViewer.setCellModifier(new ELTCellModifier(operationalOutputFieldTableViewer, this));
   	 operationalOutputFieldTableViewer.setInput(mappingSheetRowForOperationClass.getOutputList());
   	 operationalOutputFieldTableViewer.setLabelProvider(new ELTFilterLabelProvider());
   	 
   	 CellEditor[] operationalOutputFieldEditor=operationalOutputFieldTableViewer.getCellEditors();
   	 ControlDecoration operationalOutputfieldDecorator = WidgetUtility.addDecorator(operationalOutputFieldEditor[0].getControl(),Messages.FIELDNAME_SHOULD_NOT_BE_BLANK);
   	 ControlDecoration operationalOutputfieldAlphaNumeric = WidgetUtility.addDecorator(operationalOutputFieldEditor[0].getControl(),Messages.FIELDNAME_NOT_ALPHANUMERIC_ERROR);	
   	 operationalOutputFieldEditor[0].setValidator(new TransformCellEditorFieldValidator(operationalOutputfieldDecorator,operationalOutputfieldAlphaNumeric));
   	 operationalOutputfieldAlphaNumeric.setMarginWidth(8);
   	 operationalOutputfieldDecorator.setMarginWidth(8);
   	 
   	 attachFocuListenerToParamaterTextBox(operationClassComposite.getParameterTextBox());
   	 addSelectionListenerToBrowseButton(operationClassComposite);
   	 operationClassComposite.getBrowseButton().setData(Messages.MAPPING_SHEET,mappingSheetRowForOperationClass);
   	 operationClassComposite.getBrowseButton().setData(OPERATION_CLASS_TEXT_BOX, operationClassComposite.getOperationTextBox());
   	 DragDropTransformOpImp dragDropTransformOpImpnew1 = new DragDropTransformOpImp(this,
			 temporaryOutputFieldMap,
			 mappingSheetRowForOperationClass.getOutputList(), mappingSheetRowForOperationClass.getInputFields(), true,
			operationalInputFieldTableViewer, operationalOutputFieldTableViewer,transformMapping.getOutputFieldList());
		 DragDropUtility.INSTANCE.applyDrop(operationalInputFieldTableViewer, dragDropTransformOpImpnew1);
   	 intializeFunctionalityToOperationClassWidget
   	 (operationClassComposite, mappingSheetRowForOperationClass, operationalInputFieldTableViewer, operationalOutputFieldTableViewer);
   	 operationClassComposite.setVisible(false);
   	 operationalOutputTableDoubleClick(mappingSheetRowForOperationClass,operationalOutputFieldTableViewer); 
   	 operationalInputTableDoubleClick(mappingSheetRowForOperationClass,operationalInputFieldTableViewer);  
   	 return operationClassComposite;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:69,代码来源:TransformDialog.java

示例10: createControlDecoration

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * Create a ControlDecoration for decorating specified control. Render the
 * decoration only on the specified Composite or its children.
 * 
 * @param control
 *            the control to be decorated.
 * @param composite
 *            The SWT composite within which the decoration should be
 *            rendered. The decoration will be clipped to this composite,
 *            but it may be rendered on a child of the composite. The
 *            decoration will not be visible if the specified composite or
 *            its child composites are not visible in the space relative to
 *            the control, where the decoration is to be rendered. If this
 *            value is null, then the decoration will be rendered on
 *            whichever composite (or composites) are located in the
 *            specified position.
 * @return instance of <code>ControlDecoration</code>
 */
public ControlDecoration createControlDecoration( Control control,
		Composite composite )
{
	ControlDecoration cd = new ControlDecoration( control,
			getDecorationLocationBits( ),
			composite );
	cd.setMarginWidth( getMarginWidth( ) );
	return cd;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:28,代码来源:FieldAssistHelper.java


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