1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 23:55:26 +02:00

[210142] for accessibility need transfer mode toggle button

This commit is contained in:
David McKnight 2007-11-16 21:02:55 +00:00
parent c224183f23
commit 9f9b7cadc1
3 changed files with 43 additions and 1 deletions

View file

@ -12,6 +12,7 @@
*
* Contributors:
* David Dykstal (IBM) - 176488: adding some text for the cache limit checkbox
* David McKnight(IBM) - [210142] for accessability need transfer mode toggle button
********************************************************************************/
package org.eclipse.rse.internal.files.ui;
@ -100,6 +101,10 @@ public class FileResources extends NLS
public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_REMOVEBUTTON_LABEL;
public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_REMOVEBUTTON_TOOLTIP;
public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_TOGGLEBUTTON_LABEL;
public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_TOGGLEBUTTON_TOOLTIP;
public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_LABEL;
public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TOOLTIP;

View file

@ -12,6 +12,7 @@
#
# Contributors:
# David Dykstal (IBM) - 176488: adding some text for the cache limit checkbox
# David McKnight(IBM) - [210142] for accessability need transfer mode toggle button
################################################################################
# NLS_MESSAGEFORMAT_VAR
@ -96,6 +97,9 @@ RESID_PREF_UNIVERSAL_FILES_FILETYPES_ADDBUTTON_TOOLTIP=Add a file type
RESID_PREF_UNIVERSAL_FILES_FILETYPES_REMOVEBUTTON_LABEL=Remove
RESID_PREF_UNIVERSAL_FILES_FILETYPES_REMOVEBUTTON_TOOLTIP=Remove selected file type
RESID_PREF_UNIVERSAL_FILES_FILETYPES_TOGGLEBUTTON_LABEL=Toggle
RESID_PREF_UNIVERSAL_FILES_FILETYPES_TOGGLEBUTTON_TOOLTIP=Toggle between binary and text transfer mode
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_LABEL=File Transfer Mode
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TOOLTIP=Mode of file transfer for selected file type

View file

@ -15,6 +15,7 @@
* David McKnight (IBM) - [207178] changing list APIs for file service and subsystems
* David McKnight (IBM) - [208951] no longer used editor registry for file type associations
* David McKnight (IBM) - [203114] Usability improvements for file transfer mode prefs
* David McKnight (IBM) - [210142] for accessability need transfer mode toggle button
********************************************************************************/
package org.eclipse.rse.internal.files.ui.propertypages;
@ -96,7 +97,8 @@ public class UniversalPreferencePage
protected Table resourceTypeTable;
protected Button addResourceTypeButton;
protected Button removeResourceTypeButton;
protected Button toggleModeButton;
protected Button doSuperTransferButton;
protected Button defaultBinaryButton;
@ -209,6 +211,18 @@ public class UniversalPreferencePage
data.widthHint = Math.max(widthHint, removeResourceTypeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
removeResourceTypeButton.setLayoutData(data);
toggleModeButton = new Button(groupComponent, SWT.PUSH);
toggleModeButton.setText(FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_TOGGLEBUTTON_LABEL);
toggleModeButton.setToolTipText(FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_TOGGLEBUTTON_TOOLTIP);
toggleModeButton.addListener(SWT.Selection, this);
data = new GridData();
data.horizontalAlignment = GridData.FILL;
data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
data.widthHint = Math.max(widthHint, toggleModeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
toggleModeButton.setLayoutData(data);
Composite afterTableComposite = new Composite(parent, SWT.NONE);
layout = new GridLayout();
@ -630,6 +644,9 @@ public class UniversalPreferencePage
else if ((event.widget == removeResourceTypeButton) && (event.type == SWT.Selection)) {
removeSelectedResourceType();
}
else if ((event.widget == toggleModeButton) && (event.type == SWT.Selection)) {
toggleSelectedResourceTypeMode();
}
else if ((event.widget == doSuperTransferButton) && (event.type == SWT.Selection))
{
doSuperTransferButtonSelected();
@ -672,6 +689,22 @@ public class UniversalPreferencePage
}
}
public void toggleSelectedResourceTypeMode() {
TableItem item= resourceTypeTable.getSelection()[0];
SystemFileTransferModeMapping mapping = (SystemFileTransferModeMapping)item.getData();
if (mapping.isBinary()){
mapping.setAsText();
item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TEXT_LABEL);
item.setImage(getImageFor(mapping));
}
else if (mapping.isText()){
mapping.setAsBinary();
item.setText(2, FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL);
item.setImage(getImageFor(mapping));
}
}
/**
* Add a new resource type to the collection shown in the top of the page.