RSE
Release 1.0

org.eclipse.rse.files.ui.propertypages
Class UniversalPreferencePage

java.lang.Object
  extended byorg.eclipse.jface.dialogs.DialogPage
      extended byorg.eclipse.jface.preference.PreferencePage
          extended byorg.eclipse.jface.preference.FieldEditorPreferencePage
              extended byorg.eclipse.rse.files.ui.propertypages.UniversalPreferencePage
All Implemented Interfaces:
EventListener, IDialogPage, IMessageProvider, IPreferencePage, IPropertyChangeListener, IPropertyListener, IWorkbenchPreferencePage, Listener

public class UniversalPreferencePage
extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage, Listener, IPropertyListener

"Files" Preference page within the Remote Systems preference node. This allows users to specify, per file extension, whether files are source or binary.


Field Summary
protected  Button addResourceTypeButton
           
protected  Combo archiveTypeCombo
           
protected  Button binaryButton
           
protected  Combo defaultArchiveTypeCombo
           
protected  Button defaultBinaryButton
           
protected  Button defaultTextButton
           
protected  Button doSuperTransferButton
           
protected  Text downloadBufferSize
           
protected  ArrayList editorMappings
           
protected  IEditorRegistry editorRegistry
           
protected  ArrayList imagesToDispose
           
protected  ArrayList modeMappings
           
protected  SystemFileTransferModeRegistry modeRegistry
           
protected  Button removeResourceTypeButton
           
protected  Label resourceTypeLabel
           
protected  Table resourceTypeTable
           
protected  Button textButton
           
protected  Text uploadBufferSize
           
 
Fields inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
FLAT, GRID, MARGIN_HEIGHT, MARGIN_WIDTH, VERTICAL_SPACING
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
UniversalPreferencePage()
          Constructor
 
Method Summary
 void addResourceType(String newName, String newExtension)
          Add a new resource type to the collection shown in the top of the page.
 void createControl(Composite parent)
           
protected  void createFieldEditors()
           
 void dispose()
          The preference page is going to be disposed.
 void fillMode()
          Fill the mode widgets
protected  void fillResourceTypeTable()
          Fill the resource type table
static boolean getDoSuperTransfer()
           
static int getDownloadBufferSize()
           
static int getFileTransferModeDefaultPreference()
          Return whether to automatically detect, use binary or text during file transfer for unspecified file types
static String getSuperTransferTypePreference()
          Return whether to compress directories before transferring them over the network
static int getUploadBufferSize()
           
 void handleEvent(Event event)
           
 void init(IWorkbench workbench)
           
static void initDefaults(IPreferenceStore store)
           
protected  TableItem newResourceTableItem(IFileEditorMapping mapping, int index, boolean selected)
          Create a new TableItem to represent the resource type editor description supplied.
protected  void performDefaults()
           
 boolean performOk()
          Stuff to do when ok is pressed
 void promptForResourceType()
          Prompt for file type
 void propertyChanged(Object source, int propId)
          Listen for changes to the Editor Registry content.
 void removeSelectedResourceType()
          Remove the type from the table
protected  void resetBufferSizePrefs()
           
protected  void resetResourceTypeTable()
          Used during reset defaults
protected  void resetSuperTransferPrefs()
           
static void setDoSuperTransfer(boolean flag)
           
static void setDownloadBufferSize(int size)
           
static void setDownloadBufferSize(String size)
           
static void setFileTransferModeDefaultPreference(int defaultMode)
          Set the default file transfer mode to use for unspecified file types
static void setSuperTransferTypePreference(String type)
          Set the default as to whether or not to compress directories before remote transfer
static void setUploadBufferSize(int size)
           
static void setUploadBufferSize(String size)
           
 void updateEnabledState()
          Update enabled state of buttons
 
Methods inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
addField, adjustGridLayout, applyFont, checkState, createContents, getFieldEditorParent, initialize, propertyChange, setVisible
 
Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createDescriptionLabel, createNoteComposite, doComputeSize, doGetPreferenceStore, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, okToLeave, performApply, performCancel, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButton
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
 

Field Detail

resourceTypeLabel

protected Label resourceTypeLabel

resourceTypeTable

protected Table resourceTypeTable

addResourceTypeButton

protected Button addResourceTypeButton

removeResourceTypeButton

protected Button removeResourceTypeButton

binaryButton

protected Button binaryButton

textButton

protected Button textButton

doSuperTransferButton

protected Button doSuperTransferButton

defaultBinaryButton

protected Button defaultBinaryButton

defaultTextButton

protected Button defaultTextButton

modeRegistry

protected SystemFileTransferModeRegistry modeRegistry

editorRegistry

protected IEditorRegistry editorRegistry

modeMappings

protected ArrayList modeMappings

editorMappings

protected ArrayList editorMappings

imagesToDispose

protected ArrayList imagesToDispose

archiveTypeCombo

protected Combo archiveTypeCombo

defaultArchiveTypeCombo

protected Combo defaultArchiveTypeCombo

downloadBufferSize

protected Text downloadBufferSize

uploadBufferSize

protected Text uploadBufferSize
Constructor Detail

UniversalPreferencePage

public UniversalPreferencePage()
Constructor

Method Detail

createControl

public void createControl(Composite parent)
Specified by:
createControl in interface IDialogPage
See Also:
PreferencePage.createControl(Composite)

createFieldEditors

protected void createFieldEditors()

init

public void init(IWorkbench workbench)
Specified by:
init in interface IWorkbenchPreferencePage

initDefaults

public static void initDefaults(IPreferenceStore store)

fillResourceTypeTable

protected void fillResourceTypeTable()
Fill the resource type table


resetResourceTypeTable

protected void resetResourceTypeTable()
Used during reset defaults


resetSuperTransferPrefs

protected void resetSuperTransferPrefs()

resetBufferSizePrefs

protected void resetBufferSizePrefs()

newResourceTableItem

protected TableItem newResourceTableItem(IFileEditorMapping mapping,
                                         int index,
                                         boolean selected)
Create a new TableItem to represent the resource type editor description supplied.


dispose

public void dispose()
The preference page is going to be disposed. So deallocate all allocated SWT resources that aren't disposed automatically by disposing the page (i.e. fonts, cursors, etc). Subclasses should reimplement this method to release their own allocated SWT resources.

Specified by:
dispose in interface IDialogPage

handleEvent

public void handleEvent(Event event)
Specified by:
handleEvent in interface Listener
See Also:
Listener.handleEvent(Event)

fillMode

public void fillMode()
Fill the mode widgets


promptForResourceType

public void promptForResourceType()
Prompt for file type


removeSelectedResourceType

public void removeSelectedResourceType()
Remove the type from the table


addResourceType

public void addResourceType(String newName,
                            String newExtension)
Add a new resource type to the collection shown in the top of the page. This is typically called after the extension dialog is shown to the user.


updateEnabledState

public void updateEnabledState()
Update enabled state of buttons


performDefaults

protected void performDefaults()

performOk

public boolean performOk()
Stuff to do when ok is pressed

Specified by:
performOk in interface IPreferencePage

getFileTransferModeDefaultPreference

public static int getFileTransferModeDefaultPreference()
Return whether to automatically detect, use binary or text during file transfer for unspecified file types


setFileTransferModeDefaultPreference

public static void setFileTransferModeDefaultPreference(int defaultMode)
Set the default file transfer mode to use for unspecified file types


getSuperTransferTypePreference

public static String getSuperTransferTypePreference()
Return whether to compress directories before transferring them over the network


setSuperTransferTypePreference

public static void setSuperTransferTypePreference(String type)
Set the default as to whether or not to compress directories before remote transfer


getDoSuperTransfer

public static boolean getDoSuperTransfer()

getDownloadBufferSize

public static int getDownloadBufferSize()

getUploadBufferSize

public static int getUploadBufferSize()

setDoSuperTransfer

public static void setDoSuperTransfer(boolean flag)

setDownloadBufferSize

public static void setDownloadBufferSize(String size)

setUploadBufferSize

public static void setUploadBufferSize(String size)

setDownloadBufferSize

public static void setDownloadBufferSize(int size)

setUploadBufferSize

public static void setUploadBufferSize(int size)

propertyChanged

public void propertyChanged(Object source,
                            int propId)
Listen for changes to the Editor Registry content. Update our registry by changing the hashmap and saving the new mappings on disk.

Specified by:
propertyChanged in interface IPropertyListener
See Also:
IPropertyListener.propertyChanged(Object, int)

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.