Changeset 73:9ff9b8f7284b
- Timestamp:
- 04/13/08 14:55:55
(6 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
FileTreeViewer? now work on windows without error dialog.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r66 |
r73 |
|
| 6 | 6 | *.exe |
|---|
| 7 | 7 | *.bak |
|---|
| | 8 | *.rf |
|---|
| 8 | 9 | |
|---|
| 9 | 10 | syntax: regexp |
|---|
| … | … | |
| 17 | 18 | ^dwtexamples/controlexample/ControlExample$ |
|---|
| 18 | 19 | ^dwtexamples/controlexample/CustomControlExample$ |
|---|
| | 20 | ^dwtexamples/texteditor/TextEditor$ |
|---|
| 19 | 21 | ^dwtsnippets/.*/Snippet[0-9]*$ |
|---|
| 20 | | |
|---|
| 21 | 22 | ^user/torhu_synctest$ |
|---|
| 22 | 23 | ^user/drawingboard/DrawingBoard$ |
|---|
| r70 |
r73 |
|
| 42 | 42 | import tango.util.collection.model.Seq; |
|---|
| 43 | 43 | import tango.util.collection.ArraySeq; |
|---|
| 44 | | |
|---|
| | 44 | import tango.text.convert.Utf; |
|---|
| 45 | 45 | |
|---|
| 46 | 46 | void main(){ |
|---|
| … | … | |
| 130 | 130 | |
|---|
| 131 | 131 | foreach( root; FileRoots.list()){ |
|---|
| | 132 | // ignore floppy drives, they bring up strange error messages |
|---|
| | 133 | if( root == `A:\`|| root == `B:\` ){ |
|---|
| | 134 | continue; |
|---|
| | 135 | } |
|---|
| 132 | 136 | res ~= new FilePath( root ); |
|---|
| 133 | 137 | } |
|---|
| … | … | |
| 170 | 174 | |
|---|
| 171 | 175 | public override Image getImage(Object arg0){ |
|---|
| 172 | | return (cast(FilePath)arg0).isFolder() ? dir : file; |
|---|
| | 176 | auto fp = cast(FilePath)arg0; |
|---|
| | 177 | // is a root |
|---|
| | 178 | if( fp.name.length is 0 ){ |
|---|
| | 179 | return dir; |
|---|
| | 180 | } |
|---|
| | 181 | return fp.isFolder() ? dir : file; |
|---|
| 173 | 182 | } |
|---|
| 174 | 183 | |
|---|
| 175 | 184 | public override char[] getText(Object arg0){ |
|---|
| 176 | | auto text = (cast(FilePath)arg0).name(); |
|---|
| | 185 | auto fp = cast(FilePath)arg0; |
|---|
| | 186 | auto text = fp.name(); |
|---|
| 177 | 187 | if( text.length is 0 ){ |
|---|
| 178 | 188 | // now take all info, it will be drive or the root folder |
|---|
| 179 | | text = (cast(FilePath)arg0).toString(); |
|---|
| | 189 | text = fp.toString(); |
|---|
| 180 | 190 | } |
|---|
| 181 | 191 | return preserveCase ? text : text.toUpperCase(); |
|---|
| r72 |
r73 |
|
| 58 | 58 | version(JIVE) import jive.stacktrace; |
|---|
| 59 | 59 | |
|---|
| 60 | | /++ |
|---|
| 61 | | Known Problem: |
|---|
| 62 | | Blocks in Save Method |
|---|
| 63 | | Not prepared for windows. |
|---|
| 64 | | ++/ |
|---|
| 65 | | |
|---|
| 66 | 60 | /** |
|---|
| 67 | 61 | * The application entry point |
|---|
| … | … | |
| 362 | 356 | } |
|---|
| 363 | 357 | /** |
|---|
| 364 | | * Creates a new file |
|---|
| 365 | | */ |
|---|
| | 358 | * Creates a new file |
|---|
| | 359 | */ |
|---|
| 366 | 360 | public void newFile() { |
|---|
| 367 | 361 | if (checkOverwrite()) { |
|---|
| … | … | |
| 372 | 366 | |
|---|
| 373 | 367 | /** |
|---|
| 374 | | * Saves the current file |
|---|
| 375 | | */ |
|---|
| | 368 | * Saves the current file |
|---|
| | 369 | */ |
|---|
| 376 | 370 | public void saveFile() { |
|---|
| 377 | 371 | String fileName = library.getFileName(); |
|---|
| … | … | |
| 386 | 380 | |
|---|
| 387 | 381 | /** |
|---|
| 388 | | * Saves the current file using the specified file name |
|---|
| 389 | | * |
|---|
| 390 | | * @param fileName the file name |
|---|
| 391 | | */ |
|---|
| | 382 | * Saves the current file using the specified file name |
|---|
| | 383 | * |
|---|
| | 384 | * @param fileName the file name |
|---|
| | 385 | */ |
|---|
| 392 | 386 | public void saveFileAs(String fileName) { |
|---|
| 393 | 387 | // Disable the actions, so user can't change file while it's saving |
|---|
| … | … | |
| 434 | 428 | // Repack the columns |
|---|
| 435 | 429 | for (int i = 0, n = viewer.getTable().getColumnCount(); i < n; i++) { |
|---|
| 436 | | viewer.getTable().getColumn(i).pack(); |
|---|
| | 430 | viewer.getTable().getColumn(i).pack(); |
|---|
| 437 | 431 | } |
|---|
| 438 | 432 | |
|---|