1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.macro.container

File LayoutManager.java

 

Code metrics

0
0
0
1
62
10
0
-
-
0
-

Classes

Class Line # Actions
LayoutManager 37 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.rendering.macro.container;
21   
22    import org.xwiki.component.annotation.Role;
23    import org.xwiki.rendering.block.Block;
24   
25    /**
26    * Layout manager to handle layouting of a block container, based on a set of parameters. The
27    * {@link #layoutContainer(Block)} function should read the container children and modify them accordingly to meet the
28    * required layout. Note that although the function can access the whole tree through the passed block, it is
29    * recommended that the changes are limited to the container block and its children. Also, usually the container block
30    * should be a group block. Parameters are used to pass various parameters required for the layouting (sizes, style
31    * options, etc).
32    *
33    * @version $Id: ba04c4966f777ad97fc71aae74932ca84e75702d $
34    * @since 2.5M2
35    */
36    @Role
 
37    public interface LayoutManager
38    {
39    /**
40    * Performs the layout of {@code container}, modifying the blocks inside.
41    * <p>
42    * TODO: might as well have been with a list of blocks as parameter, but I wanted to mimic the awt LayoutManager
43    * interface, which lays out a container and not a list of contents. Reviewer, WDYT?
44    *
45    * @param container the block whose contents to layout
46    */
47    void layoutContainer(Block container);
48   
49    /**
50    * Sets a parameter needed for the layout.
51    *
52    * @param parameterName the name of the parameter to set
53    * @param parameterValue the value of the parameter
54    */
55    void setParameter(String parameterName, Object parameterValue);
56   
57    /**
58    * @param parameterName the name of the parameter whose value to return
59    * @return the value of the parameter identified by {@code parameterName}
60    */
61    Object getParameter(String parameterName);
62    }