List of usage examples for com.google.gwt.dom.client InputElement setDisabled
public void setDisabled(boolean disabled)
From source file:com.cgxlib.xq.client.plugins.widgets.TextBoxBaseWidgetFactory.java
License:Apache License
protected void copyAttributes(Element src, Element dest) { InputElement source = src.cast();//from ww w . j a va 2s . c om InputElement destination = dest.cast(); destination.setAccessKey(source.getAccessKey()); destination.setDefaultValue(source.getDefaultValue()); destination.setDisabled(source.isDisabled()); if (source.getMaxLength() > 0) destination.setMaxLength(source.getMaxLength()); destination.setReadOnly(source.isReadOnly()); destination.setSize(source.getSize()); destination.setName(source.getName()); destination.setValue(source.getValue()); }
From source file:gwtquery.plugins.enhance.client.gwt.CheckBoxWidgetFactory.java
License:Apache License
protected void copyAttributes(InputElement source, InputElement destination) { destination.setAccessKey(source.getAccessKey()); destination.setDisabled(source.isDisabled()); destination.setSize(source.getSize()); destination.setName(source.getName()); destination.setValue(source.getValue()); }
From source file:gwtquery.plugins.enhance.client.gwt.RadioButtonWidgetFactory.java
License:Apache License
protected void copyAttributes(InputElement source, InputElement destination) { destination.setAccessKey(source.getAccessKey()); destination.setDisabled(source.isDisabled()); destination.setSize(source.getSize()); destination.setValue(source.getValue()); }
From source file:gwtquery.plugins.enhance.client.gwt.TextBoxBaseWidgetFactory.java
License:Apache License
protected void copyAttributes(Element src, Element dest) { InputElement source = src.cast();//from w ww. j a v a 2 s . co m InputElement destination = dest.cast(); destination.setAccessKey(source.getAccessKey()); destination.setDefaultValue(source.getDefaultValue()); destination.setDisabled(source.isDisabled()); if (source.getMaxLength() > 0) destination.setMaxLength(source.getMaxLength()); destination.setReadOnly(source.isReadOnly()); destination.setSize(source.getSize()); destination.setName(source.getName()); destination.setValue(source.getValue()); }
From source file:org.drools.workbench.screens.scenariosimulation.client.collectioneditor.PropertyPresenter.java
License:Apache License
@Override public LIElement getPropertyFields(String itemId, String propertyName, String propertyValue) { final PropertyView propertyEditorView = viewsProvider.getPropertyEditorView(); String hashedPropertyName = "#" + propertyName; final SpanElement propertyNameSpan = propertyEditorView.getPropertyName(); setSpanAttributeAttributes(propertyName, hashedPropertyName, "propertyName" + hashedPropertyName, propertyNameSpan);//from w ww.j a va 2s . co m final SpanElement propertyValueSpan = propertyEditorView.getPropertyValueSpan(); setSpanAttributeAttributes(propertyName, propertyValue, "propertyValue" + hashedPropertyName, propertyValueSpan); propertySpanElementMap.put(propertyName, propertyValueSpan); final InputElement propertyValueInput = propertyEditorView.getPropertyValueInput(); propertyValueInput.setAttribute("placeholder", hashedPropertyName); propertyValueInput.setAttribute("data-field", "propertyValue" + hashedPropertyName); propertyValueInput.setDisabled(true); propertyValueInput.getStyle().setDisplay(Style.Display.NONE); final LIElement propertyFields = propertyEditorView.getPropertyFields(); propertyFields.setAttribute("data-field", "propertyFields" + hashedPropertyName); if (propertyViewMap.containsKey(itemId)) { propertyViewMap.get(itemId).add(propertyEditorView); } else { List<PropertyView> toPut = new ArrayList<>(); toPut.add(propertyEditorView); propertyViewMap.put(itemId, toPut); } return propertyFields; }
From source file:org.opencms.ugc.client.CmsUgcWrapper.java
License:Open Source License
/** * Disables all file input fields except the one with the given name.<p> * * @param fieldNames the set of names of fields that should not be disabled *///from w w w .j a v a 2 s . c om void disableAllFileFieldsExcept(Set<String> fieldNames) { for (InputElement field : getAllFields()) { if (isFileField(field)) { boolean shouldDisable = !fieldNames.contains(field.getName()); field.setDisabled(shouldDisable); } } }
From source file:org.opencms.ugc.client.CmsUgcWrapper.java
License:Open Source License
/** * Enables all file input fields.<p> *//*w w w .ja va2s .c om*/ void enableAllFileFields() { for (InputElement field : getAllFields()) { if (isFileField(field)) { field.setDisabled(false); } } }
From source file:ru.codeinside.gses.vaadin.client.VJsonFormIntegration.java
License:Mozilla Public License
private Frame createFrameWrap() { if (browserElement == null) { return null; }// w w w.ja v a 2 s. c o m Frame frameWrap = Frame.wrap(browserElement); frameWrap.addLoadHandler(new LoadHandler() { @Override public void onLoad(LoadEvent event) { Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() { @Override public boolean execute() { IFrameElement formFrame = IFrameElement.as(browserElement); Document formDoc = formFrame.getContentDocument(); if (formDoc == null) { return true; } NodeList<com.google.gwt.dom.client.Element> elements; elements = formDoc.getElementsByTagName("input"); for (int i = 0; i < elements.getLength(); i++) { InputElement input = InputElement.as(elements.getItem(i)); if ("button".equalsIgnoreCase(input.getType())) { input.setDisabled(true); } else { input.setReadOnly(true); } } elements = formDoc.getElementsByTagName("button"); for (int i = 0; i < elements.getLength(); i++) { ButtonElement button = ButtonElement.as(elements.getItem(i)); button.setDisabled(true); } elements = formDoc.getElementsByTagName("select"); for (int i = 0; i < elements.getLength(); i++) { SelectElement select = SelectElement.as(elements.getItem(i)); select.setDisabled(true); } elements = formDoc.getElementsByTagName("textarea"); for (int i = 0; i < elements.getLength(); i++) { TextAreaElement textArea = TextAreaElement.as(elements.getItem(i)); textArea.setReadOnly(true); } return false; } }, 99); } }); return frameWrap; }