Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8264305: Create implementation for native accessibility peer for Statusbar java role #4307

Closed
wants to merge 1 commit into from

Conversation

@pankaj-bansal
Copy link

@pankaj-bansal pankaj-bansal commented Jun 2, 2021

Create implementation for native accessibility peer for Statusbar java role. I do not see any Swing component with StatusBar accessibility role, so I have created a component with the StatusBar role to test this. I have tested the implementation with the following example and a few more similar examples. I do not see any difference in Voice Over output.
`

import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleStateSet;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.border.BevelBorder;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DateFormat;

public class StatusBarDemo {

    public static void main(String[] args) throws Exception {
        StatusBarDemo demo = new StatusBarDemo();
        SwingUtilities.invokeAndWait(demo::createAndShowGUI);
    }

    void createAndShowGUI() {
        JFrame jframe = new JFrame("StatusBar Demo");
        jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jframe.setLayout(new BorderLayout());
        jframe.setSize(200, 200);

        // create the status bar panel and shove it down the bottom of the frame
        JPanel statusPanel = new StatusBar();
        statusPanel.setBorder(new BevelBorder(BevelBorder.LOWERED));
        statusPanel.setPreferredSize(new Dimension(jframe.getWidth(), 16));
        statusPanel.setLayout(new BorderLayout());

        JLabel date = new JLabel();
        date.setOpaque(true);
        date.setBackground(Color.black);
        date.setForeground(Color.WHITE);
        statusPanel.setLayout(new BorderLayout());
        statusPanel.setBackground(Color.LIGHT_GRAY);
        statusPanel.add(date, BorderLayout.CENTER);


        Timer timer = new javax.swing.Timer(1000, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                java.util.Date now = new java.util.Date();
                String ss = DateFormat.getDateTimeInstance().format(now);
                date.setText(ss);
                date.setToolTipText("Welcome, Today is " + ss);

            }
        });

        timer.start();

        jframe.add(statusPanel, BorderLayout.SOUTH);

        jframe.setLocationRelativeTo(null);
        jframe.setVisible(true);
    }

    class StatusBar extends JPanel implements Accessible {

        AccessibleContext accessibleContext;

        public AccessibleContext getAccessibleContext() {
            if (accessibleContext == null) {
                accessibleContext = new StatusBar.AccessibleJStatusBar();
            }
            return accessibleContext;
        }

        protected class AccessibleJStatusBar extends AccessibleJComponent {
            public AccessibleStateSet getAccessibleStateSet() {
                AccessibleStateSet states = super.getAccessibleStateSet();
                return states;
            }
            public AccessibleRole getAccessibleRole() {
                return AccessibleRole.STATUS_BAR;
            }
        }
    }
}

`


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8264305: Create implementation for native accessibility peer for Statusbar java role

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4307/head:pull/4307
$ git checkout pull/4307

Update a local copy of the PR:
$ git checkout pull/4307
$ git pull https://git.openjdk.java.net/jdk pull/4307/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4307

View PR using the GUI difftool:
$ git pr show -t 4307

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4307.diff

@pankaj-bansal pankaj-bansal marked this pull request as ready for review Jun 2, 2021
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 2, 2021

👋 Welcome back pbansal! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Jun 2, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 2, 2021

@pankaj-bansal The following label will be automatically applied to this pull request:

  • awt

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the awt label Jun 2, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 2, 2021

Webrevs

@openjdk
Copy link

@openjdk openjdk bot commented Jun 4, 2021

@pankaj-bansal This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8264305: Create implementation for native accessibility peer for Statusbar java role

Reviewed-by: kizune

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 114 new commits pushed to the master branch:

  • edca245: 8267917: mark hotspot containers tests which ignore external VM flags
  • 05df172: 8268224: Cleanup references to "strictfp" in core lib comments
  • 516e60a: 8268095: CDS MethodHandle tests should add -XX:-VerifyDependencies
  • c1f3094: 8267939: Clarify the specification of iterator and spliterator forEachRemaining
  • 460ce55: 8266019: StreamResult(File) writes to incorrect file path if # is part of the file path
  • b955865: 8267995: Add reference to JVMS class file format in Lookup::defineHiddenClass
  • 9f05c41: 8265783: Create a separate library for x86 Intel SVML assembly intrinsics
  • e27c4d4: 8268185: Update GitHub Actions for jtreg 6
  • 68ac871: 8268189: ProblemList compiler/intrinsics/bmi/verifycode/BzhiTestI2L.java in -Xcomp mode
  • af3df63: 8267598: jpackage removes system libraries from java.library.path
  • ... and 104 more: https://git.openjdk.java.net/jdk/compare/10a6f5d637053395839002b6617f94f49d3701e7...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Jun 4, 2021
@pankaj-bansal
Copy link
Author

@pankaj-bansal pankaj-bansal commented Jun 4, 2021

/integrate

@openjdk openjdk bot closed this Jun 4, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jun 4, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 4, 2021

@pankaj-bansal Since your change was applied there have been 116 commits pushed to the master branch:

  • e2d5ff9: 8268214: Use system zlib and disable dtrace when building linux-aarch64 at Oracle
  • 1b4378e: 8268142: Switch to jdk-17+24 for macosx-aarch64 at Oracle
  • edca245: 8267917: mark hotspot containers tests which ignore external VM flags
  • 05df172: 8268224: Cleanup references to "strictfp" in core lib comments
  • 516e60a: 8268095: CDS MethodHandle tests should add -XX:-VerifyDependencies
  • c1f3094: 8267939: Clarify the specification of iterator and spliterator forEachRemaining
  • 460ce55: 8266019: StreamResult(File) writes to incorrect file path if # is part of the file path
  • b955865: 8267995: Add reference to JVMS class file format in Lookup::defineHiddenClass
  • 9f05c41: 8265783: Create a separate library for x86 Intel SVML assembly intrinsics
  • e27c4d4: 8268185: Update GitHub Actions for jtreg 6
  • ... and 106 more: https://git.openjdk.java.net/jdk/compare/10a6f5d637053395839002b6617f94f49d3701e7...master

Your commit was automatically rebased without conflicts.

Pushed as commit 3025f05.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants