Package nextapp.echo2.app.button

Examples of nextapp.echo2.app.button.ButtonModel


    protected void initPane() {
        Column colMain = new Column();
        colMain.add(this.getLbUserGroups());

        Row rowButtons = new Row();
        rowButtons.setAlignment(new Alignment(Alignment.RIGHT, Alignment.TOP));
        rowButtons.add(this.getBtnAdd());
        rowButtons.add(this.getBtnDelete());
        colMain.add(rowButtons);

        KeyStrokeListener ks = new KeyStrokeListener();
        ks.addKeyCombination(KeyStrokeListener.VK_INSERT, "INSERT");
        ks.addKeyCombination(KeyStrokeListener.VK_DELETE, "DELETE");
        ks.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                if (arg0.getActionCommand().equals("INSERT")) {
                    addGroup();
                } else if (arg0.getActionCommand().equals("DELETE")) {
                    deleteGroup();
                }
            }
        });
        rowButtons.add(ks);


        this.add(colMain);
    }
View Full Code Here


        this.setMaximizable(false);
        this.setKeystrokeListener(this.createKeyStrokeListener());
        this.setPostOnEnterKey(true);
        this.setCancelOnEscKey(true);

        SplitPane spMain = new SplitPane(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, new JbsExtent(45));

        this.add(spMain);
        spMain.add(initPnButtons());

        pnMain = new JbsContentPane();
        spMain.add(pnMain);
    }
View Full Code Here

     */
    @Override
    protected void initForm() {
        super.initForm();

        ButtonGroup radioGroup = new ButtonGroup();
        Column colMain = new Column();
        Row row1 = new Row();
        row1.setAlignment(Alignment.ALIGN_TOP);
        rbNoDate = new JbsRadioButton();
        rbNoDate.setText(JbsL10N.getString("FmSelectDate.noDate"));
View Full Code Here

     */
    public void testActionListener() {
        ActionHandler buttonActionListener = new ActionHandler();
        ActionHandler modelActionListener = new ActionHandler();
        Button button = new Button("Test");
        ButtonModel model = button.getModel();
        button.addActionListener(buttonActionListener);
        model.addActionListener(modelActionListener);
        assertEquals(0, buttonActionListener.eventCount);
        assertEquals(0, modelActionListener.eventCount);
        button.doAction();
        assertEquals(1, buttonActionListener.eventCount);
        assertEquals(1, modelActionListener.eventCount);
        assertEquals(button, buttonActionListener.lastEvent.getSource());
        assertEquals(model, modelActionListener.lastEvent.getSource());

        buttonActionListener.lastEvent = null;
        modelActionListener.lastEvent = null;
        assertEquals(null, buttonActionListener.lastEvent);
        assertEquals(null, modelActionListener.lastEvent);

        model.doAction();
       
        assertEquals(2, buttonActionListener.eventCount);
        assertEquals(2, modelActionListener.eventCount);
        assertEquals(button, buttonActionListener.lastEvent.getSource());
        assertEquals(model, modelActionListener.lastEvent.getSource());
View Full Code Here

   
    /**
     * @see nextapp.echo2.app.button.AbstractButton#setModel(nextapp.echo2.app.button.ButtonModel)
     */
    public void setModel(ButtonModel newValue) {
        ButtonModel oldValue = getModel();
        super.setModel(newValue);
        if (oldValue != null) {
            ((ToggleButtonModel) oldValue).removeChangeListener(changeMonitor);
        }
        ((ToggleButtonModel) newValue).addChangeListener(changeMonitor);
View Full Code Here

    protected void addAction(String actionCommand) {
        EventListener[] listeners = listenerList.getListeners(ActionListener.class);
        for (int i = 0; i < listeners.length; i++) {
            ActionListener actionListener = (ActionListener) listeners[i];
            try {
                actionListener.actionPerformed(new ActionEvent(JbsDialogWindow.this, actionCommand));
            } catch (Throwable t) {
                logger.error("Error adding action.",t);
            }
        }
    }
View Full Code Here

    protected void addAction(String actionCommand) {
        EventListener[] listeners = listenerList.getListeners(ActionListener.class);
        for (int i = 0; i < listeners.length; i++) {
            ActionListener actionListener = (ActionListener) listeners[i];
            try {
                actionListener.actionPerformed(new ActionEvent(PnEditJbsObject.this, actionCommand));
            } catch (Throwable t) {
                logger.error("Error adding action.",t);
            }
        }
    }
View Full Code Here

        EventListener[] listeners = listenerList.getListeners(ActionListener.class);
        for (int i = 0; i < listeners.length; i++) {
            ActionListener actionListener = (ActionListener) listeners[i];
            try {
                actionListener.actionPerformed(
                        new ActionEvent(JbsOptionPane.this, getActionCommand((Component) e.getSource())));
            } catch (Throwable t) {
                ExceptionHandler.handle(t);
            }
        }
View Full Code Here

    protected final String IMG_DROPDOWN = Styles.IMAGE_PATH + "blank.gif";
   
    public JbsMenuLabel(String text) {
        super();
        this.setBtnMain(new JbsButton(""));
        this.getBtnMain().addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent arg0) {
                logger.debug("popup");
                setExpanded(!isExpanded());
                collapseAllOther();
View Full Code Here

        }
    }
   
    public void addMenuItem(MenuItem menuItem) {
        menuItem.setBorder(BorderEx.NONE);
        menuItem.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                setExpanded(false);
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.button.ButtonModel

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.