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


Java TextChangeEvent类代码示例

本文整理汇总了Java中com.vaadin.event.FieldEvents.TextChangeEvent的典型用法代码示例。如果您正苦于以下问题:Java TextChangeEvent类的具体用法?Java TextChangeEvent怎么用?Java TextChangeEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getManufacturingFilterListener

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
/**
 * Returns the TextChangeListener that gets triggered
 * 
 * @return
 */
private TextChangeListener getManufacturingFilterListener() {
	return new TextChangeListener() {

		/**
		 * 
		 */
		private static final long serialVersionUID = -2368474286053602744L;

		@Override
		public void textChange(TextChangeEvent event) {
			String newValue = (String) event.getText();
			@SuppressWarnings("unchecked")
			BeanItemContainer<VehicleInfo> container = ((BeanItemContainer<VehicleInfo>) grid
					.getContainerDataSource());
			// This is important, this removes the previous filter that was
			// used to filter the container
			container.removeContainerFilters(MANUFACTURER);
			if (null != newValue && !newValue.isEmpty()) {
				container.addContainerFilter(new SimpleStringFilter(
						MANUFACTURER, newValue, true, false));
			}
			grid.recalculateColumnWidths();
		}
	};
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:31,代码来源:FilterGrid.java

示例2: initializeText

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
protected void initializeText() {
	this.textAreaComments.setImmediate(true);
	this.textAreaComments.addTextChangeListener(new TextChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void textChange(TextChangeEvent event) {
			if (event.getText().isEmpty()) {
				self.buttonPush.setEnabled(false);
			} else {
				if (self.container.getConflictCount() == 0) {
					self.buttonPush.setEnabled(true);
				} else {
					self.buttonPush.setEnabled(false);
				}
			}
		}			
	});
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:20,代码来源:GitPushWindow.java

示例3: initializeText

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
protected void initializeText() {
	//
	// Add a validator
	//
	this.textFieldColumn.addValidator(new IntegerRangeValidator("Please enter an integer greater than or equal to 0.", 0, null));
	//
	// Respond to text changing to setup the button
	//
	this.textFieldColumn.addTextChangeListener(new TextChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void textChange(TextChangeEvent event) {
			if (event.getText() != null && event.getText().isEmpty() == false) {
				self.buttonSave.setEnabled(true);
			} else {
				self.buttonSave.setEnabled(false);
			}
		}
	});
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:22,代码来源:ColumnSelectionWindow.java

示例4: onFileNameChange

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
private void onFileNameChange(final TextChangeEvent event, final Label warningIconLabel, final Item newItem) {

        final String itemId = (String) ((TextField) event.getComponent()).getData();
        final String fileName = event.getText();

        final Boolean isWarningIconDisplayed = isWarningIcon(warningIconLabel);
        setWarningIcon(warningIconLabel, fileName, itemId);

        final Long currentSwId = (Long) newItem.getItemProperty(BASE_SOFTWARE_ID).getValue();
        final String oldFileName = (String) newItem.getItemProperty(FILE_NAME).getValue();
        newItem.getItemProperty(FILE_NAME).setValue(event.getText());

        // if warning was displayed prior and not displayed currently
        if (isWarningIconDisplayed && !warningIconLabel.isVisible()) {
            modifyIconOfSameSwId(itemId, currentSwId, oldFileName);
        }
        checkDuplicateEntry(itemId, currentSwId, event.getText(), oldFileName);
        enableOrDisableUploadBtn();
    }
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:20,代码来源:UploadConfirmationWindow.java

示例5: initSearchField

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
protected void initSearchField() {
  HorizontalLayout searchLayout = new HorizontalLayout();
  searchLayout.setSpacing(true);
  addComponent(searchLayout);
  
  // textfield
  searchField = new TextField();
  searchField.setInputPrompt(i18nManager.getMessage(Messages.PEOPLE_SEARCH));
  searchField.setWidth(180, UNITS_PIXELS);
  searchField.focus();
  searchLayout.addComponent(searchField);
  
  // Logic to change table according to input
  searchField.addListener(new TextChangeListener() {
    public void textChange(TextChangeEvent event) {
      searchPeople(event.getText());
    }
  });
  
  initSelectMyselfButton(searchLayout);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:SelectUsersPopupWindow.java

示例6: buildUI

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
protected void buildUI() {
    ButtonBar buttonBar = new ButtonBar();
    addComponent(buttonBar);

    editor = CommonUiUtils.createAceEditor();
    editor.setTextChangeEventMode(TextChangeEventMode.LAZY);
    editor.setTextChangeTimeout(200);
    editor.setMode(AceMode.text);
    editor.setValue(component.get(TextConstant.SETTING_TEXT));
    editor.addTextChangeListener(new TextChangeListener() {
        public void textChange(TextChangeEvent event) {
            Setting data = component.findSetting(TextConstant.SETTING_TEXT);
            data.setValue(event.getText());
            context.getConfigurationService().save(data);
        }
    });

    addComponent(editor);
    setExpandRatio(editor, 1);
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:21,代码来源:EditTextConstant.java

示例7: buildUI

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
protected void buildUI() {
    ButtonBar buttonBar = new ButtonBar();
    addComponent(buttonBar);

    editor = CommonUiUtils.createAceEditor();
    editor.setTextChangeEventMode(TextChangeEventMode.LAZY);
    editor.setTextChangeTimeout(200);
    editor.setMode(AceMode.xml);
    editor.setValue(component.get(Web.BODY_TEXT));
    editor.addTextChangeListener(new TextChangeListener() {
        public void textChange(TextChangeEvent event) {
            component.put(Web.BODY_TEXT, event.getText());
            context.getConfigurationService().save(component.findSetting(Web.BODY_TEXT));
        }
    });

    addComponent(editor);
    setExpandRatio(editor, 1);
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:20,代码来源:EditWebPanel.java

示例8: textChange

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
@Override
public void textChange(TextChangeEvent event) {
    String newValue = event.getText();
    logger.debug("Text Change Event fired in {} with text = {}", NumericQuestion.class.getSimpleName(), newValue);
    if (isValid(answerField, newValue)) {
        String questionCode = questionDTO.getCode();
        Answer answer = null;
        if (StringUtils.isEmpty(newValue)) {
            answer = NoAnswer.create();
        } else {
            answer = NumericAnswer.fromValue(Integer.parseInt(newValue));
        }
        answerSavedEvent.fire(AnswerSavedEvent.with().questionCode(questionCode).answer(answer).build());
        answerField.setComponentError(null);
    }
}
 
开发者ID:antoniomaria,项目名称:gazpachoquest,代码行数:17,代码来源:NumericQuestion.java

示例9: AutoCompleteTextField

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
public AutoCompleteTextField()
{
	setTextChangeEventMode(TextChangeEventMode.LAZY);
	setImmediate(true);
	addTextChangeListener(new TextChangeListener()
	{
		private static final long serialVersionUID = 1L;

		@Override
		public void textChange(final TextChangeEvent event)
		{
			options.clear();

			if (listener != null)
			{
				listener.handleQuery(AutoCompleteTextField.this, event.getText());
			}

			if (!options.isEmpty())
			{
				createContextMenu();
				showOptionMenu();
			}
		}
	});
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:27,代码来源:AutoCompleteTextField.java

示例10: textChange

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
@Override
public void textChange(TextChangeEvent event) {
	String text = "";
	if(model instanceof Tool) {
		if(isId) {
			text = ((Tool) model).getTitleId(event.getText());
		} else {
			text = ((Tool) model).getTitleDisplayName(event.getText());
		}
		model.getToolEditor().getToolEditorUI().getTreeToolEditor().updateToolTitle(text);
	} else {
		if(!isId && (model.getId() != null && !model.getId().isEmpty())) {
			return;
		}
		if(event.getText().isEmpty() && isId) {
			text = getValue(model.getNameValue()) + " " + getValue(model.getTypeValue());
		} else {
			text = getValue(event.getText()) + " " + getValue(model.getTypeValue());
		}
		model.getToolEditor().getToolEditorUI().getTreeToolEditor().setItemCaption(model, text);
	}
	model.setTitleDescriptionValue(text);
}
 
开发者ID:chipster,项目名称:chipster,代码行数:24,代码来源:CSCTextChangeListener.java

示例11: initializeTextField

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
protected void initializeTextField() {
	//
	// Initialize GUI settings
	//
	this.textFieldFilter.setImmediate(true);
	//
	// Respond to the text change events
	//
	this.textFieldFilter.addTextChangeListener(new TextChangeListener() {
		private static final long serialVersionUID = 1L;
		SimpleStringFilter currentFilter = null;

		@Override
		public void textChange(TextChangeEvent event) {
			//
			// Remove current filter
			//
			if (this.currentFilter != null) {
				FunctionSelectionWindow.highOrderFunctions.removeContainerFilter(this.currentFilter);
				this.currentFilter = null;
			}
			//
			// Get the text
			//
			String value = event.getText();
			if (value != null && value.length() > 0) {
				//
				// Add the new filter
				//
				this.currentFilter = new SimpleStringFilter(PROPERTY_SHORTNAME, value, true, false);
				FunctionSelectionWindow.highOrderFunctions.addContainerFilter(this.currentFilter);
			}
		}
	});
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:36,代码来源:FunctionSelectionWindow.java

示例12: initializeTextField

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
protected void initializeTextField() {
	this.textFieldSubdomain.setRequired(true);
	this.textFieldSubdomain.setRequiredError("Please enter a valid sub domain");
	//
	// Validate the name entered
	//
	this.textFieldSubdomain.addValidator(new RegexpValidator(SUBDOMAIN_NAME_PATTERN, true, ERROR_MESSAGE) {
		private static final long serialVersionUID = 1L;
		
	});
	//
	// Respond to events
	//
	this.textFieldSubdomain.setImmediate(true);
	this.textFieldSubdomain.addTextChangeListener(new TextChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void textChange(TextChangeEvent event) {
			if (event.getText() != null && event.getText().length() > 0) {
				self.buttonSave.setEnabled(true);
			} else {
				self.buttonSave.setEnabled(false);
			}
		}
		
	});
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:29,代码来源:SubDomainEditorWindow.java

示例13: onFilterNameChange

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
private void onFilterNameChange(final TextChangeEvent event) {
    if (isNameAndQueryEmpty(event.getText(), queryTextField.getValue())
            || (event.getText().equals(oldFilterName) && queryTextField.getValue().equals(oldFilterQuery))) {
        saveButton.setEnabled(false);
    } else {
        if (hasSavePermission()) {
            saveButton.setEnabled(true);
        }
    }
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:11,代码来源:CreateOrUpdateFilterHeader.java

示例14: textChange

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
@Override
public void textChange(final TextChangeEvent event) {
    super.valueChange(new ValueChangeEvent() {
        private static final long serialVersionUID = 1L;

        @Override
        public Property<String> getProperty() {
            return new EventHolder(event);
        }

    });

}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:14,代码来源:SpColorPickerPreview.java

示例15: removeTextListener

import com.vaadin.event.FieldEvents.TextChangeEvent; //导入依赖的package包/类
private void removeTextListener(final AbstractField<?> field) {
    if (!(field instanceof TextChangeNotifier)) {
        return;
    }
    for (final Object listener : field.getListeners(TextChangeEvent.class)) {
        if (listener instanceof ChangeListener) {
            ((TextChangeNotifier) field).removeTextChangeListener((ChangeListener) listener);
        }
    }
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:11,代码来源:CommonDialogWindow.java


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