com.vaadin.client.annotations.OnStateChange Java Examples

The following examples show how to use com.vaadin.client.annotations.OnStateChange. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TableSelectionModelConnector.java    From GridExtensionPack with Apache License 2.0 6 votes vote down vote up
@OnStateChange("selectionMode")
void setSelectionMode() {
	if (clickHandler != null) {
		clickHandler.removeHandler();
		clickHandler = null;
	}

	BodyClickHandler handler;
	Grid<JsonObject> grid = getGrid();
	switch (getState().selectionMode) {
	case CTRL:
		handler = new CtrlClickSelectionHandler(grid);
		break;
	case SIMPLE:
		handler = new SimpleClickSelectionHandler(grid);
		break;
	case SHIFT:
		handler = new ShiftCtrlClickSelectionHandler(grid, getRpcProxy(ShiftSelectRpc.class));
		break;
	case NONE:
	default:
		return;
	}

	clickHandler = grid.addBodyClickHandler(handler);
}
 
Example #2
Source File: PopupButtonConnector.java    From cuba with Apache License 2.0 5 votes vote down vote up
@OnStateChange("popupPositionConnector")
void onPopupPositionConnectorChanged() {
    if (getState().popupPositionConnector != null) {
        Widget w = ((ComponentConnector) getState().popupPositionConnector).getWidget();
        getWidget().setPopupPositionWidget(w);
    } else {
        getWidget().setPopupPositionWidget(null);
    }
}
 
Example #3
Source File: GwtToolWindowStripeButtonConnector.java    From consulo with Apache License 2.0 5 votes vote down vote up
@OnStateChange("mySecondary")
private void changeSideTool() {
  GwtToolWindowStripeButton widget = getWidget();

  GwtToolWindowStripeInner stripeInner = GwtUIUtil.getParentOf(widget, GwtToolWindowStripeInner.class);

  if (stripeInner == null) {
    return;
  }

  stripeInner.add(widget, getState().mySecondary);
}
 
Example #4
Source File: GwtListBoxImplConnector.java    From consulo with Apache License 2.0 5 votes vote down vote up
@OnStateChange({"myWidth", "myHeight"})
private void onSizeChanged() {
  if (getState().myWidth != -1) {
    getWidget().setWidth(getState().myWidth + "px");
  }

  if (getState().myHeight != -1) {
    getWidget().setHeight(getState().myHeight + "px");
  }
}
 
Example #5
Source File: ComboBoxMultiselectConnector.java    From vaadin-combobox-multiselect with Apache License 2.0 4 votes vote down vote up
@OnStateChange({ "selectedItemKeys", "selectedItemsCaption" })
private void onSelectionChange() {
    getDataReceivedHandler().updateSelectionFromServer(	getState().selectedItemKeys,
                                                       	getState().selectedItemsCaption);
}
 
Example #6
Source File: CubaTextAreaConnector.java    From cuba with Apache License 2.0 4 votes vote down vote up
@OnStateChange("caseConversion")
void updateCaseConversion() {
    getWidget().setCaseConversion(getState().caseConversion);
}
 
Example #7
Source File: CubaTextFieldConnector.java    From cuba with Apache License 2.0 4 votes vote down vote up
@OnStateChange("readOnlyFocusable")
void updateReadOnlyFocusable() {
    getWidget().setReadOnlyFocusable(getState().readOnlyFocusable);
}
 
Example #8
Source File: CubaTextFieldConnector.java    From cuba with Apache License 2.0 4 votes vote down vote up
@OnStateChange("caseConversion")
void updateCaseConversion() {
    getWidget().setCaseConversion(getState().caseConversion);
}
 
Example #9
Source File: CubaTextFieldConnector.java    From cuba with Apache License 2.0 4 votes vote down vote up
@OnStateChange("htmlName")
void updateHtmlName() {
    getWidget().setHtmlName(getState().htmlName);
}
 
Example #10
Source File: ComboBoxMultiselectConnector.java    From vaadin-combobox-multiselect with Apache License 2.0 4 votes vote down vote up
@OnStateChange({ "selectedItemKeys", "selectedItemsCaption" })
private void onSelectionChange() {
    getDataReceivedHandler().updateSelectionFromServer(	getState().selectedItemKeys,
                                                       	getState().selectedItemsCaption);
}
 
Example #11
Source File: CacheStrategyExtensionConnector.java    From GridExtensionPack with Apache License 2.0 4 votes vote down vote up
@OnStateChange("minSize")
void updateMinSize() {
	minSize = getState().minSize;
}
 
Example #12
Source File: CacheStrategyExtensionConnector.java    From GridExtensionPack with Apache License 2.0 4 votes vote down vote up
@OnStateChange("minSize")
void updatePageMultiplier() {
	pageMultiplier = getState().pageMultiplier;
}
 
Example #13
Source File: SidebarMenuExtensionConnector.java    From GridExtensionPack with Apache License 2.0 4 votes vote down vote up
@OnStateChange("autoClose")
void updateAutoClose() {
	autoClose = getState().autoClose;
}
 
Example #14
Source File: GwtToolWindowStripeButtonConnector.java    From consulo with Apache License 2.0 4 votes vote down vote up
@OnStateChange("mySelected")
private void onSelected() {
  getWidget().setSelected(getState().mySelected);
}