Package javax.accessibility

Examples of javax.accessibility.AccessibleContext


    public void testGetAccessibleContext() {
        if (true) {
            throw new UnsupportedOperationException("Not implemented");
        }
        if (isHarmony()) {
            AccessibleContext accessibleContext = jep.getAccessibleContext();
            assertEquals("javax.swing.JEditorPane$AccessibleJEditorPane",
                    getClassName(accessibleContext));
            assertEquals(jep.getAccessibleContext(), accessibleContext);
            jep.setContentType("text/html");
            assertEquals("javax.swing.JEditorPane$AccessibleJEditorPaneHTML", getClassName(jep
View Full Code Here


    /*
     * Class under test for AccessibleContext getAccessibleContext()
     */
    public void testGetAccessibleContext() {
        AccessibleContext c = frame.getAccessibleContext();
        assertTrue("instanceof AccessibleJInternalFrame",
                c instanceof JInternalFrame.AccessibleJInternalFrame);
        // test getAccessibleName()
        assertTrue("AccessibleName is ok", c.getAccessibleName() == "");
        frame.setTitle("aa");
        assertTrue("AccessibleName is ok", c.getAccessibleName() == "aa");
        // test getAccessibleRole()
        assertTrue("AccessibleRole ok", c.getAccessibleRole() == AccessibleRole.INTERNAL_FRAME);
        // test getAccessibleValue()
        assertTrue("AccessibleValue ok", c.getAccessibleValue() == c);
        // test setCurrentAccessibleValue(), getCurrentAccessibleValue()
        AccessibleValue value = c.getAccessibleValue();
        assertTrue("currentAccessibleValue == 0",
                value.getCurrentAccessibleValue().intValue() == 0);
        Integer currentAccessibleValue = new Integer(4);
        boolean set = value.setCurrentAccessibleValue(currentAccessibleValue);
        assertTrue("setCurrentAccessibleValue returns true", set);
        set = value.setCurrentAccessibleValue(new Float(5));
        assertTrue("setCurrentAccessibleValue returns true", set);
        assertTrue("currentAccessibleValue == 5",
                value.getCurrentAccessibleValue().intValue() == 5);
        assertTrue("the object is not the same",
                value.getCurrentAccessibleValue() != currentAccessibleValue);
        set = value.setCurrentAccessibleValue(null);
        assertFalse("setCurrentAccessibleValue returns false", set);
        // test getMinimumAccessibleValue()
        assertTrue("minimumAccessibleValue ok",
                value.getMinimumAccessibleValue().intValue() == Integer.MIN_VALUE);
        // test getMaximumAccessibleValue()
        assertTrue("maximumAccessibleValue ok",
                value.getMaximumAccessibleValue().intValue() == Integer.MAX_VALUE);
        // test other methods
        assertNull("AccessibleDescription is ok", c.getAccessibleDescription());
        assertTrue("AccessibleChildrenCount == 1", c.getAccessibleChildrenCount() == 1);
    }
View Full Code Here

    private void fireAccessibleStateChange(AccessibleState state, boolean value) {
        if (behaviour.isLightweight()) {
            return;
        }
        AccessibleContext ac = getAccessibleContext();
        if (ac != null) {
            AccessibleState oldValue = null;
            AccessibleState newValue = null;
            if (value) {
                newValue = state;
            } else {
                oldValue = state;
            }
            ac.firePropertyChange(AccessibleContext.ACCESSIBLE_STATE_PROPERTY, oldValue,
                    newValue);
        }
    }
View Full Code Here

        }
              

        protected void handleVisibleDataChanged() {
            if (Paragraph.this.isFocusOwner()) {
                AccessibleContext ac = accessibleContext;
                if (ac != null) {
                    AccessibleText at = ac.getAccessibleText();
                    if (at != null) {
                        int pos = at.getCaretPosition();
                        // Simulating a caret event here should help at tools
                        // that re not aware of the paragraph approach of OOo.
                        firePropertyChange(ac.ACCESSIBLE_CARET_PROPERTY,
View Full Code Here

    /** Returns the AccessibleContext associated with this object */
    public final javax.accessibility.AccessibleContext getAccessibleContext() {
        if (accessibleContext == null) {
            try {
                AccessibleContext ac = createAccessibleContext();
                if (ac != null) {
                    // Set accessible name and description here to avoid
                    // unnecessary property change events later ..
                    ac.setAccessibleName(unoAccessibleContext.getAccessibleName());
                    ac.setAccessibleDescription(unoAccessibleContext.getAccessibleDescription());
                    accessibleContext = ac;
                }
            } catch (com.sun.star.uno.RuntimeException e) {
            }
        }
View Full Code Here

       
        public void run() {
            // Because this code is executed in the DispatchThread, it is better tocatch every
            // exception that might occur
            try {
                AccessibleContext ac = Container.this.accessibleContext;
                if (ac != null) {
                    ac.firePropertyChange(propertyName, oldValue, newValue);
                }
            } catch (java.lang.Exception e) {
                if (Build.DEBUG) {
                    System.err.println(e.getClass().getName() + " caught propagating " + propertyName + " event: " + e.getMessage());
                    e.printStackTrace();
View Full Code Here

    /** Returns the AccessibleContext associated with this object */
    public final javax.accessibility.AccessibleContext getAccessibleContext() {
        if (accessibleContext == null) {
            try {
                AccessibleContext ac = createAccessibleContext();
                if (ac != null) {
                    // Set accessible name and description here to avoid
                    // unnecessary property change events later ..
                    ac.setAccessibleName(unoAccessibleContext.getAccessibleName());
                    ac.setAccessibleDescription(unoAccessibleContext.getAccessibleDescription());
                    accessibleContext = ac;
                }
            } catch (com.sun.star.uno.RuntimeException e) {
            }
        }
View Full Code Here

       
        public void run() {
            // Because this code is executed in the DispatchThread, it is better to catch every
            // exception that might occur
            try {
                AccessibleContext ac = accessibleContext;
                if (ac != null) {
                    ac.firePropertyChange(propertyName, oldValue, newValue);
                }
            } catch (java.lang.Exception e) {
                if (Build.DEBUG) {
                    System.err.println(e.getClass().getName() + " caught propagating " + propertyName + " event: " + e.getMessage());
                    e.printStackTrace();
View Full Code Here

  public void test(TestHarness harness)
  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleContext ac0ac = ac0.getAccessibleContext();
    harness.check(ac0, ac0ac);
  }
View Full Code Here

  public void test(TestHarness harness)
  {
    DefaultTableModel tm = new DefaultTableModel(new String[] {"AA", "BB", "CC"}, 3);
    JTable t = new JTable(tm);
    JTableHeader th = t.getTableHeader();
    AccessibleContext ac = th.getAccessibleContext();
    Accessible ac0 = ac.getAccessibleChild(0);
    harness.check(ac0.getClass().getName().endsWith("AccessibleJTableHeaderEntry"));
    AccessibleContext ac0ac = ac0.getAccessibleContext();
    harness.check(ac0ac.getAccessibleDescription(), null);
    ac0ac.setAccessibleDescription("AAx");
    harness.check(ac0ac.getAccessibleDescription(), "AAx");
  }
View Full Code Here

TOP

Related Classes of javax.accessibility.AccessibleContext

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.