View Javadoc

1   /*
2    * Copyright 2006-2016 The JGUIraffe Team.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License")
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of 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,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.jguiraffe.gui.builder.components;
17  
18  /**
19   * <p>
20   * A default implementation of the {@code ContainerSelector} interface.
21   * </p>
22   * <p>
23   * This implementation simply returns the passed in container tag. This is
24   * appropriate for most use cases because the components defined in the body of
25   * a container tag have to be added to the data managed by this tag. Only in
26   * very special circumstances - e.g. if a tag has to be executed in an
27   * alternative context - a different behavior is needed.
28   * </p>
29   *
30   * @author Oliver Heger
31   * @version $Id$
32   * @since 1.3
33   */
34  public class DefaultContainerSelector implements ContainerSelector
35  {
36      /**
37       * {@inheritDoc} This implementation returns the passed in
38       * {@code ContainerTag}.
39       */
40      public Composite getComposite(Composite tag)
41      {
42          return tag;
43      }
44  }