Package nextapp.echo2.app

Examples of nextapp.echo2.app.ListBox


    /**
     * Test Adding/Removing <code>ActionListener</code>s and
     * receiving events.
     */
    public void testActionListeners() {
        ListBox listBox = new ListBox();
        listBox.setActionCommand("action!");
       
        assertFalse(listBox.hasActionListeners());
       
        ActionHandler actionHandler = new ActionHandler();
        listBox.addActionListener(actionHandler);

        assertTrue(listBox.hasActionListeners());
       
        listBox.processInput(ListBox.INPUT_ACTION, null);
        assertNotNull(actionHandler.lastEvent);
        assertEquals(listBox, actionHandler.lastEvent.getSource());
        assertEquals("action!", actionHandler.lastEvent.getActionCommand());

        listBox.removeActionListener(actionHandler);

        assertFalse(listBox.hasActionListeners());
    }
View Full Code Here


   
    /**
     * Test property accessors and mutators.
     */
    public void testProperties() {
        ListBox listBox = new ListBox();
        listBox.setActionCommand("action!");
        listBox.setBorder(TestConstants.BORDER_THICK_ORANGE);
        listBox.setHeight(TestConstants.EXTENT_30_PX);
        listBox.setInsets(TestConstants.INSETS_1234);
        listBox.setRolloverEnabled(true);
        listBox.setRolloverBackground(Color.GREEN);
        listBox.setRolloverFont(TestConstants.MONOSPACE_12);
        listBox.setRolloverForeground(Color.YELLOW);
        listBox.setWidth(TestConstants.EXTENT_100_PX);
        assertEquals("action!", listBox.getActionCommand());
        assertEquals(TestConstants.BORDER_THICK_ORANGE, listBox.getBorder());
        assertEquals(Color.GREEN, listBox.getRolloverBackground());
        assertEquals(true, listBox.isRolloverEnabled());
        assertEquals(TestConstants.MONOSPACE_12, listBox.getRolloverFont());
        assertEquals(Color.YELLOW, listBox.getRolloverForeground());
        assertEquals(TestConstants.EXTENT_30_PX, listBox.getHeight());
        assertEquals(TestConstants.INSETS_1234, listBox.getInsets());
        assertEquals(TestConstants.EXTENT_100_PX, listBox.getWidth());
    }
View Full Code Here

        }
       
        boolean multipleSelect = false;
        if (listComponent instanceof ListBox) {
            initElement.setAttribute("type", "list-box");
            ListBox listBox = (ListBox) listComponent;
            if (listBox.getSelectionMode() == ListSelectionModel.MULTIPLE_SELECTION) {
                initElement.setAttribute("multiple", "true");
                multipleSelect = true;
            }
        }
View Full Code Here

        this.getBtnMain().setBackground(Color.WHITE);
        this.getBtnMain().setBorder(BorderEx.NONE);
        this.getBtnMain().setRolloverBackground(Color.WHITE);
        this.getBtnMain().setRolloverBorder(BorderEx.NONE);

        this.setToggleIcon(new ResourceImageReference(IMG_DROPDOWN));
        this.setTogglePressedIcon(new ResourceImageReference(IMG_DROPDOWN));
        this.setToggleRolloverIcon(new ResourceImageReference(IMG_DROPDOWN));
       

        /*
        this.getBtnMain().addActionListener(new ActionListener() {

View Full Code Here

     * @param title The title of the button
     */
    public JbsAccPaneButton(String imgFileName, String title) {
        super();
        try {
            ResourceImageReference ref = new ResourceImageReference(Styles.getIconPath() + imgFileName);
            this.setIcon(ref);
        } catch (Exception e) {
            logger.debug(Styles.getIconPath() + imgFileName + " not found.");
        }
        this.setStyleName("Default");
View Full Code Here

        this.setBorder(BorderEx.NONE);
        this.setRolloverBorder(BorderEx.NONE);
        this.setTarget(this.getBtnMain());
        this.setPopUp(this.getMnuMain());
        this.setToggleIcon(new ResourceImageReference(IMG_DROPDOWN));
        this.setTogglePressedIcon(new ResourceImageReference(IMG_DROPDOWN));
        this.setToggleRolloverIcon(new ResourceImageReference(IMG_DROPDOWN));
    }
View Full Code Here

    private Logger logger = Logger.getLogger(BtnToolbar.class);
    private static final long serialVersionUID = 176100334500789000L;

    public BtnToolbar(String imgFileName) {
        super();
        ResourceImageReference ref = new ResourceImageReference(Styles.getIconPath() + imgFileName);
        if (ref != null) {
            this.setIcon(ref);
        } else {
            logger.warn("Image " + imgFileName + " not found.");
        }
View Full Code Here

                    break; // no icon
            }

            if (iconName != null) {
                final String imagePath = Styles.getIconPath(); //"../resource/images/";
                messageIcons[messageType] = new ResourceImageReference(
                        imagePath + iconName, new JbsExtent(ICON_HEIGHT), new JbsExtent(ICON_HEIGHT));
            }
        }

        return messageIcons[messageType];
View Full Code Here

    public void addControl(String groupName, Component control) {
        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

        spMain.add(pnMain);
    }

    protected JbsContentPane initPnButtons() {
        pnButtons = new JbsContentPane();
        Row mainRow = new Row();
        mainRow.setAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
        mainRow.setInsets(new Insets(new JbsExtent(5), new JbsExtent(5)));

        btnOK = new JbsButton(JbsL10N.getString("Generic.ok"));
        btnOK.setAlignmentHorizontal(Alignment.CENTER);
        btnOK.setWidth(new JbsExtent(80));
        btnOK.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                postDialog();
            }
        });
        mainRow.add(btnOK);

        btnCancel = new JbsButton(JbsL10N.getString("Generic.cancel"));
        btnCancel.setAlignmentHorizontal(Alignment.CENTER);
        btnCancel.setWidth(new JbsExtent(80));
        btnCancel.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                cancelDialog();
            }
        });
        mainRow.add(btnCancel);

        /*
        KeyStrokeListener ks = new KeyStrokeListener();
        ks.addKeyCombination(KeyStrokeListener.VK_RETURN,"OK");
        ks.addKeyCombination(KeyStrokeListener.VK_ESCAPE,"CANCEL");
        ks.addActionListener(new ActionListener() {
        private static final long serialVersionUID = 1L;
        public void actionPerformed(ActionEvent arg0) {
        if (arg0.getActionCommand().equals("OK"))
        postDialog();
        else if (arg0.getActionCommand().equals("CANCEL"))
        cancelDialog();
        }
        });
        mainRow.add(ks);
        mainRow.add(this.createKeyStrokeListener());
         */
        mainRow.add(this.getKeystrokeListener());
        pnButtons.add(mainRow);
        return pnButtons;
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.ListBox

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.