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) {
DirectoryDialog dialog = new DirectoryDialog(pluginGroup.getShell(), SWT.APPLICATION_MODAL);
dialog.setFilterPath(sp.getValue());
String path = dialog.open();
if (path != null) {
sp.setValue(path);
}
}
});
controls[2] = browse;