197 |
197 |
198 // Fixed 6260650: FileDialog.getDirectory() does not return null when file dialog is cancelled |
198 // Fixed 6260650: FileDialog.getDirectory() does not return null when file dialog is cancelled |
199 // After showing we should display 'user.dir' as current directory |
199 // After showing we should display 'user.dir' as current directory |
200 // if user didn't set directory programatically |
200 // if user didn't set directory programatically |
201 pathField = new TextField(savedDir != null ? savedDir : userDir); |
201 pathField = new TextField(savedDir != null ? savedDir : userDir); |
202 |
202 @SuppressWarnings("serial") // Anonymous class |
203 pathChoice = new Choice() { |
203 Choice tmp = new Choice() { |
204 public Dimension getPreferredSize() { |
204 public Dimension getPreferredSize() { |
205 return new Dimension(PATH_CHOICE_WIDTH, pathField.getPreferredSize().height); |
205 return new Dimension(PATH_CHOICE_WIDTH, pathField.getPreferredSize().height); |
206 } |
206 } |
207 }; |
207 }; |
|
208 pathChoice = tmp; |
208 pathPanel = new Panel(); |
209 pathPanel = new Panel(); |
209 pathPanel.setLayout(new BorderLayout()); |
210 pathPanel.setLayout(new BorderLayout()); |
210 |
211 |
211 pathPanel.add(pathField,BorderLayout.CENTER); |
212 pathPanel.add(pathField,BorderLayout.CENTER); |
212 pathPanel.add(pathChoice,BorderLayout.EAST); |
213 pathPanel.add(pathChoice,BorderLayout.EAST); |
843 String dir = pathChoice.getSelectedItem(); |
844 String dir = pathChoice.getSelectedItem(); |
844 target.setDirectory(dir); |
845 target.setDirectory(dir); |
845 } |
846 } |
846 } |
847 } |
847 |
848 |
|
849 @SuppressWarnings("serial") // JDK-implementation class |
848 class Separator extends Canvas { |
850 class Separator extends Canvas { |
849 public final static int HORIZONTAL = 0; |
851 public final static int HORIZONTAL = 0; |
850 public final static int VERTICAL = 1; |
852 public final static int VERTICAL = 1; |
851 int orientation; |
853 int orientation; |
852 |
854 |