1 /*
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.apple.laf;
27
28 import java.io.*;
29 import java.util.*;
30 import java.util.Map.Entry;
31
32 import javax.swing.Icon;
33 import javax.swing.filechooser.FileView;
34
35 import com.apple.laf.AquaUtils.RecyclableSingleton;
36
37 class AquaFileView extends FileView {
38 private static final boolean DEBUG = false;
39
40 private static final int UNINITALIZED_LS_INFO = -1;
41
42 // Constants from LaunchServices.h
43 static final int kLSItemInfoIsPlainFile = 0x00000001; /* Not a directory, volume, or symlink*/
44 static final int kLSItemInfoIsPackage = 0x00000002; /* Packaged directory*/
45 static final int kLSItemInfoIsApplication = 0x00000004; /* Single-file or packaged application*/
46 static final int kLSItemInfoIsContainer = 0x00000008; /* Directory (includes packages) or volume*/
47 static final int kLSItemInfoIsAliasFile = 0x00000010; /* Alias file (includes sym links)*/
48 static final int kLSItemInfoIsSymlink = 0x00000020; /* UNIX sym link*/
49 static final int kLSItemInfoIsInvisible = 0x00000040; /* Invisible by any known mechanism*/
50 static final int kLSItemInfoIsNativeApp = 0x00000080; /* Carbon or Cocoa native app*/
51 static final int kLSItemInfoIsClassicApp = 0x00000100; /* CFM/68K Classic app*/
52 static final int kLSItemInfoAppPrefersNative = 0x00000200; /* Carbon app that prefers to be launched natively*/
53 static final int kLSItemInfoAppPrefersClassic = 0x00000400; /* Carbon app that prefers to be launched in Classic*/
54 static final int kLSItemInfoAppIsScriptable = 0x00000800; /* App can be scripted*/
55 static final int kLSItemInfoIsVolume = 0x00001000; /* Item is a volume*/
56 static final int kLSItemInfoExtensionIsHidden = 0x00100000; /* Item has a hidden extension*/
|
1 /*
2 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.apple.laf;
27
28 import java.io.*;
29 import java.util.*;
30 import java.util.Map.Entry;
31
32 import javax.swing.Icon;
33 import javax.swing.filechooser.FileView;
34
35 import com.apple.laf.AquaUtils.RecyclableSingleton;
36
37 @SuppressWarnings("serial") // JDK implementation class
38 class AquaFileView extends FileView {
39 private static final boolean DEBUG = false;
40
41 private static final int UNINITALIZED_LS_INFO = -1;
42
43 // Constants from LaunchServices.h
44 static final int kLSItemInfoIsPlainFile = 0x00000001; /* Not a directory, volume, or symlink*/
45 static final int kLSItemInfoIsPackage = 0x00000002; /* Packaged directory*/
46 static final int kLSItemInfoIsApplication = 0x00000004; /* Single-file or packaged application*/
47 static final int kLSItemInfoIsContainer = 0x00000008; /* Directory (includes packages) or volume*/
48 static final int kLSItemInfoIsAliasFile = 0x00000010; /* Alias file (includes sym links)*/
49 static final int kLSItemInfoIsSymlink = 0x00000020; /* UNIX sym link*/
50 static final int kLSItemInfoIsInvisible = 0x00000040; /* Invisible by any known mechanism*/
51 static final int kLSItemInfoIsNativeApp = 0x00000080; /* Carbon or Cocoa native app*/
52 static final int kLSItemInfoIsClassicApp = 0x00000100; /* CFM/68K Classic app*/
53 static final int kLSItemInfoAppPrefersNative = 0x00000200; /* Carbon app that prefers to be launched natively*/
54 static final int kLSItemInfoAppPrefersClassic = 0x00000400; /* Carbon app that prefers to be launched in Classic*/
55 static final int kLSItemInfoAppIsScriptable = 0x00000800; /* App can be scripted*/
56 static final int kLSItemInfoIsVolume = 0x00001000; /* Item is a volume*/
57 static final int kLSItemInfoExtensionIsHidden = 0x00100000; /* Item has a hidden extension*/
|