mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 13:05:22 +02:00
[203114] Usability improvements for file transfer mode prefs
This commit is contained in:
parent
38b0baf93b
commit
4976135552
2 changed files with 27 additions and 3 deletions
|
@ -172,7 +172,6 @@ public class UniversalPreferencePage
|
||||||
resourceTypeTable.addListener(SWT.DefaultSelection, this);
|
resourceTypeTable.addListener(SWT.DefaultSelection, this);
|
||||||
data = new GridData(GridData.FILL_BOTH);
|
data = new GridData(GridData.FILL_BOTH);
|
||||||
data.heightHint = resourceTypeTable.getItemHeight() * 12;
|
data.heightHint = resourceTypeTable.getItemHeight() * 12;
|
||||||
data.widthHint = 200;
|
|
||||||
data.grabExcessHorizontalSpace = true;
|
data.grabExcessHorizontalSpace = true;
|
||||||
resourceTypeTable.setLayoutData(data);
|
resourceTypeTable.setLayoutData(data);
|
||||||
|
|
||||||
|
@ -407,13 +406,19 @@ public class UniversalPreferencePage
|
||||||
tableLayout.addColumnData(layoutData);
|
tableLayout.addColumnData(layoutData);
|
||||||
TableColumn tableCol = new TableColumn(resourceTypeTable, SWT.NONE, 0);
|
TableColumn tableCol = new TableColumn(resourceTypeTable, SWT.NONE, 0);
|
||||||
tableCol.setResizable(false);
|
tableCol.setResizable(false);
|
||||||
|
tableCol.pack();
|
||||||
|
tableCol.setWidth(20);
|
||||||
tableCol.setText(""); //$NON-NLS-1$
|
tableCol.setText(""); //$NON-NLS-1$
|
||||||
|
|
||||||
|
|
||||||
layoutData = new ColumnWeightData(40, true);
|
layoutData = new ColumnWeightData(40, true);
|
||||||
tableLayout.addColumnData(layoutData);
|
tableLayout.addColumnData(layoutData);
|
||||||
tableCol = new TableColumn(resourceTypeTable, SWT.NONE, 1);
|
tableCol = new TableColumn(resourceTypeTable, SWT.NONE, 1);
|
||||||
tableCol.setResizable(true);
|
tableCol.setResizable(true);
|
||||||
tableCol.setText(FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_TABLECOL_LABEL);
|
tableCol.setText(FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_TABLECOL_LABEL);
|
||||||
|
tableCol.pack();
|
||||||
|
tableCol.setWidth(100);
|
||||||
|
|
||||||
|
|
||||||
layoutData = new ColumnWeightData(60, true);
|
layoutData = new ColumnWeightData(60, true);
|
||||||
tableLayout.addColumnData(layoutData);
|
tableLayout.addColumnData(layoutData);
|
||||||
|
@ -421,6 +426,10 @@ public class UniversalPreferencePage
|
||||||
tableCol.setResizable(true);
|
tableCol.setResizable(true);
|
||||||
tableCol.setText(FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_LABEL);
|
tableCol.setText(FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_LABEL);
|
||||||
|
|
||||||
|
tableCol.pack();
|
||||||
|
tableCol.setWidth(200);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = new String[2];
|
String[] contentTypes = new String[2];
|
||||||
contentTypes[0] = FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL;
|
contentTypes[0] = FileResources.RESID_PREF_UNIVERSAL_FILES_FILETYPES_MODE_BINARY_LABEL;
|
||||||
|
@ -471,6 +480,7 @@ public class UniversalPreferencePage
|
||||||
protected void resetResourceTypeTable()
|
protected void resetResourceTypeTable()
|
||||||
{
|
{
|
||||||
//clear table and reload defaults
|
//clear table and reload defaults
|
||||||
|
modeRegistry.renit();
|
||||||
modeMappings.clear();
|
modeMappings.clear();
|
||||||
resourceTypeTable.setRedraw(false);
|
resourceTypeTable.setRedraw(false);
|
||||||
resourceTypeTable.removeAll();
|
resourceTypeTable.removeAll();
|
||||||
|
@ -482,7 +492,7 @@ public class UniversalPreferencePage
|
||||||
}
|
}
|
||||||
resourceTypeTable.setRedraw(true);
|
resourceTypeTable.setRedraw(true);
|
||||||
|
|
||||||
int defaultFileTransferMode = getFileTransferModeDefaultPreference();
|
int defaultFileTransferMode = ISystemFilePreferencesConstants.DEFAULT_FILETRANSFERMODE;
|
||||||
defaultBinaryButton.setSelection(defaultFileTransferMode == ISystemFilePreferencesConstants.FILETRANSFERMODE_BINARY);
|
defaultBinaryButton.setSelection(defaultFileTransferMode == ISystemFilePreferencesConstants.FILETRANSFERMODE_BINARY);
|
||||||
defaultTextButton.setSelection(defaultFileTransferMode == ISystemFilePreferencesConstants.FILETRANSFERMODE_TEXT);
|
defaultTextButton.setSelection(defaultFileTransferMode == ISystemFilePreferencesConstants.FILETRANSFERMODE_TEXT);
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,14 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete's the existing file associations and reinitializes with defaults
|
||||||
|
*/
|
||||||
|
public void renit()
|
||||||
|
{
|
||||||
|
deleteAssociations();
|
||||||
|
initialize();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the registry from storage.
|
* Initialize the registry from storage.
|
||||||
|
@ -489,6 +497,12 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deleteAssociations()
|
||||||
|
{
|
||||||
|
String location = getFileLocation();
|
||||||
|
File assFile = new File(location);
|
||||||
|
assFile.delete();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the contents of the registry
|
* Save the contents of the registry
|
||||||
|
|
Loading…
Add table
Reference in a new issue