Package info.clearthought.layout

Examples of info.clearthought.layout.TableLayout


        public UIsSelectorView(ViewContext viewContext) {
            super(viewContext);
        }

        protected Component initComponent() {
            JPanel panel = new JPanel(new TableLayout(new double[][]{{150, 3, -1}, {-1}}));

            uis = new JComboBox(new Object[]{
                    TabbedContentManagerUI.class,
                    DesktopContentManagerUI.class
            });
View Full Code Here


    public DockedTypeDescriptorView(ViewContext viewContext) {
        super(viewContext);
    }

    protected Component initComponent() {
        JPanel panel = new JPanel(new TableLayout(new double[][]{{3, -2, 3, -1, 3, -2, 3, -1, 3}, {-1, 20, 3, 20, 3, 20, 3, 20, -1}}));

        // Left
        panel.add(new JLabel("popupMenuEnabled : "), "1,1,r,c");
        panel.add(popupMenuEnabled = new JCheckBox(), "3,1,FULL,FULL");
        popupMenuEnabled.setAction(new DynamicAction(DockedTypeDescriptor.class,
View Full Code Here

    }

    protected Component initComponent() {
        ToolWindowManager toolWindowManager = (ToolWindowManager) viewContext.get(ToolWindowManager.class);

        JPanel toolsPanel = new JPanel(new TableLayout(new double[][]{{-1}, {-1}}));
        toolsPanel.setBorder(new TitledBorder("ToolWindows"));

        final JTable toolsTable = new JTable(new ToolsTableModel(toolWindowManager));
        toolsTable.getTableHeader().setReorderingAllowed(false);
        toolsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                if (toolsTable.getSelectedRow() != -1) {
                    ToolWindow selectedTool = (ToolWindow) toolsTable.getModel().getValueAt(toolsTable.getSelectedRow(), -1);
                    viewContext.put(ToolWindow.class, selectedTool);
                }
            }
        });

        // Type column
        JComboBox types = new JComboBox(new Object[]{ToolWindowType.DOCKED,
                                                     ToolWindowType.SLIDING, ToolWindowType.FLOATING, ToolWindowType.FLOATING_FREE});
        toolsTable.getColumnModel().getColumn(2).setCellEditor(new DefaultCellEditor(types));

        // Anchor column
        JComboBox anchors = new JComboBox(new Object[]{ToolWindowAnchor.LEFT,
                                                       ToolWindowAnchor.RIGHT, ToolWindowAnchor.BOTTOM, ToolWindowAnchor.TOP});
        toolsTable.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(anchors));

        // Available, Visible, Active columns
        JCheckBox booleanEditor = new JCheckBox();
        booleanEditor.setHorizontalAlignment(SwingConstants.CENTER);
        toolsTable.getColumnModel().getColumn(4).setCellRenderer(new CheckBoxCellRenderer());
        toolsTable.getColumnModel().getColumn(4).setCellEditor(new DefaultCellEditor(booleanEditor));

        toolsTable.getColumnModel().getColumn(5).setCellRenderer(new CheckBoxCellRenderer());
        toolsTable.getColumnModel().getColumn(5).setCellEditor(new DefaultCellEditor(booleanEditor));

        toolsTable.getColumnModel().getColumn(6).setCellRenderer(new CheckBoxCellRenderer());
        toolsTable.getColumnModel().getColumn(6).setCellEditor(new DefaultCellEditor(booleanEditor));

        toolsTable.getColumnModel().getColumn(8).setCellRenderer(new CheckBoxCellRenderer());
        toolsTable.getColumnModel().getColumn(8).setCellEditor(new DefaultCellEditor(booleanEditor));

        // Index column
        TableColumn indexColumn = toolsTable.getColumnModel().getColumn(7);
        indexColumn.setCellRenderer(new DefaultTableCellRenderer() {
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
                Integer index = (Integer) value;
                if (index == -1)
                    setText("No Index");
                return c;
            }
        });
        JComboBox indexs = new JComboBox(new Object[]{-1, 1, 2, 3, 4, 5, 6, 7, 8, 9});
        indexs.setRenderer(new DefaultListCellRenderer() {
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
                Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                Integer toolIndex = (Integer) value;
                if (toolIndex == -1)
                    setText("No Index");
                return c;
            }
        });
        indexColumn.setCellEditor(new DefaultCellEditor(indexs));

        toolsPanel.setLayout(new TableLayout(new double[][]{{-1}, {-1}}));
        toolsPanel.add(new JScrollPane(toolsTable), "0,0,FULL,FULL");

        return toolsPanel;
    }
View Full Code Here

        fileMenu.add(exitMenuItem);
        menuBar.add(fileMenu);
        this.frame.setJMenuBar(menuBar);

        // Set a layout manager. I love TableLayout. It's powerful.
        this.frame.getContentPane().setLayout(new TableLayout(new double[][]{{0, -1, 0}, {0, -1, 0}}));
    }
View Full Code Here

    public PreferencePanelView(ViewContext viewContext) {
        super(viewContext);
    }

    protected Component initComponent() {
        preferencePanel = new JPanel(new TableLayout(new double[][]{{-1}, {20, 3, -1}}));
        preferencePanel.setBorder(new TitledBorder("Preferences"));


        typeDescriptorContainer = new PanelViewContainer() {
            protected void initComponents() {
View Full Code Here

    public ContentTableView(ViewContext viewContext) {
        super(viewContext);
    }

    protected Component initComponent() {
        JPanel main = new JPanel(new TableLayout(new double[][]{{-1},{-1}}));
        main.setBorder(new TitledBorder("Contents"));

        JTable contentsTable = new JTable(new ContentsTableModel(viewContext.get(ToolWindowManager.class)));
        contentsTable.getTableHeader().setReorderingAllowed(false);
View Full Code Here

        fileMenu.add(exitMenuItem);
        menuBar.add(fileMenu);
        this.frame.setJMenuBar(menuBar);

        // Set a layout manager. I love TableLayout. It's powerful.
        this.frame.getContentPane().setLayout(new TableLayout(new double[][]{{0, -1, 0}, {0, -1, 0}}));
    }
View Full Code Here

        public TypeDescriptorSelectorView(ViewContext viewContext) {
            super(viewContext);
        }

        protected Component initComponent() {
            JPanel panel = new JPanel(new TableLayout(new double[][]{{150, 3, -1}, {-1}}));

            types = new JComboBox(new Object[]{
                    null,
                    DockedTypeDescriptor.class,
                    SlidingTypeDescriptor.class,
View Full Code Here

    public Component getComponent() {
        ViewContext viewContext = new MapViewContext();
        viewContext.put(ToolWindowManager.class, toolWindowManager);

        JPanel panel = new JPanel();
        panel.setLayout(new TableLayout(new double[][]{{-1}, {120, 3, -1}}));
        panel.add(new ToolWindowManagerDescriptorPrefView(viewContext).getComponent(), "0,0,FULL,FULL");
        panel.add(new PersistencePrefView(viewContext).getComponent(), "0,2,FULL,FULL");

        viewContext.put(ToolWindowManagerDescriptor.class, toolWindowManager.getToolWindowManagerDescriptor());
View Full Code Here

    public SlidingTypeDescriptorView(ViewContext viewContext) {
        super(viewContext);
    }

    protected Component initComponent() {
        JPanel panel = new JPanel(new TableLayout(new double[][]{{3, -2, 3, -1, 3}, {-1, 20, 3, 20, 3, 20, 3, 20, -1}}));

        panel.add(new JLabel("enabled : "), "1,1,r,c");
        panel.add(enabled = new JCheckBox(), "3,1,FULL,FULL");
        enabled.setAction(new DynamicAction(SlidingTypeDescriptor.class,
                                            "enabled",
View Full Code Here

TOP

Related Classes of info.clearthought.layout.TableLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.