Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / extensions / org.gvsig.installer / org.gvsig.installer.swing / org.gvsig.installer.swing.impl / src / main / java / org / gvsig / installer / swing / impl / execution / panel / selectPackages2 / CategoriesFilterPanel.java @ 37538

History | View | Annotate | Download (4.92 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.installer.swing.impl.execution.panel.selectPackages2;
23

    
24
import java.awt.GridBagConstraints;
25
import java.awt.GridBagLayout;
26
import java.awt.Insets;
27
import java.util.ArrayList;
28

    
29
import javax.swing.JButton;
30
import javax.swing.JList;
31
import javax.swing.JPanel;
32
import javax.swing.JScrollPane;
33

    
34
/**
35
 * @author gvSIG Team
36
 * @version $Id$
37
 * 
38
 */
39
public class CategoriesFilterPanel extends JPanel {
40

    
41
    private static final long serialVersionUID = 3767011079359743742L;
42

    
43
    // private PackagesTablePanel packagesTablePanel;
44

    
45
    // private JScrollPane filterScrollPane;
46
    private JList jList;
47
    private ArrayList<String> itemsArrayList = null;
48

    
49
    public CategoriesFilterPanel(PackagesTablePanel packagesTablePanel) {
50
        // this.packagesTablePanel = packagesTablePanel;
51
        initComponents();
52
    }
53

    
54
    private void initComponents() {
55

    
56
        // TODO: init arrayList
57
        itemsArrayList = new ArrayList<String>();
58

    
59
        jList = new JList(itemsArrayList.toArray());
60

    
61
        JScrollPane filterScrollPane = new JScrollPane(jList);
62
        JButton categoriesButton = new JButton("Categories");
63
        JButton typesButton = new JButton("Types");
64
        // filterScrollPane.add(jList);
65

    
66
        typesButton = new JButton("Types");
67

    
68
        this.setLayout(new GridBagLayout());
69

    
70
        java.awt.GridBagConstraints gridBagConstraints;
71

    
72
        gridBagConstraints = new GridBagConstraints();
73
        gridBagConstraints.fill = GridBagConstraints.BOTH;
74
        gridBagConstraints.gridx = 0;
75
        gridBagConstraints.gridy = 0;
76
        gridBagConstraints.weightx = 1;
77
        gridBagConstraints.weighty = 1;
78
        // gridBagConstraints.gridheight = 3;
79
        gridBagConstraints.insets = new Insets(2, 2, 2, 2);
80
        this.add(filterScrollPane, gridBagConstraints);
81

    
82
        gridBagConstraints = new GridBagConstraints();
83
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
84
        gridBagConstraints.gridx = 0;
85
        gridBagConstraints.gridy = 1;
86
        gridBagConstraints.weightx = 1;
87
        gridBagConstraints.weighty = 0;
88
        gridBagConstraints.insets = new Insets(2, 2, 2, 2);
89
        this.add(categoriesButton, gridBagConstraints);
90

    
91
        gridBagConstraints = new GridBagConstraints();
92
        gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
93
        gridBagConstraints.gridx = 0;
94
        gridBagConstraints.gridy = 2;
95
        gridBagConstraints.weightx = 1;
96
        gridBagConstraints.weighty = 0;
97
        gridBagConstraints.insets = new Insets(2, 2, 2, 2);
98
        this.add(typesButton, gridBagConstraints);
99

    
100
    }
101

    
102
    // private void initComponents() {
103
    //
104
    // JLabel fastFilterLabel = new JLabel("fast_filter");
105
    //
106
    // textField = new JTextField(20);
107
    //
108
    // KeyListener l = new KeyListener() {
109
    //
110
    // public void keyTyped(KeyEvent e) {
111
    // }
112
    //
113
    // public void keyReleased(KeyEvent e) {
114
    // if (e.getKeyChar() == '\n') {
115
    // searchAction();
116
    // }
117
    // }
118
    //
119
    // public void keyPressed(KeyEvent e) {
120
    // }
121
    // };
122
    //
123
    // textField.addKeyListener(l);
124
    //
125
    // searchButton = new JButton("search");
126
    // searchButton.setActionCommand("search");
127
    // searchButton.addActionListener(this);
128
    //
129
    // resetButton = new JButton("reset");
130
    // resetButton.setActionCommand("reset");
131
    // resetButton.addActionListener(this);
132
    //
133
    // setLayout(new FlowLayout(FlowLayout.LEFT));
134
    //
135
    // add(fastFilterLabel);
136
    // add(textField);
137
    // add(searchButton);
138
    // add(resetButton);
139
    //
140
    // }
141
    //
142
    // public void actionPerformed(ActionEvent e) {
143
    // if ("search".equals(e.getActionCommand())) {
144
    // searchAction();
145
    // } else
146
    // if ("reset".equals(e.getActionCommand())) {
147
    // resetAction();
148
    // }
149
    // }
150
    //
151
    // private void searchAction() {
152
    // if (textField.equals("")) {
153
    // panel.setFilter(null);
154
    // } else {
155
    // panel.setFilter(new NameAndDescriptionFilter(textField.getText()));
156
    // }
157
    // }
158
    //
159
    // private void resetAction() {
160
    // panel.setFilter(null);
161
    // textField.setText("");
162
    // }
163

    
164
}