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


Java ControlDecoration.show方法代码示例

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


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

示例1: validate

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void validate(Text text1, Text text2, 
		ControlDecoration text1Decorator, ControlDecoration text2Decorator, String lowerValue, String upperValue) {
	if(validateNumericField(text1.getText())){
		text1Decorator.hide();
		if(StringUtils.isNotBlank(text2.getText()) && validateNumericField(text2.getText())){
			if(compareBigIntegerValue(upperValue, lowerValue) == -1){
				text1Decorator.show();
				text1Decorator.setDescriptionText(Messages.UPPER_LOWER_BOUND_ERROR);
			}else{
				text1Decorator.hide();
				text2Decorator.hide();
			}
		}
	}
	else{
		text1Decorator.show();
		text1.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
		text1Decorator.setDescriptionText(Messages.DB_NUMERIC_PARAMETERZIATION_ERROR);
		validateFieldWithParameter(text1.getText(), text1Decorator);
		validateFieldWithParameter(text2.getText(), text2Decorator);
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:ModifyListenerForDBComp.java

示例2: isTextBoxEmpty

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void isTextBoxEmpty(ModifyEvent e, ControlDecoration emptyDecorator,ControlDecoration zeroDecorator) {
	emptyDecorator.hide();
	zeroDecorator.hide();
	String fileSize = ((Text) e.widget).getText();
	if (!fileSize.isEmpty()) {
		emptyDecorator.hide();
		if (Integer.parseInt(fileSize) == 0) {
			zeroDecorator.show();
			getButton(0).setEnabled(false);
		} else {
			zeroDecorator.hide();
			getButton(0).setEnabled(true);
		}
		enableAndDisableOkButtonIfAnyDecoratorIsVisible();
	} else {
		getButton(0).setEnabled(false);
		emptyDecorator.show();
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:ViewDataPreferencesDialog.java

示例3: getListener

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper,
		Widget... widgets) {
	if (helper != null) {
		txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
	}
	Listener listener = new Listener() {

		@Override
		public void handleEvent(Event event) {
			String string = event.text;
			Matcher matchs = Pattern.compile(Constants.REGEX).matcher(string);
			LOGGER.debug("Verifying text format");
			if (!matchs.matches()) {
				txtDecorator.setDescriptionText(Messages.CHARACTERSET);
				txtDecorator.show();
				event.doit = false;

			} else
				txtDecorator.hide();

		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:26,代码来源:ELTVerifySequenceFieldName.java

示例4: validateForSingleAndDuplicateCharacter

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void validateForSingleAndDuplicateCharacter(VerifyEvent e, String textBoxValue,
		ControlDecoration singleCharactorDecorator, ControlDecoration duplicateDecorator, ControlDecoration emptyDecorator) {
	singleCharactorDecorator.hide();
	duplicateDecorator.hide();
	emptyDecorator.hide();
	String value = ((Text) e.widget).getText();
	String currentValue = (value.substring(0, e.start) + e.text + value.substring(e.end));
	if (StringUtils.isNotEmpty(currentValue)) {
		validateDelimiterAndQuoteCharactorProperty(currentValue, textBoxValue, singleCharactorDecorator,
				duplicateDecorator);
	} else {
		getButton(0).setEnabled(false);
		emptyDecorator.show();
		warningLabel.setText(Messages.WARNING_MESSAGE);
		warningLabel.setVisible(true);
		warningImageLabel.setVisible(true);
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:19,代码来源:ViewDataPreferencesDialog.java

示例5: getListener

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper, Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helper != null){
		txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
	}
	
	Listener listener = new Listener() {
		@Override
		public void handleEvent(Event event) {
			String charSet = ((Text) widgetList[0]).getText();
			if(SWT.FocusIn == event.type) {
					if (StringUtils.isEmpty(charSet)) {
					txtDecorator.show();
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else {
					txtDecorator.hide();
				}
			}
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:25,代码来源:DelimiterFocusInListener.java

示例6: getListener

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper,  Widget... widgets) {
		if (helper != null) {
			txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
		}

		Listener listener=new Listener() {
			@Override
			public void handleEvent(Event event) {
				String string=event.text;
				Matcher matchs=Pattern.compile("[\\d]*").matcher(string);
				if(!matchs.matches()){
					txtDecorator.setDescriptionText(Messages.FIELDBATCH);
					txtDecorator.show();
					event.doit=false;
			}else
				txtDecorator.hide();
			}
		};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:ELTVerifyNumbericListener.java

示例7: getListener

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar,ListenerHelper helpers, Widget... widgets) {
	final Widget[] widgetList = widgets;
			
	Listener listener=new Listener() { 
		@Override
		public void handleEvent(Event event) {
			if(!((Button)widgetList[1]).getSelection()){
			ControlDecoration	fieldNameMustJava = WidgetUtility.addDecorator((Text)widgetList[0],Messages.INVALID_FILE);
			if(!WidgetUtility.isFileExtention((((Text)widgetList[0]).getText()).trim(), ".java") && !(((Text)widgetList[0]).getText().trim().isEmpty())){
				fieldNameMustJava.show();
			((Text)widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,
					255, 204));
			}
				else  
				{   
					((Text)widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,
						255, 255));
				fieldNameMustJava.hide(); 
				}
			}
		} 
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:26,代码来源:ELTCheckFileExtensionListener.java

示例8: getListener

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper, Widget... widgets) {
	final Widget[] widgetList = widgets;
	if (helper != null){
		txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
	}
	
	Listener listener = new Listener() {
		@Override
		public void handleEvent(Event event) {
			String charSet = ((Text) widgetList[0]).getText().trim();
			if(SWT.FocusIn == event.type) {
				if (StringUtils.isBlank(charSet)) {
					txtDecorator.show();
					((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
					((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else {
					txtDecorator.hide();
				}
			}
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:25,代码来源:FocusInListener.java

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

示例10: requestVerification

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
public void requestVerification() {
  boolean verified = true;
  for (IGenericTransactionField field : transaction.getFields()) {
    String[] message = new String[1];
    ControlDecoration deco = decorators.get(field.getLabel());
    if (field.verify(message)) {
      deco.hide();
    }
    else {
      deco.setDescriptionText(message[0]);
      deco.show();
      verified = false;
    }
  }

  createPage._canFlipToNextPage = verified;
  try {
    getContainer().updateButtons();
  }
  catch (Exception e) {}
}
 
开发者ID:incentivetoken,项目名称:offspring,代码行数:22,代码来源:GenericTransactionWizard.java

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

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

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

示例14: validateFieldWithParameter

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
 * The Function used to validate parameter field 
 * @param text
 * @param txtDecorator
 */
private void validateFieldWithParameter(String text, ControlDecoration txtDecorator){
	if(StringUtils.isNotBlank(text)){
		if(ParameterUtil.isParameter(text) || validateNumericField(text)){
			txtDecorator.hide();
		}else{
			txtDecorator.show();
			txtDecorator.setDescriptionText(Messages.DB_NUMERIC_PARAMETERZIATION_ERROR);
			
		}
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:17,代码来源:ModifyListenerForDBComp.java

示例15: getListener

import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helpers,
		Widget... widgets) {
	if (helpers != null) {
		txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
		txtDecorator.hide();
	}

	Listener listener = new Listener() {

		@Override
		public void handleEvent(Event event) {
			String charSet = ((Text) widgets[0]).getText().trim();
			if (SWT.FocusOut == event.type) {
				Matcher matchs=Pattern.compile(Constants.PORT_VALIDATION_REGEX).matcher(charSet);
				if (StringUtils.isBlank(charSet)){
					txtDecorator.show();
					((Text) widgets[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 204));
					((Text) widgets[0]).setToolTipText(txtDecorator.getDescriptionText());
				} else if (matchs.matches()||ParameterUtil.isParameter(charSet)) {
					txtDecorator.hide();
				}else{
					txtDecorator.show();
				}
			} 
		}
	};
	return listener;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:30,代码来源:PortFocusOutListener.java


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