diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java index 6a2eb3ad854..73945939ace 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.java @@ -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; diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties index e4044226208..810bacc303c 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/FileResources.properties @@ -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 diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java index a61f1570a16..ceebd4a72fa 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/propertypages/UniversalPreferencePage.java @@ -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.