Java Code Examples for javax.accessibility.AccessibleContext#setAccessibleName()

The following examples show how to use javax.accessibility.AccessibleContext#setAccessibleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResultPanelTree.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@NbBundle.Messages({"ACSN_HorizontalScrollbar=Horizontal scrollbar of the results panel",
    "ACSN_VerticalScrollbar=Vertical scrollbar of the results panel"})
private void initAccessibility() {
    AccessibleContext accessCtx;

    accessCtx = getAccessibleContext();
    accessCtx.setAccessibleName(Bundle.ACSN_ResultPanelTree());
    accessCtx.setAccessibleDescription(Bundle.ACSD_ResultPanelTree());

    accessCtx = treeView.getHorizontalScrollBar().getAccessibleContext();
    accessCtx.setAccessibleName(Bundle.ACSN_HorizontalScrollbar());

    accessCtx = treeView.getVerticalScrollBar().getAccessibleContext();
    accessCtx.setAccessibleName(Bundle.ACSN_VerticalScrollbar());

}
 
Example 2
Source File: BasicAbstractResultsPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initAccessibility() {
    ResourceBundle bundle = NbBundle.getBundle(ResultView.class);

    AccessibleContext accessCtx;
    OutlineView outlineView = resultsOutlineSupport.getOutlineView();

    accessCtx = outlineView.getHorizontalScrollBar().getAccessibleContext();
    accessCtx.setAccessibleName(
            bundle.getString("ACSN_HorizontalScrollbar"));          //NOI18N

    accessCtx = outlineView.getVerticalScrollBar().getAccessibleContext();
    accessCtx.setAccessibleName(
            bundle.getString("ACSN_VerticalScrollbar"));            //NOI18N

    accessCtx = outlineView.getAccessibleContext();
    accessCtx.setAccessibleName(
            bundle.getString("ACSN_ResultTree"));                   //NOI18N
    accessCtx.setAccessibleDescription(
            bundle.getString("ACSD_ResultTree"));                   //NOI18N
}
 
Example 3
Source File: BasicInternalFrameTitlePane.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 4
Source File: BasicInternalFrameTitlePane.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 5
Source File: BasicInternalFrameTitlePane.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 6
Source File: ResultWindow.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Creates a new instance of ResultWindow */
@NbBundle.Messages({"TITLE_TEST_RESULTS=Test Results",
    "ACSN_TestResults=Test Results",
    "ACSD_TestResults=Displays information about passed and failed tests and output generated by them"})
public ResultWindow() {
    super();
    setFocusable(true);
    setLayout(new BorderLayout());

    setName(ID);
    setDisplayName(Bundle.TITLE_TEST_RESULTS());
    setIcon(ImageUtilities.loadImage( "org/netbeans/modules/gsf/testrunner/ui/resources/testResults.png", true));//NOI18N
     
    AccessibleContext accContext = getAccessibleContext();
    accContext.setAccessibleName(Bundle.ACSN_TestResults());
    accContext.setAccessibleDescription(Bundle.ACSD_TestResults());

    pop = new JPopupMenu();
    pop.add(new Close());
    pop.add(new CloseAll());
    pop.add(new CloseAllButCurrent());
    popL = new PopupListener();
    closeL = new CloseListener();

    tabPane = TabbedPaneFactory.createCloseButtonTabbedPane();
    tabPane.setMinimumSize(new Dimension(0, 0));
    tabPane.addMouseListener(popL);
    tabPane.addPropertyChangeListener(closeL);
    add(tabPane);
}
 
Example 7
Source File: ResultTreeView.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@NbBundle.Messages({"ACSN_ResultPanelTree=Information about passed and failed tests",
"ACSD_ResultPanelTree=Displays in a tree structure information about passed, failed and erroneous tests"})
private void initAccessibility() {
    AccessibleContext accContext = tree.getAccessibleContext();
    accContext.setAccessibleName(Bundle.ACSN_ResultPanelTree());
    accContext.setAccessibleDescription(Bundle.ACSD_ResultPanelTree());
}
 
Example 8
Source File: BasicInternalFrameTitlePane.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 9
Source File: BasicInternalFrameTitlePane.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 10
Source File: BasicInternalFrameTitlePane.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 11
Source File: BasicInternalFrameTitlePane.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 12
Source File: BasicInternalFrameTitlePane.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 13
Source File: BasicInternalFrameTitlePane.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 14
Source File: SubstanceTitleButton.java    From radiance with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public AccessibleContext getAccessibleContext() {
	AccessibleContext ac = super.getAccessibleContext();
	if (uiKey != null) {
		ac.setAccessibleName(UIManager.getString(uiKey));
		uiKey = null;
	}
	return ac;
}
 
Example 15
Source File: BasicInternalFrameTitlePane.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 16
Source File: BasicInternalFrameTitlePane.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 17
Source File: BasicInternalFrameTitlePane.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 18
Source File: BasicInternalFrameTitlePane.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public AccessibleContext getAccessibleContext() {
    AccessibleContext ac = super.getAccessibleContext();
    if (uiKey != null) {
        ac.setAccessibleName(UIManager.getString(uiKey));
        uiKey = null;
    }
    return ac;
}
 
Example 19
Source File: BeanTablePanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private void initComponents() {
	jScrollPane1 = new javax.swing.JScrollPane();
	southPanel = new javax.swing.JPanel();
	buttonPanel = new javax.swing.JPanel();
	addButton = new javax.swing.JButton();
	editButton = new javax.swing.JButton();
	removeButton = new javax.swing.JButton();
	rightPanel = new javax.swing.JPanel();

	setLayout(new java.awt.BorderLayout());
	add(jScrollPane1, java.awt.BorderLayout.CENTER);
	southPanel.setLayout(new java.awt.BorderLayout());

       String buttonText = bundle.getString("LBL_New");
       int mnemonicIndex = buttonText.indexOf(bundle.getString("MNC_New").charAt(0));
       if(mnemonicIndex < 0) {
           mnemonicIndex = 0;
       }
       addButton.setText(buttonText); //NOI18N
       addButton.setDisplayedMnemonicIndex(mnemonicIndex);
       AccessibleContext accessibleContext = addButton.getAccessibleContext();
	accessibleContext.setAccessibleName(bundle.getString("ACSN_New"));	// NOI18N
	accessibleContext.setAccessibleDescription(bundle.getString("ACSD_New"));	// NOI18N
	buttonPanel.add(addButton);

       buttonText = bundle.getString("LBL_Edit");
       mnemonicIndex = buttonText.indexOf(bundle.getString("MNC_Edit").charAt(0));
       if(mnemonicIndex < 0) {
           mnemonicIndex = 0;
       }
       editButton.setText(buttonText); //NOI18N
       editButton.setDisplayedMnemonicIndex(mnemonicIndex);
	editButton.setEnabled(false);
	accessibleContext = editButton.getAccessibleContext();
	accessibleContext.setAccessibleName(bundle.getString("ACSN_Edit"));	// NOI18N
	accessibleContext.setAccessibleDescription(bundle.getString("ACSD_Edit"));	// NOI18N
	buttonPanel.add(editButton);

       buttonText = bundle.getString("LBL_Delete");
       mnemonicIndex = buttonText.indexOf(bundle.getString("MNC_Delete").charAt(0));
       if(mnemonicIndex < 0) {
           mnemonicIndex = 0;
       }
       removeButton.setText(buttonText); //NOI18N
       removeButton.setDisplayedMnemonicIndex(mnemonicIndex);
	removeButton.setEnabled(false);
	accessibleContext = removeButton.getAccessibleContext();
	accessibleContext.setAccessibleName(bundle.getString("ACSN_Delete"));	// NOI18N
	accessibleContext.setAccessibleDescription(bundle.getString("ACSD_Delete"));	// NOI18N
	buttonPanel.add(removeButton);

	southPanel.add(buttonPanel, java.awt.BorderLayout.CENTER);
	southPanel.add(rightPanel, java.awt.BorderLayout.EAST);
	add(southPanel, java.awt.BorderLayout.SOUTH);
}
 
Example 20
Source File: DashboardViewer.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private DashboardViewer() {
    expandedNodes = new HashMap<TreeListNode, Boolean>();
    dashboardComponent = new JScrollPane() {
        @Override
        public void requestFocus() {
            Component view = getViewport().getView();
            if (view != null) {
                view.requestFocus();
            } else {
                super.requestFocus();
            }
        }

        @Override
        public boolean requestFocusInWindow() {
            Component view = getViewport().getView();
            return view != null ? view.requestFocusInWindow() : super.requestFocusInWindow();
        }
    };
    dashboardComponent.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    dashboardComponent.setBorder(BorderFactory.createEmptyBorder());
    dashboardComponent.setBackground(ColorManager.getDefault().getDefaultBackground());
    dashboardComponent.getViewport().setBackground(ColorManager.getDefault().getDefaultBackground());
    mapCategoryToNode = new HashMap<Category, CategoryNode>();
    mapRepositoryToNode = new HashMap<String, RepositoryNode>();
    mapRepositoryToUnsubmittedNode = new HashMap<RepositoryImpl, UnsubmittedCategoryNode>();
    categoryNodes = new ArrayList<CategoryNode>();
    repositoryNodes = new ArrayList<RepositoryNode>();

    LinkButton btnAddCategory = new LinkButton(ImageUtilities.loadImageIcon("org/netbeans/modules/bugtracking/tasks/resources/add_category.png", true), new CreateCategoryAction()); //NOI18N
    btnAddCategory.setToolTipText(NbBundle.getMessage(DashboardViewer.class, "LBL_CreateCategory")); // NOI18N
    LinkButton btnClearCategories = new LinkButton(ImageUtilities.loadImageIcon("org/netbeans/modules/bugtracking/tasks/resources/clear.png", true), new Actions.ClearCategoriesAction());
    btnClearCategories.setToolTipText(NbBundle.getMessage(DashboardViewer.class, "LBL_ClearCategories")); // NOI18N
    titleCategoryNode = new TitleNode(NbBundle.getMessage(TitleNode.class, "LBL_Categories"), btnAddCategory, btnClearCategories); // NOI18N

    LinkButton btnAddRepo = new LinkButton(ImageUtilities.loadImageIcon("org/netbeans/modules/bugtracking/tasks/resources/add_repo.png", true), new CreateRepositoryAction()); //NOI18N
    btnAddRepo.setToolTipText(NbBundle.getMessage(DashboardViewer.class, "LBL_AddRepo")); // NOI18N
    titleRepositoryNode = new TitleNode(NbBundle.getMessage(TitleNode.class, "LBL_Repositories"), btnAddRepo); // NOI18N

    AbstractAction reloadAction = new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent e) {
            loadData();
        }
    };
    errorRepositories = new ErrorNode(NbBundle.getMessage(TitleNode.class, "ERR_Repositories"), reloadAction); // NOI18N
    errorCategories = new ErrorNode(NbBundle.getMessage(TitleNode.class, "ERR_Categories"), reloadAction); // NOI18N

    modelListener = new ModelListener();
    model.addModelListener(modelListener);
    model.addRoot(-1, titleCategoryNode);
    model.addRoot(-1, titleRepositoryNode);

    AccessibleContext accessibleContext = treeList.getAccessibleContext();
    String a11y = NbBundle.getMessage(DashboardViewer.class, "A11Y_TeamProjects"); //NOI18N
    accessibleContext.setAccessibleName(a11y);
    accessibleContext.setAccessibleDescription(a11y);
    appliedTaskFilters = new AppliedFilters<TaskNode>();
    appliedCategoryFilters = new AppliedFilters<CategoryNode>();
    appliedRepositoryFilters = new AppliedFilters<RepositoryNode>();
    appliedCategoryFilters.addFilter(new UnsubmittedCategoryFilter());
    taskHits = 0;
    treeList.setTransferHandler(new DashboardTransferHandler());
    treeList.setDragEnabled(true);
    treeList.setDropMode(DropMode.ON_OR_INSERT);
    treeList.setModel(model);
    attachActions();
    dashboardComponent.setViewportView(treeList);
    dashboardComponent.invalidate();
    dashboardComponent.revalidate();
    dashboardComponent.repaint();
}