Package javax.swing

Examples of javax.swing.Action.actionPerformed()


        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_CENTER);
        ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, null);
        action.actionPerformed(ae);
        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
        ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, "aa");
        action.actionPerformed(ae);
        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
        ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, "");
        action.actionPerformed(ae);
        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
        action.actionPerformed(null);
View Full Code Here


        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
        ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, "aa");
        action.actionPerformed(ae);
        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
        ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, "");
        action.actionPerformed(ae);
        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
        action.actionPerformed(null);
    }

    public void testBoldAction() {
View Full Code Here

        action.actionPerformed(ae);
        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
        ae = new ActionEvent(jep, ActionEvent.ACTION_PERFORMED, "");
        action.actionPerformed(ae);
        checkAttribute(dot, StyleConstants.Alignment, StyleConstants.ALIGN_JUSTIFIED);
        action.actionPerformed(null);
    }

    public void testBoldAction() {
        Action action = new StyledEditorKit.BoldAction();
        checkToggleAction(action, "font-bold", StyleConstants.Bold);
View Full Code Here

        document = ((HTMLDocument)pane.getDocument());
        document.setAsynchronousLoadPriority(-1)// synchronous loading
        pane.setText("<p><a href=http://a.com>a.com</a>text<a href=http://b.com>b.com</a></p>");
        pane.setCaretPosition(0);

        action.actionPerformed(new ActionEvent(pane, 0, null));
        Element e = document.getCharacterElement(pane.getCaretPosition());
        assertEquals("http://a.com", getURLString(e));
        action.actionPerformed(new ActionEvent(pane, 0, null));
        e = document.getCharacterElement(pane.getCaretPosition());
        assertEquals("http://b.com", getURLString(e));
View Full Code Here

        pane.setCaretPosition(0);

        action.actionPerformed(new ActionEvent(pane, 0, null));
        Element e = document.getCharacterElement(pane.getCaretPosition());
        assertEquals("http://a.com", getURLString(e));
        action.actionPerformed(new ActionEvent(pane, 0, null));
        e = document.getCharacterElement(pane.getCaretPosition());
        assertEquals("http://b.com", getURLString(e));
    }

    public void testPreviousLinkAction() throws Exception {
View Full Code Here

        document = ((HTMLDocument)pane.getDocument());
        document.setAsynchronousLoadPriority(-1)// synchronous loading
        pane.setText("<p><a href=http://a.com>a.com</a>text<a href=http://b.com>b.com</a></p>");
        pane.setCaretPosition(document.getLength() - 1);

        action.actionPerformed(new ActionEvent(pane, 0, null));
        Element e = document.getCharacterElement(pane.getCaretPosition());
        assertEquals("http://b.com", getURLString(e));
        action.actionPerformed(new ActionEvent(pane, 0, null));
        e = document.getCharacterElement(pane.getCaretPosition());
        assertEquals("http://a.com", getURLString(e));
View Full Code Here

        pane.setCaretPosition(document.getLength() - 1);

        action.actionPerformed(new ActionEvent(pane, 0, null));
        Element e = document.getCharacterElement(pane.getCaretPosition());
        assertEquals("http://b.com", getURLString(e));
        action.actionPerformed(new ActionEvent(pane, 0, null));
        e = document.getCharacterElement(pane.getCaretPosition());
        assertEquals("http://a.com", getURLString(e));
    }

    public void testActivateLinkAction() throws Exception {
View Full Code Here

        }

        TestHyperlinkListener listener = new TestHyperlinkListener();
        pane.addHyperlinkListener(listener);

        action.actionPerformed(new ActionEvent(pane, 0, null));
        assertTrue(listener.occured);
    }

    public void testInsertHRAction() throws Exception {
        InsertHTMLTextAction action = (InsertHTMLTextAction)findActionWithName(
View Full Code Here

    public void windowClosing(final WindowEvent e)
    {
      final Action cancelAction = getCancelAction();
      if (cancelAction != null)
      {
        cancelAction.actionPerformed(null);
      }
      else
      {
        setConfirmed(false);
        setVisible(false);
View Full Code Here

        for (AbstractButton button : fToolbarButtons) {
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    Action a = actionCommandToActionMap.get(e.getActionCommand());
                    if (a != null) {
                        a.actionPerformed(e);
                    } else {
                        sLogger.error("Corresponding Action not found: "
                                + e.getActionCommand());
                    }
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.