Logo Search packages:      
Sourcecode: jabref-plugin-oo version File versions  Download package

net::sf::jabref::oo::StyleDirectoriesPanel::StyleDirectoriesPanel ( JDialog  parent,
String[]  dirs 
) [inline]

Parameters:
dirs A String array containing two elements per file/directory: first the path, then the string "true" or "false", determining whether the element should be handled recursively.

Definition at line 53 of file StyleDirectoriesPanel.java.

                                                                {
        this.parent = parent;
        sortedEntries = new SortedList<DirElement>(entries);
        if (dirs != null)
            setValues(dirs);
        panel.setLayout(new BorderLayout());
        tableModel = new EventTableModel<DirElement>(sortedEntries, new DirElementFormat());
        selectionModel = new EventSelectionModel<DirElement>(sortedEntries);
        JTable table = new JTable(tableModel);
        table.setSelectionModel(selectionModel);
        table.setPreferredScrollableViewportSize(new Dimension(
            table.getPreferredScrollableViewportSize().width,
            TABLE_VISIBLE_ROWS*table.getRowHeight()));
        TableColumnModel cm = table.getColumnModel();
        cm.getColumn(0).setPreferredWidth(200);
        cm.getColumn(1).setPreferredWidth(40);

        JScrollPane sp = new JScrollPane(table);
        ButtonStackBuilder bb = new ButtonStackBuilder();
        bb.addGridded(addFile);
        bb.addGridded(addDir);
        bb.addGridded(remove);
        bb.addGlue();
        DefaultFormBuilder b = new DefaultFormBuilder(new FormLayout("fill:pref:grow, 2dlu, fill:pref",
                "pref, fill:pref"));
        b.appendSeparator(Globals.lang("Directories and files"));
        b.nextLine();
        b.append(sp);
        b.append(bb.getPanel());
        b.getPanel().setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        panel.add(b.getPanel(), BorderLayout.CENTER);

        addFile.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                addEntry(false);
            }
        });
        addDir.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                addEntry(true);
            }
        });
        remove.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                removeSelected();
            }
        });
    }


Generated by  Doxygen 1.6.0   Back to index