@Inject public MoveViewImpl( JavaLocalizationConstant locale, CellTreeResources cellTreeResources, JavaResources resources) { this.locale = locale; this.cellTreeResources = cellTreeResources; this.resources = resources; setTitle(locale.moveDialogTitle()); setWidget(UI_BINDER.createAndBindUi(this)); createButtons(locale); updateFullNames.addValueChangeHandler( new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { patternField.setEnabled(event.getValue()); } }); }
public TeachingAssignmentsWidget() { iHeader = new UniTimeHeaderPanel(MESSAGES.sectTeachingAssignments()); iHeader.addCollapsibleHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { InstructorCookie.getInstance().setShowTeachingAssignments(event.getValue()); if (iTable != null) { iTable.setVisible(event.getValue()); } else if (event.getValue()) { refresh(); } } }); iHeader.setCollapsible(InstructorCookie.getInstance().isShowTeachingAssignments()); iHeader.setTitleStyleName("unitime3-HeaderTitle"); removeStyleName("unitime-NotPrintableBottomLine"); addHeaderRow(iHeader); iHeader.getElement().getStyle().setMarginTop(10, Unit.PX); }
public void setInstructors(List<InstructorInterface> instructors) { iInstructors.clearTable(1); iInstructors.resetVisibility(); iHeader.clearMessage(); ValueChangeHandler<Boolean> clearErrorMessage = new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { iHeader.clearMessage(); } }; if (instructors != null) for (InstructorInterface i: instructors) { int row = iInstructors.addInstructor(i); boolean selected = i.hasAttribute(iAttribute.getId()); iInstructors.selectInstructor(row, selected); iInstructors.setSelected(row, selected); iInstructors.getInstructorSelection(row).addValueChangeHandler(clearErrorMessage); } int sort = InstructorCookie.getInstance().getSortInstructorsBy(); if (sort != 0) iInstructors.setSortBy(sort); iInstructors.setVisible(iInstructors.getRowCount() > 1); }
Item(T id, String name, boolean asHTML) { super(name, asHTML); iId = id; addStyleName("item"); addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { ValueChangeEvent.fire(MultiSelect.this, MultiSelect.this.getValue()); } }); }
public void setRooms(List<Entity> rooms) { iRooms.clearTable(1); iHeader.clearMessage(); ValueChangeHandler<Boolean> clearErrorMessage = new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { iHeader.clearMessage(); } }; for (Entity e: rooms) { RoomDetailInterface room = (RoomDetailInterface)e; int row = iRooms.addRoom(room); boolean selected = room.hasGroup(iGroup.getId()); iRooms.selectRoom(row, selected); iRooms.setSelected(row, selected); iRooms.getRoomSelection(row).addValueChangeHandler(clearErrorMessage); } int sort = RoomCookie.getInstance().getRoomsSortBy(); if (sort != 0) iRooms.setSortBy(sort); }
public void setRooms(List<Entity> rooms) { iRooms.clearTable(1); iHeader.clearMessage(); ValueChangeHandler<Boolean> clearErrorMessage = new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { iHeader.clearMessage(); } }; for (Entity e: rooms) { RoomDetailInterface room = (RoomDetailInterface)e; int row = iRooms.addRoom(room); boolean selected = room.hasFeature(iFeature.getId()); iRooms.selectRoom(row, selected); iRooms.setSelected(row, selected); iRooms.getRoomSelection(row).addValueChangeHandler(clearErrorMessage); } int sort = RoomCookie.getInstance().getRoomsSortBy(); if (sort != 0) iRooms.setSortBy(sort); }
public void setRooms(List<Entity> rooms, Integer sortBy) { iRooms.clearTable(1); iHeader.clearMessage(); ValueChangeHandler<Boolean> clearErrorMessage = new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { iHeader.clearMessage(); } }; for (Entity e: rooms) { RoomDetailInterface room = (RoomDetailInterface)e; int row = iRooms.addRoom(room); boolean selected = false; if (iDepartment != null) { selected = (room.getDepartment(iDepartment.getId()) != null); } else if (iExamType != null) { selected = (room.getExamType(iExamType.getId()) != null); } iRooms.selectRoom(row, selected); iRooms.setSelected(row, selected); iRooms.getRoomSelection(row).addValueChangeHandler(clearErrorMessage); } if (sortBy != null) iRooms.setSortBy(sortBy); }
public PeriodPreferencesWidget(boolean editable) { iEditable = editable; iPanel = new AbsolutePanel(); iHorizontal = new CheckBox(MESSAGES.periodPreferenceHorizontal()); iHorizontal.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { RoomCookie.getInstance().setHorizontal(iHorizontal.getValue()); render(); } }); initWidget(iPanel); }
public PageFilter() { addStyleName("unitime-PageFilter"); iHeader = new UniTimeHeaderPanel(MESSAGES.sectFilter()); iHeader.setCollapsible(true); iHeader.addCollapsibleHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { for (int row: iCollapsibleRows) { getRowFormatter().setVisible(row, event.getValue()); } } }); iFilterHeaderRow = addHeaderRow(iHeader); iFilterLastRow = iFilterHeaderRow; iFooter = iHeader.clonePanel(null); }
public static AriaSuggestBox insert(RootPanel panel) { String config = panel.getElement().getAttribute("configuration"); final String onchange = panel.getElement().getAttribute("onchange"); AriaTextBox text = new AriaTextBox(panel.getElement().getFirstChildElement()); text.getElement().setAttribute("autocomplete", "off"); AriaSuggestBox box = new AriaSuggestBox(text, new CourseNumbersSuggestBox(config)); if (onchange != null) box.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { ToolBox.eval(onchange); } }); panel.add(box); return box; }
public static void peopleLookup(String query, final JavaScriptObject callback, String options) { final Lookup lookup = new Lookup(); if (query != null && !query.trim().isEmpty()) lookup.setQuery(query); lookup.addValueChangeHandler(new ValueChangeHandler<PersonInterface>() { @Override public void onValueChange(ValueChangeEvent<PersonInterface> event) { if (event.getValue() != null) lookup.fireCallback(callback, event.getValue().getId(), event.getValue().getFirstName(), event.getValue().getMiddleName(), event.getValue().getLastName(), event.getValue().getEmail(), event.getValue().getPhone(), event.getValue().getAcademicTitle(), event.getValue().getName()); } }); lookup.setOptions(options); lookup.center(); }
private void addCourseLine() { int i = iCourses.size(); final CourseRequestLine line = new CourseRequestLine(iSessionProvider, i, false, iCheckForDuplicities); iCourses.add(line); CourseRequestLine prev = iCourses.get(i - 1); prev.getCourses().get(0).setHint(""); line.getCourses().get(0).setHint(MESSAGES.courseRequestsHint8()); CourseRequestLine next = iAlternatives.get(0); line.setPrevious(prev); prev.setNext(line); line.setNext(next); next.setPrevious(line); line.setArrowsVisible(iArrowsVisible); line.setWaitListVisible(iCanWaitList); insert(line, 1 + i); line.addValueChangeHandler(new ValueChangeHandler<CourseRequestInterface.Request>() { @Override public void onValueChange(ValueChangeEvent<Request> event) { if (event.getValue() != null && iCourses.indexOf(line) + 1 == iCourses.size()) addCourseLine(); } }); }
private void addAlternativeLine() { int i = iAlternatives.size(); final CourseRequestLine line = new CourseRequestLine(iSessionProvider, i, true, iCheckForDuplicities); iAlternatives.add(line); CourseRequestLine prev = iAlternatives.get(i - 1); line.setPrevious(prev); prev.setNext(line); line.setArrowsVisible(iArrowsVisible); insert(line, 3 + iCourses.size() + i); line.addValueChangeHandler(new ValueChangeHandler<CourseRequestInterface.Request>() { @Override public void onValueChange(ValueChangeEvent<Request> event) { if (event.getValue() != null && iAlternatives.indexOf(line) + 1 == iAlternatives.size()) addAlternativeLine(); } }); }
@Override protected ValueChangeHandler<Boolean> getSelectChangeHandler() { return new ValueChangeHandler<Boolean>() { @Override public void onValueChange(final ValueChangeEvent<Boolean> event) { if (event.getValue()) { setActive(true); basicToolBar.setAnchorVisible(true); basicToolBar.setAnchorColor(GREEN); basicToolBar.setWhat3Words(""); createW3wLayer(); } else { setActive(false); basicToolBar.setAnchorVisible(false); basicToolBar.setAnchorColor(RED); } } }; }
public void initializeWMTSFields() { urlWMTSField.setEmptyText("http://..."); nameWMTSField.setEmptyText(UIMessages.INSTANCE .lrasterdLayerNameField("WMTS")); formatWMTSField.setEmptyText("image/png, image/jpg..."); tileMatrixSetField.setEmptyText("matrix set identifier"); urlWMTSField.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { if (!event.getValue().startsWith("http")) { showAlert("URL"); } } }); }
private VerticalPanel getFoot() { slider.setWidth("290px"); slider.disable(); slider.setIncrement(1); slider.addValueChangeHandler(new ValueChangeHandler<Integer>() { @Override public void onValueChange(final ValueChangeEvent<Integer> event) { final Layer layer = getSelectedLayer(getSelectedTabName()); layer.setOpacity((float) (event.getValue().intValue() / 100.0)); } }); final VerticalPanel panel = new VerticalPanel(); panel.setWidth("300px"); panel.addStyleName(ThemeStyles.get().style().borderTop()); panel.add(new HTML(UIMessages.INSTANCE.lmOpacityHtmlLabel())); panel.add(slider); panel.add(statusBar); return panel; }
/** * Helper method called by constructor to initialize the app's title section * @param container The container that title resides */ private void initAppTitle(Panel container) { if (newOrUpdateApp()) { // GUI for editable title container if (editStatus==NEWAPP) { // If it's new app, give a textual hint telling user this is title titleText.setText(app.getTitle()); } else if (editStatus==UPDATEAPP) { // If it's not new, just set whatever's in the data field already titleText.setText(app.getTitle()); } titleText.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { app.setTitle(titleText.getText()); } }); titleText.addStyleName("app-desc-textarea"); container.add(titleText); container.addStyleName("app-title-container"); } else { Label title = new Label(app.getTitle()); title.addStyleName("app-title"); container.add(title); } }
/** * Helper method called by constructor to initialize the app's description * @param c1 The container that description resides (editable state) * @param c2 The container that description resides (public state) */ private void initAppDesc(Panel c1, Panel c2) { desc.getElement().setPropertyString("placeholder", MESSAGES.galleryDescriptionHint()); if (newOrUpdateApp()) { desc.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { app.setDescription(desc.getText()); } }); if(editStatus==UPDATEAPP){ desc.setText(app.getDescription()); } desc.addStyleName("app-desc-textarea"); c1.add(desc); } else { Label description = new Label(app.getDescription()); c2.add(description); c2.addStyleName("app-description"); } }
public LASAnnotationsButtonPanelImpl(String outputPanelID) { setName(outputPanelID); String moduleBaseURL = GWT.getModuleBaseURL(); String upImageURL = moduleBaseURL + "../images/i_off.png"; Image upImage = new Image(upImageURL); String downImageURL = moduleBaseURL + "../images/i_on.png"; Image downImage = new Image(downImageURL); button = new ToggleButton( upImage, downImage); button.setTitle("Plot Annotations"); button.setStylePrimaryName("OL_MAP-ToggleButton"); button.addStyleDependentName("WIDTH"); button.addValueChangeHandler(new ValueChangeHandler<Boolean>() { public void onValueChange(ValueChangeEvent<Boolean> event) { annotations.setVisible(button.isDown()); } }); initWidget(button); }
/** * Commonly we start to listen history changes when webclient starts calling this * method. If you are using wave client integrated with other different GWT application * and with a different History management, you can avoid to use this and just * call to the {@link WaveSelectionEvent} events (for example) or other uses. */ public static void init() { History.addValueChangeHandler( new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { String encodedToken = event.getValue(); if (encodedToken == null || encodedToken.length() == 0) { return; } WaveRef waveRef; try { waveRef = GwtWaverefEncoder.decodeWaveRefFromPath(encodedToken); } catch (InvalidWaveRefException e) { LOG.error().log("History token contains invalid path: " + encodedToken); return; } LOG.trace().log("Changing selected wave based on history event to " + waveRef.toString()); ClientEvents.get().fireEvent( new WaveSelectionEvent(waveRef, false, false)); } }); }
public void refresh() { final EditorUpdateEventImpl updates = editor.debugGetUpdateEventImpl(); updateEventsPanel.clear(); updates.debugGetAllUpdateEventNames().each(new Proc() { @Override public void apply(final String element) { addCheckBox(updateEventsPanel, element, !updates.debugGetSuppressedUpdateEventNames().contains(element), new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { updates.debugSuppressUpdateEvent(element, !event.getValue()); } }); } }); }
/** * To add Text Box. * * @param row int * @param value String * @param dataType DataType * @param readOnly boolean * @return ValidatableWidget<TextBox> */ public ValidatableWidget<TextBox> addTextBox(int row, String value, DataType dataType, boolean readOnly) { TextBox fieldValue = new TextBox(); fieldValue.setReadOnly(readOnly); fieldValue.setText(value); final ValidatableWidget<TextBox> validatableTextBox = new ValidatableWidget<TextBox>(fieldValue); if (!readOnly) { validatableTextBox.addValidator((Validator) ValidatorFactory.getValidator(dataType, fieldValue)); validatableTextBox.getWidget().addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { validatableTextBox.toggleValidDateBox(); } }); validatableTextBox.toggleValidDateBox(); } return validatableTextBox; }
private void setKeyPatternPanelView() { keyPatternText = new TextBox(); keyPatternText.addStyleName(AdminConstants.GWT_ADVANCED_KV_TEXT_BOX); keyPatternField = new ListBox(); keyPatternField.setWidth("98%"); keyPatternPanel.add(keyPatternText); useExistingKey.setValue(Boolean.FALSE); useExistingKey.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> arg0) { if (arg0.getValue().equals(Boolean.TRUE)) { keyPatternValidateButton.setEnabled(Boolean.FALSE); keyPatternPanel.remove(keyPatternText); keyPatternPanel.add(keyPatternField); } else { keyPatternValidateButton.setEnabled(Boolean.TRUE); keyPatternPanel.remove(keyPatternField); keyPatternPanel.add(keyPatternText); } } }); }
public FieldsEditor(ApiService service, String key) { super(""); this.service = service; this.key = key; root = new CheckBox(key.isEmpty() ? "Select all/none" : key); root.setValue(false); root.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { for (HasValue<Boolean> checkBox : children.values()) { checkBox.setValue(event.getValue(), true); } } }); add(root); }
public FilterPanel(String title) { super(); addStyleName(Utils.sandboxStyle.navPrimary()); UnorderedList headerUl = new UnorderedList(); headerUl.addStyleName(Utils.sandboxStyle.nav()); add(headerUl); headerItem = new FilterItem<T>(null, Utils.resources.collapse(), null, title); headerItem.addStyleName(Utils.sandboxStyle.primary()); headerItem.setValue(false); headerUl.add(headerItem); headerItem.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { sendAnalytic(); setExpanded(event.getValue()); } }); itemsUl = new UnorderedList(); itemsUl.addStyleName(Utils.sandboxStyle.nav()); headerItem.add(itemsUl); }
private WgtTokenQty createWgt(final TokenType p_tokenType) { WgtTokenQty wgt = new WgtTokenQty( p_tokenType, GameEngine.model().getGame() .getInitialHolds().get( p_tokenType ) ); wgt.setEnabled( true ); wgt.addValueChangeHandler( new ValueChangeHandler<Integer>() { @Override public void onValueChange(ValueChangeEvent<Integer> p_event) { GameEngine.model().getGame().setInitialHoldsQty( p_tokenType, p_event.getValue() ); } } ); return wgt; }
@Override public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler) { // Initialization code if (!valueChangeHandlerInitialized) { valueChangeHandlerInitialized = true; super.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { ValueChangeEvent.fire(EnumListBox.this, getValue()); } }); } return addHandler(handler, ValueChangeEvent.getType()); }
@Override public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler) { // Initialization code if (!valueChangeHandlerInitialized) { valueChangeHandlerInitialized = true; super.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { ValueChangeEvent.fire(SelectOneListBox.this, getValue()); } }); } return addHandler(handler, ValueChangeEvent.getType()); }
public RequestedServiceToggle(EventServiceProviderInterface provider) { super("toggle"); iProvider = provider; iCheckbox = new CheckBox(provider.getLabel()); add(iCheckbox); if (provider.hasMessage()) { iDescription = new P("description"); iDescription.setHTML(provider.getMessage()); iCheckbox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { iDescription.setVisible(event.getValue()); } }); iDescription.setVisible(false); add(iDescription); } }
@Override public Widget widget(final PropertyEditorFieldInfo property) { final PropertyEditorCheckBox checkBox = GWT.create(PropertyEditorCheckBox.class); checkBox.setValue(Boolean.parseBoolean(property.getCurrentStringValue())); checkBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { if (validate(property, checkBox.getValue().toString())) { checkBox.clearOldValidationErrors(); property.setCurrentStringValue(checkBox.getValue().toString()); propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property, checkBox.getValue().toString())); } else { checkBox.setValidationError(getValidatorErrorMessage(property, checkBox.getValue().toString())); checkBox.setValue(Boolean.valueOf(property.getCurrentStringValue())); } } }); return checkBox; }
private void reinitSingleSearchMethod(Set <SpacialType> spacialTypes) { singleSearchMethodWrapper.clear(); String prevValue= singleSearchMethod!=null ? singleSearchMethod.getValue() : null; EnumFieldDef fd= (EnumFieldDef)FieldDefCreator.makeFieldDef(_prop.makeBase("singleTargetMethod")); if (!spacialTypes.contains(Cone)) { fd.removeItem(CONE_KEY); if (CONE_KEY.equals(prevValue)) prevValue= null; } if (!spacialTypes.contains(Box)) { fd.removeItem(BOX_KEY); if (BOX_KEY.equals(prevValue)) prevValue= null; } if (!spacialTypes.contains(Elliptical)) { fd.removeItem(ELLIPTICAL_KEY); if (ELLIPTICAL_KEY.equals(prevValue)) prevValue= null; } singleSearchMethod = SimpleInputField.createByDef(fd, new SimpleInputField.Config("1px"), false); singleSearchMethod.getField().addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent ev) { updateSingleTargetDisplay(); } }); singleSearchMethodWrapper.setWidget(singleSearchMethod); if (prevValue!=null) singleSearchMethod.setValue(prevValue); }
@Override public Widget widget(final PropertyEditorFieldInfo property) { final PropertyEditorColorPicker colorPicker = GWT.create(PropertyEditorColorPicker.class); colorPicker.setValue(property.getCurrentStringValue()); colorPicker.addChangeHandler( new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent event) { String color = colorPicker.getValue(); if (validate(property, color)) { colorPicker.clearOldValidationErrors(); property.setCurrentStringValue(color); propertyEditorChangeEvent.fire(new PropertyEditorChangeEvent(property, color)); } else { colorPicker.setValidationError(getValidatorErrorMessage(property, color)); colorPicker.setValue(property.getCurrentStringValue()); } } }); return colorPicker; }