mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
patch from Tanya Wolff - Added an accessibleListener to the Build Behaviour properties page for a Make project. This listener is used by the input fields that don't have labels so that MS Inspect Objects or a Screen reader can get the Name object info.
This commit is contained in:
parent
95f7a24e4c
commit
00bbe82978
2 changed files with 29 additions and 3 deletions
|
@ -48,7 +48,10 @@ SettingsBlock.makeWorkbench.autobuildMessage=See Workbench automatic build prefe
|
||||||
SettingsBlock.makeWorkbench.incremental=Build (Incremental Build)
|
SettingsBlock.makeWorkbench.incremental=Build (Incremental Build)
|
||||||
SettingsBlock.makeWorkbench.full=Rebuild (Full Build)
|
SettingsBlock.makeWorkbench.full=Rebuild (Full Build)
|
||||||
SettingsBlock.makeWorkbench.clean=Clean
|
SettingsBlock.makeWorkbench.clean=Clean
|
||||||
|
SettingsBlock.makeWorkbench.autoBuildTarget=Auto Build Target
|
||||||
|
SettingsBlock.makeWorkbench.incrementalBuildTarget=Incremental Build Target
|
||||||
|
SettingsBlock.makeWorkbench.fullBuildTarget=Full Build Target
|
||||||
|
SettingsBlock.makeWorkbench.cleanTarget=Clean Target
|
||||||
TargetBlock.target.group_label=Target
|
TargetBlock.target.group_label=Target
|
||||||
TargetBlock.target.label=Target Name:
|
TargetBlock.target.label=Target Name:
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@ import org.eclipse.jface.util.IPropertyChangeListener;
|
||||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||||
import org.eclipse.jface.window.Window;
|
import org.eclipse.jface.window.Window;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.accessibility.AccessibleAdapter;
|
||||||
|
import org.eclipse.swt.accessibility.AccessibleEvent;
|
||||||
import org.eclipse.swt.events.DisposeEvent;
|
import org.eclipse.swt.events.DisposeEvent;
|
||||||
import org.eclipse.swt.events.DisposeListener;
|
import org.eclipse.swt.events.DisposeListener;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
|
@ -34,6 +36,7 @@ import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Event;
|
import org.eclipse.swt.widgets.Event;
|
||||||
import org.eclipse.swt.widgets.Group;
|
import org.eclipse.swt.widgets.Group;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
@ -67,6 +70,11 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
private static final String MAKE_BUILD_DIR_LABEL = PREFIX + ".makeDir.label"; //$NON-NLS-1$
|
private static final String MAKE_BUILD_DIR_LABEL = PREFIX + ".makeDir.label"; //$NON-NLS-1$
|
||||||
private static final String MAKE_BUILD_DIR_BROWSE = PREFIX + ".makeDir.browse"; //$NON-NLS-1$
|
private static final String MAKE_BUILD_DIR_BROWSE = PREFIX + ".makeDir.browse"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
private static final String MAKE_BUILD_AUTO_TARGET = PREFIX + ".makeWorkbench.autoBuildTarget"; //$NON-NLS-1$
|
||||||
|
private static final String MAKE_BUILD_INCREMENTAL_TARGET = PREFIX + ".makeWorkbench.incrementalBuildTarget"; //$NON-NLS-1$
|
||||||
|
private static final String MAKE_BUILD_FULL_TARGET = PREFIX + ".makeWorkbench.fullBuildTarget"; //$NON-NLS-1$
|
||||||
|
private static final String MAKE_BUILD_CLEAN_TARGET = PREFIX + ".makeWorkbench.cleanTarget"; //$NON-NLS-1$
|
||||||
|
|
||||||
Button stopOnErrorButton;
|
Button stopOnErrorButton;
|
||||||
|
|
||||||
Button defButton;
|
Button defButton;
|
||||||
|
@ -133,6 +141,7 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING;
|
((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING;
|
||||||
((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false;
|
((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false;
|
||||||
buildCommand = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);
|
buildCommand = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);
|
||||||
|
|
||||||
((GridData) (buildCommand.getLayoutData())).horizontalAlignment = GridData.FILL;
|
((GridData) (buildCommand.getLayoutData())).horizontalAlignment = GridData.FILL;
|
||||||
((GridData) (buildCommand.getLayoutData())).grabExcessHorizontalSpace = true;
|
((GridData) (buildCommand.getLayoutData())).grabExcessHorizontalSpace = true;
|
||||||
buildCommand.addListener(SWT.Modify, new Listener() {
|
buildCommand.addListener(SWT.Modify, new Listener() {
|
||||||
|
@ -188,6 +197,7 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
targetAuto.setText(fBuildInfo.getAutoBuildTarget());
|
targetAuto.setText(fBuildInfo.getAutoBuildTarget());
|
||||||
((GridData) (targetAuto.getLayoutData())).horizontalAlignment = GridData.FILL;
|
((GridData) (targetAuto.getLayoutData())).horizontalAlignment = GridData.FILL;
|
||||||
((GridData) (targetAuto.getLayoutData())).grabExcessHorizontalSpace = true;
|
((GridData) (targetAuto.getLayoutData())).grabExcessHorizontalSpace = true;
|
||||||
|
addControlAccessibleListener(targetAuto, MakeUIPlugin.getResourceString(MAKE_BUILD_AUTO_TARGET));
|
||||||
String noteTitle= MakeUIPlugin.getResourceString("SettingsBlock.makeWorkbench.note"); //$NON-NLS-1$
|
String noteTitle= MakeUIPlugin.getResourceString("SettingsBlock.makeWorkbench.note"); //$NON-NLS-1$
|
||||||
String noteMessage= MakeUIPlugin.getResourceString("SettingsBlock.makeWorkbench.autobuildMessage"); //$NON-NLS-1$
|
String noteMessage= MakeUIPlugin.getResourceString("SettingsBlock.makeWorkbench.autobuildMessage"); //$NON-NLS-1$
|
||||||
Composite noteControl= createNoteComposite(JFaceResources.getDialogFont(), group, noteTitle, noteMessage);
|
Composite noteControl= createNoteComposite(JFaceResources.getDialogFont(), group, noteTitle, noteMessage);
|
||||||
|
@ -201,6 +211,7 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
targetIncr.setText(fBuildInfo.getIncrementalBuildTarget());
|
targetIncr.setText(fBuildInfo.getIncrementalBuildTarget());
|
||||||
((GridData) (targetIncr.getLayoutData())).horizontalAlignment = GridData.FILL;
|
((GridData) (targetIncr.getLayoutData())).horizontalAlignment = GridData.FILL;
|
||||||
((GridData) (targetIncr.getLayoutData())).grabExcessHorizontalSpace = true;
|
((GridData) (targetIncr.getLayoutData())).grabExcessHorizontalSpace = true;
|
||||||
|
addControlAccessibleListener(targetIncr, MakeUIPlugin.getResourceString(MAKE_BUILD_INCREMENTAL_TARGET));
|
||||||
fullButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_FULL));
|
fullButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_FULL));
|
||||||
fullButton.addSelectionListener(selectionAdapter);
|
fullButton.addSelectionListener(selectionAdapter);
|
||||||
fullButton.setSelection(fBuildInfo.isFullBuildEnabled());
|
fullButton.setSelection(fBuildInfo.isFullBuildEnabled());
|
||||||
|
@ -208,7 +219,7 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
targetFull.setText(fBuildInfo.getFullBuildTarget());
|
targetFull.setText(fBuildInfo.getFullBuildTarget());
|
||||||
((GridData) (targetFull.getLayoutData())).horizontalAlignment = GridData.FILL;
|
((GridData) (targetFull.getLayoutData())).horizontalAlignment = GridData.FILL;
|
||||||
((GridData) (targetFull.getLayoutData())).grabExcessHorizontalSpace = true;
|
((GridData) (targetFull.getLayoutData())).grabExcessHorizontalSpace = true;
|
||||||
|
addControlAccessibleListener(targetFull, MakeUIPlugin.getResourceString(MAKE_BUILD_FULL_TARGET));
|
||||||
cleanButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_CLEAN));
|
cleanButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_WORKBENCH_BUILD_CLEAN));
|
||||||
cleanButton.addSelectionListener(selectionAdapter);
|
cleanButton.addSelectionListener(selectionAdapter);
|
||||||
cleanButton.setSelection(fBuildInfo.isCleanBuildEnabled());
|
cleanButton.setSelection(fBuildInfo.isCleanBuildEnabled());
|
||||||
|
@ -216,6 +227,7 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
targetClean.setText(fBuildInfo.getCleanBuildTarget());
|
targetClean.setText(fBuildInfo.getCleanBuildTarget());
|
||||||
((GridData) (targetClean.getLayoutData())).horizontalAlignment = GridData.FILL;
|
((GridData) (targetClean.getLayoutData())).horizontalAlignment = GridData.FILL;
|
||||||
((GridData) (targetClean.getLayoutData())).grabExcessHorizontalSpace = true;
|
((GridData) (targetClean.getLayoutData())).grabExcessHorizontalSpace = true;
|
||||||
|
addControlAccessibleListener(targetClean, MakeUIPlugin.getResourceString(MAKE_BUILD_CLEAN_TARGET));
|
||||||
selectionAdapter.widgetSelected(null);
|
selectionAdapter.widgetSelected(null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -262,7 +274,18 @@ public class SettingsBlock extends AbstractCOptionPage {
|
||||||
messageLabel.setFont(font);
|
messageLabel.setFont(font);
|
||||||
return messageComposite;
|
return messageComposite;
|
||||||
}
|
}
|
||||||
|
public void addControlAccessibleListener(Control control, String controlName) {
|
||||||
|
control.getAccessible().addAccessibleListener(new ControlAccessibleListener(controlName));
|
||||||
|
}
|
||||||
|
private class ControlAccessibleListener extends AccessibleAdapter {
|
||||||
|
private String controlName;
|
||||||
|
ControlAccessibleListener(String name){
|
||||||
|
controlName = name;
|
||||||
|
}
|
||||||
|
public void getName(AccessibleEvent e) {
|
||||||
|
e.result = controlName;
|
||||||
|
}
|
||||||
|
}
|
||||||
protected void createBuilderWorkingDirControls(Composite parent) {
|
protected void createBuilderWorkingDirControls(Composite parent) {
|
||||||
Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_GROUP), 1);
|
Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_BUILD_DIR_GROUP), 1);
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
|
|
Loading…
Add table
Reference in a new issue