本文整理匯總了Java中com.vaadin.client.communication.StateChangeEvent類的典型用法代碼示例。如果您正苦於以下問題:Java StateChangeEvent類的具體用法?Java StateChangeEvent怎麽用?Java StateChangeEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StateChangeEvent類屬於com.vaadin.client.communication包,在下文中一共展示了StateChangeEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: extend
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
protected void extend(ServerConnector serverConnector) {
serverConnector.addStateChangeHandler(new StateChangeEvent.StateChangeHandler() {
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
updateResetButtonVisibility();
}
});
}
});
textField = (VTextField) ((ComponentConnector) serverConnector).getWidget();
textField.addStyleName(CLASSNAME + "-textfield");
resetButtonElement = DOM.createDiv();
resetButtonElement.addClassName(CLASSNAME + "-resetbutton");
textField.addAttachHandler(this);
textField.addKeyUpHandler(this);
}
示例2: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
getWidget().captionManagedByLayout = getState().captionManagedByLayout;
super.onStateChanged(stateChangeEvent);
if (!getWidget().captionManagedByLayout
&& isContextHelpIconEnabled()) {
if (getWidget().contextHelpIcon == null) {
getWidget().contextHelpIcon = DOM.createSpan();
getWidget().contextHelpIcon.setInnerHTML("?");
getWidget().contextHelpIcon.setClassName(CONTEXT_HELP_CLASSNAME);
Roles.getTextboxRole().setAriaHiddenState(getWidget().contextHelpIcon, true);
getWidget().getElement().appendChild(getWidget().contextHelpIcon);
DOM.sinkEvents(getWidget().contextHelpIcon, VTooltip.TOOLTIP_EVENTS | Event.ONCLICK);
} else {
getWidget().contextHelpIcon.getStyle().clearDisplay();
}
} else if (getWidget().contextHelpIcon != null) {
getWidget().contextHelpIcon.getStyle()
.setDisplay(Style.Display.NONE);
getWidget().setAriaInvalid(false);
}
}
示例3: extend
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
protected void extend(ServerConnector serverConnector) {
serverConnector
.addStateChangeHandler(new StateChangeEvent.StateChangeHandler() {
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
Scheduler.get().scheduleDeferred(
new Scheduler.ScheduledCommand() {
@Override
public void execute() {
updateResetButtonVisibility();
}
});
}
});
textField = (VTextField) ((ComponentConnector) serverConnector)
.getWidget();
textField.addStyleName(CLASSNAME + "-textfield");
resetButtonElement = DOM.createDiv();
resetButtonElement.addClassName(CLASSNAME + "-resetbutton");
textField.addAttachHandler(this);
textField.addKeyUpHandler(this);
}
示例4: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(final StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
getWidget().setHorizontalScrollingEnabled(getState().horizontalScrollingEnabled);
getWidget().setVerticalScrollingEnabled(getState().verticalScrollingEnabled);
getWidget().setVerticalScrollPosition(getState().scrollTop);
getWidget().setHorizontalScrollPosition(getState().scrollLeft);
if (getState().scrollTop != getWidget().getVerticalScrollPosition()) {
// Sizes are not yet up to date, so changing the scroll position
// is deferred to after the layout phase
uidlScrollTop = getState().scrollTop;
}
if (getState().scrollLeft != getWidget().getHorizontalScrollPosition()) {
// Sizes are not yet up to date, so changing the scroll position
// is deferred to after the layout phase
uidlScrollLeft = getState().scrollLeft;
}
}
示例5: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
if (!(getParent() instanceof StepConnector)) {
return;
}
if (step == null) {
step = ((StepConnector) getParent()).getWidget();
getWidget().setOwner(step);
}
if (stateChangeEvent.hasPropertyChanged("step")) {
getWidget().setStep(getState().step);
}
if (!getWidget().getElement().hasParentElement()) {
step.add(getWidget());
getWidget().getOwner().updateStylesForSubSteps();
}
getWidget().updateWidth();
}
示例6: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
// Only add a mouse move handler if someone is interested in, as
// otherwise
// they would generate a large amount of server side traffic.
if (stateChangeEvent.hasPropertyChanged("listenMouseMove")
&& getState().listenMouseMove)
getWidget().addMouseMoveHandler(new MouseMoveHandler() {
@Override
public void onMouseMove(MouseMoveEvent event) {
if (getState().listenMouseMove) {
MouseEventDetails med = MouseEventDetailsBuilder
.buildMouseEventDetails(event.getNativeEvent(),
getWidget().getElement());
rpc.mouseMoved(med);
}
}
});
}
示例7: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
if (stateChangeEvent.hasPropertyChanged("timeFormat")) {
getWidget().setTimeFormat(getState().timeFormat);
}
if (stateChangeEvent.hasPropertyChanged("updateInterval")) {
getWidget().setUpdateInterval(getState().updateInterval);
}
if (stateChangeEvent.hasPropertyChanged("timer")) {
getWidget().registerTimer(getState().timer);
}
}
示例8: extend
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
protected void extend(ServerConnector target) {
target.addStateChangeHandler(new StateChangeEvent.StateChangeHandler() {
private static final long serialVersionUID = -8439729365677484553L;
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
updateResetButtonVisibility();
}
});
}
});
textField = (VTextField) ((ComponentConnector) target).getWidget();
textField.addStyleName(CLASSNAME + "-textfield");
resetButtonElement = DOM.createDiv();
resetButtonElement.addClassName(CLASSNAME + "-resetbutton");
textField.addAttachHandler(this);
textField.addKeyUpHandler(this);
}
示例9: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
if (fullscreenTarget != getState().fullscreenTarget) {
if (getState().fullscreenTarget == null) {
fullscreenTarget = null;
} else {
fullscreenTarget = ((AbstractComponentConnector) (getState().fullscreenTarget))
.getWidget().getElement();
}
notifyStateChange();
}
if (!FSButtonUtil.isFullscreenSupported(Document.get().getBody())) {
if (getState().hideIfNotSupported) {
getWidget().setVisible(false);
}
}
}
示例10: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
getWidget().setText(getState().caption);
switch (getState().myHorizontalAlignment) {
case LEFT:
getWidget().setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
break;
case CENTER:
getWidget().setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
break;
case RIGHT:
getWidget().setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
break;
}
}
示例11: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
getWidget().setButtonsVisible(getState().showButtons);
int numberOfValues = getState().values.size();
getWidget().setValueAmount(numberOfValues);
for (int i = 0; i < numberOfValues; ++i) {
getWidget().setValuePresentation(i, getState().values.get(i),
getState().valuesInHTML);
}
if (getState().currentValue != null) {
getWidget().setValue(getState().currentValue);
} else {
VConsole.error("Current value missing");
}
}
示例12: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
getWidget().setCaption(getState().caption);
if (getState().getLeftComponent() != null) {
Widget leftWidget = ((ComponentConnector) getState()
.getLeftComponent()).getWidget();
getWidget().setLeftWidget(leftWidget);
}
if (getState().getRightComponent() != null) {
Widget rightWidget = ((ComponentConnector) getState()
.getRightComponent()).getWidget();
getWidget().setRightWidget(rightWidget);
}
}
示例13: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
DatePicker.Resolution resolution = convertResolution(getState().resolution);
try {
dateTimeService.setLocale(getState().locale);
} catch (LocaleNotLoadedException e) {
Logger.getLogger(DatePickerConnector.class.getName()).log(
Level.SEVERE,
"Tried to use an unloaded locale \"" + getState().locale);
}
formatString = getFormatString(resolution, getState().locale);
getWidget().setUseNative(getState().useNative);
getWidget().setResolution(resolution);
getWidget().setDate(parseDateInWireFormat(getState().date));
getWidget().setMin(parseDateInWireFormat(getState().min));
getWidget().setMax(parseDateInWireFormat(getState().max));
}
示例14: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
if (widget != null) {
widget.removeFromParent();
}
widget = new FloatingIndexWidget();
VNavigationView navView = ((NavigationViewConnector) getParent())
.getWidget();
for (int i = 0; i < getState().keys.size(); i++) {
String string = getState().keys.get(i);
AbstractComponentConnector c = (AbstractComponentConnector) getState().connectors
.get(i);
widget.map(string, c.getWidget(), navView.getContent().getElement()
.getParentElement());
}
navView.add(widget);
}
示例15: onStateChanged
import com.vaadin.client.communication.StateChangeEvent; //導入依賴的package包/類
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
super.onStateChanged(stateChangeEvent);
if (stateChangeEvent.hasPropertyChanged("registeredEventListeners")) {
Set<String> listeners = getState().registeredEventListeners;
if (listeners != null) {
// Fire update events when a listener is defined
if (listeners.contains(ItemUpdateEvent.ITEM_UPDATE_EVENT_IDENTIFIER)) {
if (!storageEventHandler.isAttached()) {
Storage.addStorageEventHandler(storageEventHandler);
storageEventHandler.setAttached(true);
}
} else {
if (storageEventHandler.isAttached()) {
Storage.removeStorageEventHandler(storageEventHandler);
storageEventHandler.setAttached(true);
}
}
}
}
}