You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TreeGrid.java 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright 2000-2016 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.client.widget.treegrid;
  17. import com.google.gwt.dom.client.Element;
  18. import com.google.gwt.event.shared.HandlerRegistration;
  19. import com.vaadin.client.widget.grid.events.BodyClickHandler;
  20. import com.vaadin.client.widget.treegrid.events.TreeGridClickEvent;
  21. import com.vaadin.client.widgets.Grid;
  22. import elemental.json.JsonObject;
  23. /**
  24. *
  25. * @author Vaadin Ltd
  26. * @since 8.1
  27. */
  28. public class TreeGrid extends Grid<JsonObject> {
  29. /**
  30. * Method for accessing the private {@link Grid#focusCell(int, int)} method
  31. * from this package
  32. */
  33. public native void focusCell(int rowIndex, int columnIndex)/*-{
  34. this.@com.vaadin.client.widgets.Grid::focusCell(II)(rowIndex, columnIndex);
  35. }-*/;
  36. /**
  37. * Method for accessing the private
  38. * {@link Grid#isElementInChildWidget(Element)} method from this package
  39. */
  40. public native boolean isElementInChildWidget(Element e)/*-{
  41. return this.@com.vaadin.client.widgets.Grid::isElementInChildWidget(*)(e);
  42. }-*/;
  43. @Override
  44. public HandlerRegistration addBodyClickHandler(BodyClickHandler handler) {
  45. return addHandler(handler, TreeGridClickEvent.TYPE);
  46. }
  47. @Override
  48. protected String getFocusPrimaryStyleName() {
  49. return super.getStylePrimaryName() + "-rowmode";
  50. }
  51. }