List of usage examples for com.google.gwt.event.logical.shared ValueChangeEvent getValue
public T getValue()
From source file:com.mvp4g.client.history.PlaceService.java
License:Apache License
/** * Called when the History token has changed.<br/> * <br/>//from ww w . j a v a 2 s . c o m * Decode the history token and call the convertFromToken method of the history converters * associated with this action stored in the token.<br/> * <br/> * If token is equal to empty string, ask the event bus to dispatch an initEvent. * * @param event * event containing the new history token * */ public void onValueChange(final ValueChangeEvent<String> event) { confirmEvent(new NavigationEventCommand(module.getEventBus()) { protected void execute() { convertToken(event.getValue()); } }); }
From source file:com.novartis.pcs.ontology.webapp.client.OntoBrowser.java
License:Apache License
@Override public void onValueChange(ValueChangeEvent<String> event) { final String historyToken = event.getValue(); if (historyToken != null && historyToken.length() > 0) { GWT.log("History token: " + historyToken); service.loadTerm(historyToken, new AsyncCallback<Term>() { public void onFailure(Throwable caught) { GWT.log("Failed to load term: " + historyToken, caught); ErrorView.instance().onUncaughtException(caught); }//w ww . ja v a 2s.com public void onSuccess(Term term) { if (term != null) { eventBus.fireEvent(new ViewTermEvent(term)); } } }); } }
From source file:com.objetdirect.gwt.umldrawer.client.HistoryManager.java
License:Open Source License
@Override public void onValueChange(final ValueChangeEvent<String> event) { String historyToken = event.getValue(); UrlParser urlParser = new UrlParser(historyToken); String pageName = urlParser.getPageName(); if (pageName.equals(DRAWER_PAGE)) { DrawerContainer drawerContainer = new DrawerContainer(urlParser); changePage(drawerContainer);// w ww. java2s.c o m forceDrawerResize(drawerContainer); } else if (pageName.equals(START_PAGE)) { changePage(new StartPanel()); } else if (pageName.equals(DEMO_PAGE)) { DrawerContainer drawerContainer = new DrawerContainer(); new Demo(drawerContainer.getUmlCanvas()); changePage(drawerContainer); forceDrawerResize(drawerContainer); } else if (pageName.equals(ANIMATED_PAGE)) { // not working DrawerContainer drawerContainer = new DrawerContainer(); new AnimatedDemo(drawerContainer); changePage(drawerContainer); forceDrawerResize(drawerContainer); } }
From source file:com.pietschy.gwt.pectin.client.binding.ValueModelWithValueBinding.java
License:Apache License
private void onWidgetValueChange(ValueChangeEvent<Boolean> event) { // we only write back to the model if we've been selected. if (event.getValue()) { updateModel(this.value); }//www . java 2 s. co m }
From source file:com.pietschy.gwt.pectin.client.form.metadata.binding.AbstractEnabledBinding.java
License:Apache License
public void onValueChange(ValueChangeEvent<Boolean> event) { updateWidget(event.getValue()); }
From source file:com.pietschy.gwt.pectin.client.form.metadata.binding.MetadataBindingBuilder.java
License:Apache License
public void when(ValueModel<Boolean> condition) { condition.addValueChangeHandler(new ValueChangeHandler<Boolean>() { public void onValueChange(ValueChangeEvent<Boolean> event) { Boolean conditionValue = event.getValue(); configureMetadata(conditionValue != null ? conditionValue : false); }//from ww w.ja v a 2 s . c o m }); Boolean conditionValue = condition.getValue(); configureMetadata(conditionValue != null ? conditionValue : false); }
From source file:com.pietschy.gwt.pectin.demo.client.SimpleHistoryTabs.java
License:Apache License
public SimpleHistoryTabs() { initWidget(tabs);//from w w w . ja va 2s. c o m tabs.addSelectionHandler(tabSelectionHandler); History.addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> event) { selectTabFromToken(event.getValue()); } }); }
From source file:com.ponysdk.core.terminal.ui.PTDatePicker.java
License:Apache License
protected void triggerEvent(final DatePicker picker, final UIBuilder uiService, final ValueChangeEvent<Date> event) { final PTInstruction instruction = new PTInstruction(getObjectID()); instruction.put(ClientToServerModel.HANDLER_DATE_VALUE_CHANGE, event.getValue() != null ? format.format(event.getValue()) : null); uiService.sendDataToServer(picker, instruction); }
From source file:com.ponysdk.ui.terminal.ui.PTCheckBox.java
License:Apache License
protected void addValueChangeHandler(final PTInstruction addHandler, final UIService uiService) { uiObject.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override//from w w w . j a v a 2 s.c om public void onValueChange(final ValueChangeEvent<Boolean> event) { final PTInstruction instruction = new PTInstruction(); instruction.setObjectID(addHandler.getObjectID()); instruction.put(TYPE.KEY, TYPE.KEY_.EVENT); instruction.put(HANDLER.KEY, HANDLER.KEY_.BOOLEAN_VALUE_CHANGE_HANDLER); instruction.put(PROPERTY.VALUE, event.getValue()); uiService.triggerEvent(instruction); } }); }
From source file:com.ponysdk.ui.terminal.ui.PTDatePicker.java
License:Apache License
protected void triggerEvent(final PTInstruction addHandler, final DatePicker picker, final UIService uiService, final ValueChangeEvent<Date> event) { String date;//from w w w. java2 s. c o m int year = -1; int month = -1; int day = -1; if (event.getValue() == null) { date = ""; } else { date = Long.toString(event.getValue().getTime()); final String[] values = format.format(event.getValue()).split("-"); year = Integer.parseInt(values[0]); month = Integer.parseInt(values[1]); day = Integer.parseInt(values[2]); } final PTInstruction instruction = new PTInstruction(); instruction.setObjectID(addHandler.getObjectID()); instruction.put(TYPE.KEY, TYPE.KEY_.EVENT); instruction.put(HANDLER.KEY, HANDLER.KEY_.DATE_VALUE_CHANGE_HANDLER); instruction.put(PROPERTY.VALUE, date); instruction.put(PROPERTY.YEAR, year); instruction.put(PROPERTY.MONTH, month); instruction.put(PROPERTY.DAY, day); uiService.sendDataToServer(picker, instruction); }