};
files.addItemListener(this);
// Create the 'Look In' component
lookIn = new Choice();
lookIn.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
AWTFileSelector.this.cwd = new File(lookIn.getSelectedItem());
refresh();
}
});
rebuildLookIn();
// Create the tool bar
Panel z = new Panel(new FlowLayout());
if (showButtons) {
home = new ImageButton(showButtonImages ? UIUtil.getStockImage(StockIcons.STOCK_HOME, AWTFileSelector.class) : null, showButtonText ? Messages.getString("AWTFileSelector.home") : null, "home"); //$NON-NLS-1$ //$NON-NLS-2$
home.setHoverButton(true);
home.addActionListener(this);
home.setToolTipText(Messages.getString("AWTFileSelector.navigateToYourHomeDirectory")); //$NON-NLS-1$
z.add(home);
parent = new ImageButton(showButtonImages ? UIUtil.getStockImage(StockIcons.STOCK_UP_FOLDER, AWTFileSelector.class) : null, showButtonText ? Messages.getString("AWTFileSelector.home") : null, "home"); //$NON-NLS-1$ //$NON-NLS-2$
parent.setHoverButton(true);
parent.addActionListener(this);
parent.setToolTipText(Messages.getString("AWTFileSelector.navigateToParent")); //$NON-NLS-1$
z.add(parent);
newFolder = new ImageButton(showButtonImages ? UIUtil.getStockImage(StockIcons.STOCK_NEW_FOLDER, AWTFileSelector.class) : null, showButtonText ? Messages.getString("AWTFileSelector.new") : null, "newFolder"); //$NON-NLS-1$ //$NON-NLS-2$
newFolder.setHoverButton(true);
newFolder.addActionListener(this);
newFolder.setToolTipText(Messages.getString("AWTFileSelector.createFolder")); //$NON-NLS-1$
z.add(newFolder);
remove = new ImageButton(showButtonImages ? UIUtil.getStockImage(StockIcons.STOCK_DELETE, AWTFileSelector.class) : null, showButtonText ? Messages.getString("AWTFileSelector.delete") : null, "delete"); //$NON-NLS-1$ //$NON-NLS-2$
remove.setHoverButton(true);
remove.addActionListener(this);
remove.setToolTipText(Messages.getString("AWTFileSelector.removeSelected")); //$NON-NLS-1$
z.add(remove);
}
if (showHiddenFilesSwitch) {
showHiddenFiles = new Checkbox(Messages.getString("AWTFileSelector.hiddentFiles")); //$NON-NLS-1$
showHiddenFiles.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
refresh();
}
});
}
// Create the top bar
Panel top = new Panel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.anchor = GridBagConstraints.WEST;
gbc.weightx = 1.0;
UIUtil.gridBagAdd(top, lookIn, gbc, GridBagConstraints.RELATIVE);
gbc.weightx = 0.0;
UIUtil.gridBagAdd(top, z, gbc, GridBagConstraints.REMAINDER);
// Create the path panel
Panel pathPanel = new Panel(new GridBagLayout());
GridBagConstraints gbc1 = new GridBagConstraints();
path = new TextField(""); //$NON-NLS-1$
path.addActionListener(this);
gbc1.fill = GridBagConstraints.HORIZONTAL;
gbc1.anchor = GridBagConstraints.WEST;
gbc1.weightx = 0.0;
gbc1.insets = new Insets(2, 2, 2, 2);
UIUtil.gridBagAdd(pathPanel, new Label(Messages.getString("AWTFileSelector.fileName")), gbc1, showButtons ? 1 : GridBagConstraints.RELATIVE); //$NON-NLS-1$
gbc1.weightx = 1.0;
UIUtil.gridBagAdd(pathPanel, path, gbc1, showButtons ? GridBagConstraints.RELATIVE : GridBagConstraints.REMAINDER);
gbc1.weightx = 0.0;
if(showButtons) {
go = new ImageButton(null, Messages.getString("AWTFileSelector.go"), "go"); //$NON-NLS-1$ //$NON-NLS-2$
go.setHoverButton(true);
go.addActionListener(this);
go.setToolTipText(Messages.getString("AWTFileSelector.navigateToSelectedFolder")); //$NON-NLS-1$
UIUtil.gridBagAdd(pathPanel, go, gbc1, GridBagConstraints.REMAINDER);
}
UIUtil.gridBagAdd(pathPanel, new Label(Messages.getString("AWTFileSelector.filesOfType")), gbc1, showButtons ? 1 : GridBagConstraints.RELATIVE); //$NON-NLS-1$
gbc1.weightx = 1.0;
filterSelect = new Choice();
rebuildFilterSelect();
filterSelect.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
refresh();
}