當前位置: 首頁>>代碼示例>>Java>>正文


Java StateChangeEvent類代碼示例

本文整理匯總了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);
}
 
開發者ID:peholmst,項目名稱:vaadin-mockapp,代碼行數:24,代碼來源:ResetButtonForTextFieldConnector.java

示例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);
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:27,代碼來源:CubaCheckBoxConnector.java

示例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);
}
 
開發者ID:jvalenciag,項目名稱:VaadinSpringShiroMongoDB,代碼行數:27,代碼來源:ResetButtonForTextFieldConnector.java

示例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;
	}

}
 
開發者ID:bonprix,項目名稱:vaadin-scrollable-panel,代碼行數:23,代碼來源:ScrollablePanelConnector.java

示例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();
}
 
開發者ID:tltv,項目名稱:gantt,代碼行數:23,代碼來源:SubStepConnector.java

示例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);
				}
			}
		});
}
 
開發者ID:hezamu,項目名稱:vaadincanvas,代碼行數:23,代碼來源:CanvasConnector.java

示例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);
	}
}
 
開發者ID:tilioteo,項目名稱:hypothesis,代碼行數:17,代碼來源:TimerLabelConnector.java

示例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);
}
 
開發者ID:tapioaali,項目名稱:ResetButtonForTextField,代碼行數:26,代碼來源:ResetButtonForTextFieldConnector.java

示例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);
        }
    }
}
 
開發者ID:alump,項目名稱:GoFullScreen,代碼行數:21,代碼來源:FSNativeButtonConnector.java

示例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;
  }
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:19,代碼來源:GwtLabelImplConnector.java

示例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");
	}
}
 
開發者ID:alump,項目名稱:Picker,代碼行數:21,代碼來源:PickerConnector.java

示例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);
    }
}
 
開發者ID:vaadin,項目名稱:touchkit,代碼行數:18,代碼來源:NavigationBarConnector.java

示例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));
}
 
開發者ID:vaadin,項目名稱:touchkit,代碼行數:24,代碼來源:DatePickerConnector.java

示例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);
}
 
開發者ID:vaadin,項目名稱:touchkit,代碼行數:22,代碼來源:FloatingIndexConnector.java

示例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);
				}
			}
		}
	}
}
 
開發者ID:maxschuster,項目名稱:Vaadin-LocalStorage,代碼行數:22,代碼來源:LocalStorageConnector.java


注:本文中的com.vaadin.client.communication.StateChangeEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。