use of com.extjs.gxt.ui.client.event.KeyListener in project activityinfo by bedatadriven.
the class LocationForm method addNameField.
private void addNameField() {
nameField = new TextField<String>();
nameField.setFieldLabel(locationType.getName());
nameField.setMaxLength(50);
add(nameField);
nameField.addKeyListener(new KeyListener() {
@Override
public void componentKeyDown(ComponentEvent event) {
nameTypeAheadTimer.schedule(200);
}
});
}
use of com.extjs.gxt.ui.client.event.KeyListener in project geo-platform by geosdi.
the class GPSecurityWidget method createBasicComponents.
private void createBasicComponents() {
FormLayout layout = new FormLayout();
layout.setLabelWidth(90);
layout.setDefaultWidth(180);
setLayout(layout);
setButtonAlign(HorizontalAlignment.LEFT);
setButtons("");
setIcon(AbstractImagePrototype.create(BasicWidgetResources.ICONS.search()));
setHeadingText(BasicWidgetConstants.INSTANCE.GPSecurityWidget_headingText());
setModal(true);
setBodyBorder(true);
setBodyStyle("padding: 8px;background: none");
setWidth(330);
setResizable(false);
setClosable(false);
KeyListener keyListener = new KeyListener() {
@Override
public void componentKeyPress(ComponentEvent event) {
if (event.getKeyCode() == KeyCodes.KEY_ENTER && login.isEnabled()) {
onSubmit();
}
}
@Override
public void componentKeyUp(ComponentEvent event) {
validate();
}
};
userName = new GPSecureStringTextField();
userName.setFieldLabel(BasicWidgetConstants.INSTANCE.GPSecurityWidget_usernameText());
// userName.setValue("admin");
userName.addKeyListener(keyListener);
add(userName);
password = new GPSecureStringTextField();
password.setPassword(true);
password.setFieldLabel(BasicWidgetConstants.INSTANCE.GPSecurityWidget_passwordText());
// password.setValue("admin");
password.addKeyListener(keyListener);
add(password);
setFocusWidget(userName);
}
use of com.extjs.gxt.ui.client.event.KeyListener in project geo-platform by geosdi.
the class GeocodingTextFieldProvider method get.
@Override
public GPSecureStringTextField get() {
final GPSecureStringTextField geocoding = new GPSecureStringTextField();
geocoding.setFieldLabel("Find");
geocoding.setEmptyText(this.wfstWidgetConstants.searchAddressLabel());
geocoding.addKeyListener(new KeyListener() {
@Override
public void componentKeyUp(ComponentEvent event) {
if (((event.getKeyCode() == KeyCodes.KEY_BACKSPACE) || (event.getKeyCode() == KeyCodes.KEY_DELETE)) && (geocoding.getValue() == null)) {
GeocodingHandlerManager.fireEvent(REMOVE_MARKER_EVENT);
GeocodingHandlerManager.fireEvent(CLEAR_GEOCODING_GRID_EVENT);
eventBus.fireEvent(WFS_ZOOM_EVENT);
}
}
@Override
public void componentKeyPress(ComponentEvent event) {
if ((event.getKeyCode() == KeyCodes.KEY_ENTER) && (!geocoding.getValue().equals(""))) {
GeocodingHandlerManager.fireEvent(MASK_GEOCODING_GRID_EVENT);
geocodingDelegate.searchAddress(new GPGeocodingAddressRequestDTO(LocaleInfo.getCurrentLocale().getLocaleName(), geocoding.getValue()));
}
}
});
return geocoding;
}
use of com.extjs.gxt.ui.client.event.KeyListener in project geo-platform by geosdi.
the class GenericRoutingSearchPoint method setWidgetProperties.
/**
* (non-Javadoc)
*
* @see
* org.geosdi.geoplatform.gui.client.widget.search.ComboSearchWidget#setWidgetProperties()
*/
@Override
public void setWidgetProperties() {
this.combo.setDisplayField(GeocodingKeyValue.DESCRIPTION.getValue());
this.combo.setHideTrigger(true);
this.combo.setUseQueryCache(false);
this.combo.setWidth(200);
this.combo.addKeyListener(new KeyListener() {
@Override
public void componentKeyPress(ComponentEvent event) {
if ((event.getKeyCode() == KeyCodes.KEY_ENTER) && (combo.getRawValue().length() >= 4) && (combo.getSelection().isEmpty())) {
dispatchRequest();
}
}
});
}
use of com.extjs.gxt.ui.client.event.KeyListener in project geo-platform by geosdi.
the class GPKmlWidget method addListenerToUrlText.
private void addListenerToUrlText() {
urlText.addListener(Events.OnPaste, new Listener() {
@Override
public void handleEvent(BaseEvent be) {
if (checkUrl()) {
urlText.clearInvalid();
verifyUrl(false);
} else {
buttonPreview.disable();
urlText.forceInvalid(suggestion);
}
}
});
urlText.addKeyListener(new KeyListener() {
@Override
public void componentKeyUp(ComponentEvent event) {
if (urlText.getValue() == null) {
if ((event.getKeyCode() == KeyCodes.KEY_BACKSPACE) || (event.getKeyCode() == KeyCodes.KEY_DELETE)) {
reset();
}
} else {
if (checkUrl()) {
urlText.clearInvalid();
verifyUrl(false);
} else {
buttonPreview.disable();
urlText.forceInvalid(suggestion);
}
}
}
@Override
public void componentKeyPress(ComponentEvent event) {
if ((event.getKeyCode() == KeyCodes.KEY_ENTER) && checkUrl()) {
verifyUrl(true);
}
}
});
}
Aggregations