FileDocCategorySizeDatePackage
PluginFileParameter.javaAPI DocAzureus 3.0.3.42979Fri Oct 21 05:45:10 BST 2005org.gudy.azureus2.ui.swt.config.plugins

PluginFileParameter

public class PluginFileParameter extends Object implements PluginParameterImpl
author
Olivier

Fields Summary
org.eclipse.swt.widgets.Control[]
controls
Constructors Summary
public PluginFileParameter(org.eclipse.swt.widgets.Composite pluginGroup, org.gudy.azureus2.pluginsimpl.local.ui.config.FileParameter parameter)

    controls = new Control[3];
           
    controls[0] = new Label(pluginGroup,SWT.NULL);
    Messages.setLanguageText(controls[0],parameter.getLabelKey());
    
    final org.gudy.azureus2.ui.swt.config.StringParameter sp =
    	new org.gudy.azureus2.ui.swt.config.StringParameter(
    	    pluginGroup,
    	    parameter.getKey(),
					parameter.getDefaultValue());
    controls[1] = sp.getControl();
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    controls[1].setLayoutData(gridData);
    
    Button browse = new Button(pluginGroup, SWT.PUSH);
    Image imgOpenFolder = ImageRepository.getImage("openFolderButton");
    browse.setImage(imgOpenFolder);
    imgOpenFolder.setBackground(browse.getBackground());
    browse.setToolTipText(MessageText.getString("ConfigView.button.browse"));
    
    browse.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        FileDialog dialog = new FileDialog(pluginGroup.getShell(), SWT.APPLICATION_MODAL);
        dialog.setFilterPath(sp.getValue());        
        String path = dialog.open();
        if (path != null) {
          sp.setValue(path);
        }
      }
    });
    
    controls[2] = browse;
  
Methods Summary
public org.eclipse.swt.widgets.Control[]getControls()

    return controls;