Search in sources :

Example 6 with AccessibleContext

use of javax.accessibility.AccessibleContext in project jdk8u_jdk by JetBrains.

the class BasicComboPopup method getAccessibleContext.

//
// end Autoscroll methods
//=================================================================
//===================================================================
// begin Utility methods
//
/**
     * Gets the AccessibleContext associated with this BasicComboPopup.
     * The AccessibleContext will have its parent set to the ComboBox.
     *
     * @return an AccessibleContext for the BasicComboPopup
     * @since 1.5
     */
public AccessibleContext getAccessibleContext() {
    AccessibleContext context = super.getAccessibleContext();
    context.setAccessibleParent(comboBox);
    return context;
}
Also used : AccessibleContext(javax.accessibility.AccessibleContext)

Example 7 with AccessibleContext

use of javax.accessibility.AccessibleContext in project jdk8u_jdk by JetBrains.

the class bug6986385 method main.

public static void main(String... args) throws Exception {
    JLayer l = new JLayer();
    AccessibleContext acc = l.getAccessibleContext();
    if (acc == null) {
        throw new RuntimeException("JLayer's AccessibleContext is null");
    }
    if (acc.getAccessibleRole() != AccessibleRole.PANEL) {
        throw new RuntimeException("JLayer's AccessibleRole must be PANEL");
    }
}
Also used : AccessibleContext(javax.accessibility.AccessibleContext)

Example 8 with AccessibleContext

use of javax.accessibility.AccessibleContext in project jdk8u_jdk by JetBrains.

the class Bug8154069 method main.

public static void main(String[] args) throws Exception {
    try {
        try {
            UIManager.setLookAndFeel(new NimbusLookAndFeel());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        SwingUtilities.invokeAndWait(() -> {
            frame = new JFrame();
            String[] petStrings = { "Bird", "Cat" };
            JComboBox<String> cb = new JComboBox<>(petStrings);
            // select Cat
            cb.setSelectedIndex(1);
            frame.add(cb);
            frame.pack();
            try {
                cb.setSelectedIndex(-1);
                int i = cb.getSelectedIndex();
                if (i != -1) {
                    throw new RuntimeException("getSelectedIndex is not -1");
                }
                Object o = cb.getSelectedItem();
                if (o != null) {
                    throw new RuntimeException("getSelectedItem is not null");
                }
                AccessibleContext ac = cb.getAccessibleContext();
                AccessibleSelection as = ac.getAccessibleSelection();
                int count = as.getAccessibleSelectionCount();
                if (count != 0) {
                    throw new RuntimeException("getAccessibleSelection count is not 0");
                }
                Accessible a = as.getAccessibleSelection(0);
                if (a != null) {
                    throw new RuntimeException("getAccessibleSelection(0) is not null");
                }
            } catch (Exception e) {
                exception = e;
            }
        });
        if (exception != null) {
            System.out.println("Test failed: " + exception.getMessage());
            throw exception;
        } else {
            System.out.println("Test passed.");
        }
    } finally {
        SwingUtilities.invokeAndWait(() -> {
            frame.dispose();
        });
    }
}
Also used : JComboBox(javax.swing.JComboBox) AccessibleContext(javax.accessibility.AccessibleContext) AccessibleSelection(javax.accessibility.AccessibleSelection) JFrame(javax.swing.JFrame) NimbusLookAndFeel(javax.swing.plaf.nimbus.NimbusLookAndFeel) Accessible(javax.accessibility.Accessible)

Aggregations

AccessibleContext (javax.accessibility.AccessibleContext)8 JBScrollPane (com.intellij.ui.components.JBScrollPane)3 ActionEvent (java.awt.event.ActionEvent)3 DynamicWizard (com.android.tools.idea.wizard.dynamic.DynamicWizard)2 JBCardLayout (com.intellij.ui.JBCardLayout)2 Accessible (javax.accessibility.Accessible)2 Nullable (org.jetbrains.annotations.Nullable)2 FormFactor (com.android.tools.idea.npw.FormFactor)1 ModuleTemplate (com.android.tools.idea.npw.ModuleTemplate)1 ATTR_INCLUDE_FORM_FACTOR (com.android.tools.idea.templates.TemplateMetadata.ATTR_INCLUDE_FORM_FACTOR)1 ASGallery (com.android.tools.idea.ui.ASGallery)1 DEFAULT_GALLERY_THUMBNAIL_SIZE (com.android.tools.idea.wizard.WizardConstants.DEFAULT_GALLERY_THUMBNAIL_SIZE)1 ModelWizard (com.android.tools.idea.wizard.model.ModelWizard)1 ModelWizardStep (com.android.tools.idea.wizard.model.ModelWizardStep)1 SkippableWizardStep (com.android.tools.idea.wizard.model.SkippableWizardStep)1 FormScalingUtil (com.android.tools.swing.util.FormScalingUtil)1 Function (com.google.common.base.Function)1 Lists (com.google.common.collect.Lists)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 JBColor (com.intellij.ui.JBColor)1