source: java/main/src/main/java/com/framsticks/gui/table/ListPanelProvider.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1package com.framsticks.gui.table;
2
3import java.util.Collections;
4import java.util.HashMap;
5import java.util.Map;
6
7import com.framsticks.gui.PanelProvider;
8import com.framsticks.gui.TreePanel;
9import com.framsticks.params.annotations.AutoAppendAnnotation;
10import com.framsticks.params.annotations.FramsClassAnnotation;
11import com.framsticks.params.types.ListParam;
12
13@FramsClassAnnotation
14public class ListPanelProvider implements PanelProvider {
15
16        protected final Map<String, ColumnsConfig> columnsConfigs = new HashMap<>();
17        /**
18         *
19         * That limit is honored only when no explicit ColumnsConfig object is found.
20         */
21        protected Integer maximumColumnNumber = 5;
22
23        @Override
24        public TreePanel providePanel(TreePanel.Parameters parameters) {
25                if (parameters.param instanceof ListParam) {
26                        return new ListPanel(parameters, this);
27                }
28                return null;
29        }
30
31        @AutoAppendAnnotation
32        public void addColumnsConfig(ColumnsConfig config) {
33                columnsConfigs.put(config.getClassName(), config);
34        }
35
36        /**
37         * @return the columnsConfigs
38         */
39        public Map<String, ColumnsConfig> getColumnsConfigs() {
40                return Collections.unmodifiableMap(columnsConfigs);
41        }
42
43        /**
44         * @return the maximumColumnNumber
45         */
46        public Integer getMaximumColumnNumber() {
47                return maximumColumnNumber;
48        }
49
50        /**
51         * @param maximumColumnNumber the maximumColumnNumber to set
52         */
53        public void setMaximumColumnNumber(Integer maximumColumnNumber) {
54                this.maximumColumnNumber = maximumColumnNumber;
55        }
56
57}
Note: See TracBrowser for help on using the repository browser.