mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 18:55:38 +02:00
[210142] for accessibility need transfer mode toggle button
This commit is contained in:
parent
c224183f23
commit
9f9b7cadc1
3 changed files with 43 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David Dykstal (IBM) - 176488: adding some text for the cache limit checkbox
|
* 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;
|
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_LABEL;
|
||||||
public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_REMOVEBUTTON_TOOLTIP;
|
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_LABEL;
|
||||||
public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TOOLTIP;
|
public static String RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TOOLTIP;
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#
|
#
|
||||||
# Contributors:
|
# Contributors:
|
||||||
# David Dykstal (IBM) - 176488: adding some text for the cache limit checkbox
|
# 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
|
# 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_LABEL=Remove
|
||||||
RESID_PREF_UNIVERSAL_FILES_FILETYPES_REMOVEBUTTON_TOOLTIP=Remove selected file type
|
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_LABEL=File Transfer Mode
|
||||||
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TOOLTIP=Mode of file transfer for selected file type
|
RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_TOOLTIP=Mode of file transfer for selected file type
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
* David McKnight (IBM) - [207178] changing list APIs for file service and subsystems
|
* 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) - [208951] no longer used editor registry for file type associations
|
||||||
* David McKnight (IBM) - [203114] Usability improvements for file transfer mode prefs
|
* 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;
|
package org.eclipse.rse.internal.files.ui.propertypages;
|
||||||
|
@ -96,6 +97,7 @@ public class UniversalPreferencePage
|
||||||
protected Table resourceTypeTable;
|
protected Table resourceTypeTable;
|
||||||
protected Button addResourceTypeButton;
|
protected Button addResourceTypeButton;
|
||||||
protected Button removeResourceTypeButton;
|
protected Button removeResourceTypeButton;
|
||||||
|
protected Button toggleModeButton;
|
||||||
|
|
||||||
protected Button doSuperTransferButton;
|
protected Button doSuperTransferButton;
|
||||||
|
|
||||||
|
@ -209,6 +211,18 @@ public class UniversalPreferencePage
|
||||||
data.widthHint = Math.max(widthHint, removeResourceTypeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
|
data.widthHint = Math.max(widthHint, removeResourceTypeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
|
||||||
removeResourceTypeButton.setLayoutData(data);
|
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);
|
Composite afterTableComposite = new Composite(parent, SWT.NONE);
|
||||||
layout = new GridLayout();
|
layout = new GridLayout();
|
||||||
|
@ -630,6 +644,9 @@ public class UniversalPreferencePage
|
||||||
else if ((event.widget == removeResourceTypeButton) && (event.type == SWT.Selection)) {
|
else if ((event.widget == removeResourceTypeButton) && (event.type == SWT.Selection)) {
|
||||||
removeSelectedResourceType();
|
removeSelectedResourceType();
|
||||||
}
|
}
|
||||||
|
else if ((event.widget == toggleModeButton) && (event.type == SWT.Selection)) {
|
||||||
|
toggleSelectedResourceTypeMode();
|
||||||
|
}
|
||||||
else if ((event.widget == doSuperTransferButton) && (event.type == SWT.Selection))
|
else if ((event.widget == doSuperTransferButton) && (event.type == SWT.Selection))
|
||||||
{
|
{
|
||||||
doSuperTransferButtonSelected();
|
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.
|
* Add a new resource type to the collection shown in the top of the page.
|
||||||
|
|
Loading…
Add table
Reference in a new issue