Package nextapp.echo2.app.list

Examples of nextapp.echo2.app.list.DefaultListSelectionModel


        this.txEmail = new JbsTextField();
        this.txWebsite = new JbsTextField();

        this.usCompanyLogo = new JbsUploadSelect();
        try {
            this.usCompanyLogo.addUploadListener(new UploadListener() {

                public void fileUpload(UploadEvent e) {
                    uploadImage(e);
                }
View Full Code Here


        this.addControl(groupName, groupName, control);
    }

    public void addSeparator(String groupName) {
        Row row = new Row();
        ColumnLayoutData layout = new ColumnLayoutData();
        layout.setHeight(new JbsExtent(15, JbsExtent.PX));
        row.setLayoutData(layout);
        this.addControl(groupName, row);
    }
View Full Code Here

        colMain.add(label);
    }
   
    public void addBlankLine() {
        Row row = new Row();
        ColumnLayoutData layout = new ColumnLayoutData();
        layout.setHeight(new JbsExtent(15,JbsExtent.PX));
        row.setLayoutData(layout);
        colMain.add(row);
    }
View Full Code Here

                    break;
                default :
                    align = Alignment.LEFT;
            }
           
            TableLayoutData layoutData = (TableLayoutData)((Label)component).getLayoutData();
            layoutData.setAlignment(new Alignment(align, Alignment.CENTER));
            ((Label)component).setLayoutData(layoutData);
        }
        return component;
    }
View Full Code Here

            this.e = e;
        }
    }
   
    public void testChangeSelectionMode() {
        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
        TestChangeListener changeListener = new TestChangeListener();
        selectionModel.addChangeListener(changeListener);
        selectionModel.setSelectionMode(DefaultListSelectionModel.MULTIPLE_SELECTION);
        assertEquals(DefaultListSelectionModel.MULTIPLE_SELECTION, selectionModel.getSelectionMode());
        selectionModel.setSelectedIndex(25, true);
        selectionModel.setSelectedIndex(27, true);
        selectionModel.setSelectedIndex(50, true);
        selectionModel.setSelectedIndex(44, true);
        assertEquals(25, selectionModel.getMinSelectedIndex());
        assertEquals(50, selectionModel.getMaxSelectedIndex());
        changeListener.e = null;
       
        selectionModel.setSelectionMode(DefaultListSelectionModel.SINGLE_SELECTION);
        assertEquals(DefaultListSelectionModel.SINGLE_SELECTION, selectionModel.getSelectionMode());
        assertEquals(25, selectionModel.getMinSelectedIndex());
        assertEquals(25, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
    }
View Full Code Here

        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
    }
   
    public void testInitialState() {
        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
       
        assertTrue(selectionModel.isSelectionEmpty());
        assertEquals(-1, selectionModel.getMinSelectedIndex());
        assertEquals(-1, selectionModel.getMaxSelectedIndex());
        assertFalse(selectionModel.isSelectedIndex(0));
        assertFalse(selectionModel.isSelectedIndex(1));
        assertFalse(selectionModel.isSelectedIndex(2));
    }
View Full Code Here

        assertFalse(selectionModel.isSelectedIndex(1));
        assertFalse(selectionModel.isSelectedIndex(2));
    }
   
    public void testMultipleSelection() {
        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
        selectionModel.setSelectionMode(DefaultListSelectionModel.MULTIPLE_SELECTION);
        assertEquals(DefaultListSelectionModel.MULTIPLE_SELECTION, selectionModel.getSelectionMode());
       
        TestChangeListener changeListener = new TestChangeListener();
        selectionModel.addChangeListener(changeListener);
       
        selectionModel.setSelectedIndex(50, true);
        assertFalse(selectionModel.isSelectionEmpty());
        assertTrue(selectionModel.isSelectedIndex(50));
        assertFalse(selectionModel.isSelectedIndex(0));
        assertFalse(selectionModel.isSelectedIndex(5));
        assertFalse(selectionModel.isSelectedIndex(49));
        assertFalse(selectionModel.isSelectedIndex(51));
        assertEquals(50, selectionModel.getMinSelectedIndex());
        assertEquals(50, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;
       
        selectionModel.setSelectedIndex(75, true);
        assertFalse(selectionModel.isSelectionEmpty());
        assertTrue(selectionModel.isSelectedIndex(50));
        assertTrue(selectionModel.isSelectedIndex(75));
        assertEquals(50, selectionModel.getMinSelectedIndex());
        assertEquals(75, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;
       
        selectionModel.setSelectedIndex(67, true);
        assertFalse(selectionModel.isSelectionEmpty());
        assertTrue(selectionModel.isSelectedIndex(50));
        assertTrue(selectionModel.isSelectedIndex(67));
        assertTrue(selectionModel.isSelectedIndex(75));
        assertEquals(50, selectionModel.getMinSelectedIndex());
        assertEquals(75, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;
       
        selectionModel.setSelectedIndex(21, true);
        assertFalse(selectionModel.isSelectionEmpty());
        assertTrue(selectionModel.isSelectedIndex(21));
        assertTrue(selectionModel.isSelectedIndex(50));
        assertTrue(selectionModel.isSelectedIndex(67));
        assertTrue(selectionModel.isSelectedIndex(75));
        assertEquals(21, selectionModel.getMinSelectedIndex());
        assertEquals(75, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;

        selectionModel.setSelectedIndex(75, false);
        assertFalse(selectionModel.isSelectionEmpty());
        assertTrue(selectionModel.isSelectedIndex(21));
        assertTrue(selectionModel.isSelectedIndex(50));
        assertTrue(selectionModel.isSelectedIndex(67));
        assertFalse(selectionModel.isSelectedIndex(75));
        assertEquals(21, selectionModel.getMinSelectedIndex());
        assertEquals(67, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;

        selectionModel.setSelectedIndex(21, false);
        assertFalse(selectionModel.isSelectionEmpty());
        assertFalse(selectionModel.isSelectedIndex(21));
        assertTrue(selectionModel.isSelectedIndex(50));
        assertTrue(selectionModel.isSelectedIndex(67));
        assertFalse(selectionModel.isSelectedIndex(75));
        assertEquals(50, selectionModel.getMinSelectedIndex());
        assertEquals(67, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;
       
        selectionModel.clearSelection();
        assertTrue(selectionModel.isSelectionEmpty());
        assertFalse(selectionModel.isSelectedIndex(21));
        assertFalse(selectionModel.isSelectedIndex(50));
        assertFalse(selectionModel.isSelectedIndex(67));
        assertFalse(selectionModel.isSelectedIndex(75));
        assertEquals(-1, selectionModel.getMinSelectedIndex());
        assertEquals(-1, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;
    }
View Full Code Here

        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;
    }
   
    public void testSingleSelection() {
        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
        assertEquals(DefaultListSelectionModel.SINGLE_SELECTION, selectionModel.getSelectionMode());
        TestChangeListener changeListener = new TestChangeListener();
        selectionModel.addChangeListener(changeListener);
       
        selectionModel.setSelectedIndex(50, true);
        assertFalse(selectionModel.isSelectionEmpty());
        assertTrue(selectionModel.isSelectedIndex(50));
        assertFalse(selectionModel.isSelectedIndex(0));
        assertFalse(selectionModel.isSelectedIndex(5));
        assertFalse(selectionModel.isSelectedIndex(49));
        assertFalse(selectionModel.isSelectedIndex(51));
        assertEquals(50, selectionModel.getMinSelectedIndex());
        assertEquals(50, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;
       
        selectionModel.setSelectedIndex(75, true);
        assertFalse(selectionModel.isSelectionEmpty());
        assertFalse(selectionModel.isSelectedIndex(50));
        assertTrue(selectionModel.isSelectedIndex(75));
        assertEquals(75, selectionModel.getMinSelectedIndex());
        assertEquals(75, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;

        selectionModel.clearSelection();
        assertTrue(selectionModel.isSelectionEmpty());
        assertFalse(selectionModel.isSelectedIndex(50));
        assertFalse(selectionModel.isSelectedIndex(75));
        assertEquals(-1, selectionModel.getMinSelectedIndex());
        assertEquals(-1, selectionModel.getMaxSelectedIndex());
        assertNotNull(changeListener.e);
        assertEquals(selectionModel, changeListener.e.getSource());
        changeListener.e = null;
    }
View Full Code Here

            setColumnModel(new DefaultTableColumnModel());
            setAutoCreateColumnsFromModel(true);
        } else {
            setColumnModel(columnModel);
        }
        setSelectionModel(new DefaultListSelectionModel());
        setModel(model);
    }
View Full Code Here

        //If nor group is found then create a new one:
        if (newColumn == null) {
            newColumn = new Column();
            newColumn.setId(groupName);
            newColumn.setStyleName("Default");
            AccordionPaneLayoutData layoutData = new AccordionPaneLayoutData();
            layoutData.setTitle(groupTitle);
            newColumn.setLayoutData(layoutData);
            this.add(newColumn);
        }
        return newColumn;
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.list.DefaultListSelectionModel

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.