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.

Accordion.java 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2000-2018 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.ui;
  17. import com.vaadin.shared.ui.accordion.AccordionState;
  18. /**
  19. * An accordion is a component similar to a {@link TabSheet}, but with a
  20. * vertical orientation and the selected component presented between tabs.
  21. *
  22. * Closable tabs are not supported by the accordion.
  23. *
  24. * The {@link Accordion} can be styled with the .v-accordion, .v-accordion-item,
  25. * .v-accordion-item-first and .v-accordion-item-caption styles.
  26. *
  27. * @see TabSheet
  28. */
  29. public class Accordion extends TabSheet {
  30. /**
  31. * Creates an empty accordion.
  32. */
  33. public Accordion() {
  34. super();
  35. }
  36. /**
  37. * Constructs a new accordion containing the given components.
  38. *
  39. * @param components
  40. * The components to add to the accordion. Each component will be
  41. * added to a separate tab.
  42. */
  43. public Accordion(Component... components) {
  44. this();
  45. addComponents(components);
  46. }
  47. /*
  48. * (non-Javadoc)
  49. *
  50. * @see com.vaadin.ui.TabSheet#getState()
  51. */
  52. @Override
  53. protected AccordionState getState() {
  54. return (AccordionState) super.getState();
  55. }
  56. @Override
  57. protected AccordionState getState(boolean markAsDirty) {
  58. return (AccordionState) super.getState(markAsDirty);
  59. }
  60. }