本文整理汇总了Java中org.eclipse.jface.fieldassist.ControlDecoration.setDescriptionText方法的典型用法代码示例。如果您正苦于以下问题:Java ControlDecoration.setDescriptionText方法的具体用法?Java ControlDecoration.setDescriptionText怎么用?Java ControlDecoration.setDescriptionText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.fieldassist.ControlDecoration
的用法示例。
在下文中一共展示了ControlDecoration.setDescriptionText方法的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);
}
}
示例2: 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;
}
示例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("[\\d]*").matcher(string);
if(!matchs.matches()){
txtDecorator.setDescriptionText(Messages.FIELDBATCH);
txtDecorator.show();
event.doit=false;
}else
txtDecorator.hide();
}
};
return listener;
}
示例4: 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(regex).matcher(string);
logger.debug(this+"::ELTVerifyTextListener is called");
if(!matchs.matches()){
txtDecorator.setDescriptionText(errorMessage);
txtDecorator.show();
event.doit=false;
logger.trace("Pattern does not matches !matchs.matches() with :" + string);
}else{
txtDecorator.hide();
logger.trace("Pattern matches with :" + string);
}
}
};
return listener;
}
示例5: 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();
}
}
示例6: 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;
}
示例7: 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;
}
示例8: 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();
}
}
});
}
示例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();
}
}
示例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) {}
}
示例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( );
}
}
示例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( );
}
}
示例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( );
}
}
示例14: 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();
}
示例15: 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;
}