OmegaT のメニューバーにフォルダーツリー参照用のメニューを追加します。
refactoring
@@ -1,7 +1,7 @@ | ||
1 | 1 | /************************************************************************** |
2 | 2 | FolderMenu - easy access to project folders from menu. |
3 | 3 | |
4 | - Copyright (C) 2013 Yu Tang | |
4 | + Copyright (C) 2013-2014 Yu Tang | |
5 | 5 | Home page: http://sourceforge.jp/users/yu-tang/ |
6 | 6 | Support center: http://sourceforge.jp/users/yu-tang/ |
7 | 7 |
@@ -64,11 +64,11 @@ | ||
64 | 64 | root.add(new JSeparator()); |
65 | 65 | |
66 | 66 | // Current Source File |
67 | - currentSourceFile = new ShellLinkMenuItem(L10n.getCurrentSourceFileNoneMenuLabel()); | |
67 | + currentSourceFile = new ShellLinkMenuItem(L10n.getSourceDocumentMenuLabel()); | |
68 | 68 | root.add(currentSourceFile.getMenuItem()); |
69 | 69 | |
70 | 70 | // Current Target File |
71 | - currentTargetFile = new ShellLinkMenuItem(L10n.getCurrentTargetFileNoneMenuLabel()); | |
71 | + currentTargetFile = new ShellLinkMenuItem(L10n.getTargetDocumentMenuLabel()); | |
72 | 72 | root.add(currentTargetFile.getMenuItem()); |
73 | 73 | |
74 | 74 | // insert Files menu before the last menu (Help menu.) |
@@ -92,23 +92,21 @@ | ||
92 | 92 | public void linkCurrentSourceFile(File file) throws IOException { |
93 | 93 | String sourceRoot = Core.getProject().getProjectProperties().getSourceRoot(); |
94 | 94 | String midName = FileUtil.computeRelativePath(new File(sourceRoot), file); |
95 | - String label = StaticUtils.format(L10n.getCurrentSourceFileMenuLabel(), midName); | |
96 | - currentSourceFile.link(file, label); | |
95 | + currentSourceFile.link(file, midName); | |
97 | 96 | } |
98 | 97 | |
99 | 98 | public void unlinkCurrentSourceFile() { |
100 | - currentSourceFile.unlink(L10n.getCurrentSourceFileNoneMenuLabel()); | |
99 | + currentSourceFile.unlink(); | |
101 | 100 | } |
102 | 101 | |
103 | 102 | public void linkCurrentTargetFile(File file) throws IOException { |
104 | 103 | String targetRoot = Core.getProject().getProjectProperties().getTargetRoot(); |
105 | 104 | String midName = FileUtil.computeRelativePath(new File(targetRoot), file); |
106 | - String label = StaticUtils.format(L10n.getCurrentTargetFileMenuLabel(), midName); | |
107 | - currentTargetFile.link(file, label); | |
105 | + currentTargetFile.link(file, midName); | |
108 | 106 | } |
109 | 107 | |
110 | 108 | public void unlinkCurrentTargetFile() { |
111 | - currentTargetFile.unlink(L10n.getCurrentTargetFileNoneMenuLabel()); | |
109 | + currentTargetFile.unlink(); | |
112 | 110 | } |
113 | 111 | |
114 | 112 | private JMenu createLocalizedMenu(String labelString) { |
@@ -1,7 +1,7 @@ | ||
1 | 1 | /************************************************************************** |
2 | 2 | FolderMenu - easy access to project folders from menu. |
3 | 3 | |
4 | - Copyright (C) 2013 Yu Tang | |
4 | + Copyright (C) 2013-2014 Yu Tang | |
5 | 5 | Home page: http://sourceforge.jp/users/yu-tang/ |
6 | 6 | Support center: http://sourceforge.jp/users/yu-tang/pf/ |
7 | 7 |
@@ -17,6 +17,7 @@ | ||
17 | 17 | package jp.sourceforge.users.yutang.omegat.plugin.foldermenu; |
18 | 18 | |
19 | 19 | import java.awt.Component; |
20 | +import java.awt.Desktop; | |
20 | 21 | import java.awt.event.ActionEvent; |
21 | 22 | import java.awt.event.ActionListener; |
22 | 23 | import java.awt.event.KeyEvent; |
@@ -36,9 +37,12 @@ | ||
36 | 37 | import javax.swing.event.MenuKeyListener; |
37 | 38 | import javax.swing.event.MenuListener; |
38 | 39 | import javax.swing.filechooser.FileSystemView; |
40 | +import jp.sourceforge.users.yutang.omegat.plugin.foldermenu.filepreview.FilePreview; | |
39 | 41 | import org.omegat.core.Core; |
40 | 42 | import org.omegat.core.data.IProject; |
41 | 43 | import org.omegat.util.Log; |
44 | +import static org.omegat.util.Platform.getOsType; | |
45 | +import org.omegat.util.StaticUtils; | |
42 | 46 | |
43 | 47 | /** |
44 | 48 | * |
@@ -61,7 +65,7 @@ | ||
61 | 65 | al = new ActionListener() { |
62 | 66 | |
63 | 67 | @Override |
64 | - public void actionPerformed(ActionEvent e) { $(e).open(); } | |
68 | + public void actionPerformed(ActionEvent e) { open( (JMenuItem) e.getSource()); } | |
65 | 69 | |
66 | 70 | }; |
67 | 71 |
@@ -80,7 +84,7 @@ | ||
80 | 84 | JMenu menu = (JMenu) selection; |
81 | 85 | if (menu.isEnabled()) { |
82 | 86 | manager.clearSelectedPath(); |
83 | - $(menu).open(); | |
87 | + open(menu); | |
84 | 88 | } |
85 | 89 | } |
86 | 90 | } |
@@ -94,7 +98,7 @@ | ||
94 | 98 | mol = new MouseListener() { |
95 | 99 | |
96 | 100 | @Override |
97 | - public void mouseClicked(MouseEvent e) { $(e).open(); } | |
101 | + public void mouseClicked(MouseEvent e) { open((JMenuItem) e.getSource()); } | |
98 | 102 | |
99 | 103 | @Override |
100 | 104 | public void mousePressed(MouseEvent e) { /* do nothing */ } |
@@ -115,7 +119,7 @@ | ||
115 | 119 | @Override |
116 | 120 | public void menuSelected(MenuEvent e) { |
117 | 121 | // Lazy create submenus |
118 | - $(e).createChildren(); | |
122 | + ((ShellLinkMenu) e.getSource()).createChildren(); | |
119 | 123 | } |
120 | 124 | |
121 | 125 | @Override |
@@ -148,29 +152,45 @@ | ||
148 | 152 | } |
149 | 153 | |
150 | 154 | if (sourceFile == null || !sourceFile.isFile()) { |
151 | - menuManager.unlinkCurrentSourceFile(); | |
152 | - menuManager.unlinkCurrentTargetFile(); | |
155 | + if (prevSourceFile != null) { | |
156 | + menuManager.unlinkCurrentSourceFile(); | |
157 | + prevSourceFile = null; | |
158 | + } | |
159 | + if (prevTranslatedFile != null) { | |
160 | + menuManager.unlinkCurrentTargetFile(); | |
161 | + prevTranslatedFile = null; | |
162 | + } | |
153 | 163 | return; |
154 | 164 | } |
155 | 165 | |
156 | 166 | try { |
157 | - menuManager.linkCurrentSourceFile(sourceFile); | |
167 | + if (!sourceFile.equals(prevSourceFile)) { | |
168 | + menuManager.linkCurrentSourceFile(sourceFile); | |
169 | + prevSourceFile = sourceFile; | |
170 | + } | |
158 | 171 | } catch (IOException ex) { |
159 | 172 | Log.log(ex.getMessage()); |
160 | 173 | menuManager.unlinkCurrentSourceFile(); |
174 | + prevSourceFile = null; | |
161 | 175 | } |
162 | 176 | |
163 | 177 | if (translatedFile == null || !translatedFile.isFile()) { |
164 | - menuManager.unlinkCurrentTargetFile(); | |
178 | + if (prevTranslatedFile != null) { | |
179 | + menuManager.unlinkCurrentTargetFile(); | |
180 | + prevTranslatedFile = null; | |
181 | + } | |
165 | 182 | } else { |
166 | 183 | try { |
167 | - menuManager.linkCurrentTargetFile(translatedFile); | |
184 | + if (!translatedFile.equals(prevTranslatedFile)) { | |
185 | + menuManager.linkCurrentTargetFile(translatedFile); | |
186 | + prevTranslatedFile = translatedFile; | |
187 | + } | |
168 | 188 | } catch (IOException ex) { |
169 | 189 | Log.log(ex.getMessage()); |
170 | 190 | menuManager.unlinkCurrentTargetFile(); |
191 | + prevTranslatedFile = null; | |
171 | 192 | } |
172 | 193 | } |
173 | - | |
174 | 194 | } |
175 | 195 | |
176 | 196 | @Override |
@@ -240,26 +260,36 @@ | ||
240 | 260 | return comp; |
241 | 261 | } |
242 | 262 | |
243 | - private static ShellLinkMenuItem $(JMenuItem mi) { | |
244 | - return new ShellLinkMenuItem(mi); | |
245 | - } | |
263 | + private static void open(JMenuItem item) { | |
264 | + if (! item.isEnabled()) { | |
265 | + return; | |
266 | + } | |
246 | 267 | |
247 | - private static ShellLinkMenu $(JMenu m) { | |
248 | - return new ShellLinkMenu(m); | |
268 | + String path = item.getActionCommand(); | |
269 | + try { | |
270 | + switch (getOsType()) { | |
271 | + case WIN64: | |
272 | + case WIN32: | |
273 | + File file = new File(path); | |
274 | + if (! FilePreview.open(file)) { | |
275 | + Desktop.getDesktop().open(file); | |
276 | + } | |
277 | + break; | |
278 | + case MAC64: | |
279 | + case MAC32: | |
280 | + new ProcessBuilder("open", path).start(); | |
281 | + break; | |
282 | + default: // Linux and others | |
283 | + new ProcessBuilder("xdg-open", path).start(); | |
284 | + break; | |
285 | + } | |
286 | + } catch (IOException ex) { | |
287 | + Log.log(ex); | |
288 | + Core.getMainWindow().showMessageDialog(StaticUtils.format( | |
289 | + L10n.getErrMsgFileHasNoAssoc(), path)); | |
290 | + } | |
249 | 291 | } |
250 | 292 | |
251 | - private static ShellLinkMenuItem $(ActionEvent e) { | |
252 | - return new ShellLinkMenuItem((JMenuItem) e.getSource()); | |
253 | - } | |
254 | - | |
255 | - private static ShellLinkMenu $(MouseEvent e) { | |
256 | - return new ShellLinkMenu((JMenu) e.getSource()); | |
257 | - } | |
258 | - | |
259 | - private static ShellLinkMenu $(MenuEvent e) { | |
260 | - return new ShellLinkMenu((JMenu) e.getSource()); | |
261 | - } | |
262 | - | |
263 | 293 | public static void setMenuManager(MenuManager manager) { |
264 | 294 | menuManager = manager; |
265 | 295 | } |
@@ -273,5 +303,7 @@ | ||
273 | 303 | private static final MenuListener melRoot; |
274 | 304 | private static final Comparator<File> comp; |
275 | 305 | private static MenuManager menuManager; |
306 | + private static File prevSourceFile; | |
307 | + private static File prevTranslatedFile; | |
276 | 308 | |
277 | 309 | } |
@@ -1,7 +1,7 @@ | ||
1 | 1 | /************************************************************************** |
2 | 2 | FolderMenu - easy access to project folders from menu. |
3 | 3 | |
4 | - Copyright (C) 2013 Yu Tang | |
4 | + Copyright (C) 2013-2014 Yu Tang | |
5 | 5 | Home page: http://sourceforge.jp/users/yu-tang/ |
6 | 6 | Support center: http://sourceforge.jp/users/yu-tang/pf/ |
7 | 7 |
@@ -16,97 +16,51 @@ | ||
16 | 16 | |
17 | 17 | package jp.sourceforge.users.yutang.omegat.plugin.foldermenu; |
18 | 18 | |
19 | -import java.awt.Desktop; | |
20 | 19 | import java.io.File; |
21 | 20 | import java.io.IOException; |
22 | 21 | import javax.swing.JMenuItem; |
23 | -import org.omegat.core.Core; | |
24 | -import jp.sourceforge.users.yutang.omegat.plugin.foldermenu.filepreview.FilePreview; | |
25 | -import org.omegat.util.Log; | |
26 | -import static org.omegat.util.Platform.OsType.*; | |
27 | -import static org.omegat.util.Platform.getOsType; | |
28 | -import org.omegat.util.StaticUtils; | |
29 | 22 | |
30 | 23 | /** |
31 | 24 | * |
32 | 25 | * @author Yu Tang |
33 | 26 | */ |
34 | -public class ShellLinkMenuItem { | |
27 | +public class ShellLinkMenuItem extends JMenuItem { | |
35 | 28 | |
36 | - protected JMenuItem menuItem; | |
37 | - | |
38 | 29 | public ShellLinkMenuItem() { |
39 | - menuItem = new JMenuItem(); | |
30 | + super(); | |
40 | 31 | } |
41 | 32 | |
42 | - public ShellLinkMenuItem(JMenuItem mi) { | |
43 | - menuItem = mi; | |
44 | - } | |
45 | - | |
46 | 33 | public ShellLinkMenuItem(File file) throws IOException { |
47 | - JMenuItem m = new JMenuItem(file.getName(), MenuHelper.getIcon(file)); | |
48 | - m.setActionCommand(file.getCanonicalPath()); | |
49 | - m.addActionListener(MenuHelper.getActionListener()); | |
50 | - menuItem = m; | |
34 | + super(file.getName(), MenuHelper.getIcon(file)); | |
35 | + setActionCommand(file.getCanonicalPath()); | |
36 | + addActionListener(MenuHelper.getActionListener()); | |
51 | 37 | } |
52 | 38 | |
53 | 39 | public ShellLinkMenuItem(String label) { |
54 | - menuItem = new JMenuItem(label); | |
55 | - menuItem.setEnabled(false); | |
40 | + super(label); | |
41 | + setEnabled(false); | |
56 | 42 | } |
57 | - | |
58 | - public boolean isEnabled() { | |
59 | - return menuItem.isEnabled(); | |
60 | - } | |
61 | - | |
43 | + | |
62 | 44 | public JMenuItem getMenuItem() { |
63 | - return menuItem; | |
45 | + return (JMenuItem) this; | |
64 | 46 | } |
65 | 47 | |
66 | - public void link(File file, String label) throws IOException { | |
67 | - menuItem.setActionCommand(file.getCanonicalPath()); | |
68 | - menuItem.setIcon(MenuHelper.getIcon(file)); | |
69 | - menuItem.setEnabled(true); | |
70 | - menuItem.setText(label); | |
71 | - if (menuItem.getActionListeners().length == 0) { | |
72 | - menuItem.addActionListener(MenuHelper.getActionListener()); | |
48 | + public void link(File file, String toolTipText) throws IOException { | |
49 | + setToolTipText(toolTipText); | |
50 | + setActionCommand(file.getCanonicalPath()); | |
51 | + setIcon(MenuHelper.getIcon(file)); | |
52 | + setEnabled(true); | |
53 | + | |
54 | + if (getActionListeners().length == 0) { | |
55 | + addActionListener(MenuHelper.getActionListener()); | |
73 | 56 | } |
74 | 57 | } |
75 | 58 | |
76 | - public void unlink(String label) { | |
77 | - menuItem.setEnabled(false); | |
78 | - menuItem.setActionCommand(""); | |
79 | - menuItem.setIcon(null); | |
80 | - menuItem.setText(label); | |
59 | + public void unlink() { | |
60 | + setToolTipText(null); | |
61 | + setEnabled(false); | |
62 | + setActionCommand(""); | |
63 | + setIcon(null); | |
81 | 64 | } |
82 | 65 | |
83 | - public void open() { | |
84 | - if (! menuItem.isEnabled()) { | |
85 | - return; | |
86 | - } | |
87 | - | |
88 | - String path = menuItem.getActionCommand(); | |
89 | - try { | |
90 | - switch (getOsType()) { | |
91 | - case WIN64: | |
92 | - case WIN32: | |
93 | - File file = new File(path); | |
94 | - if (! FilePreview.open(file)) { | |
95 | - Desktop.getDesktop().open(file); | |
96 | - } | |
97 | - break; | |
98 | - case MAC64: | |
99 | - case MAC32: | |
100 | - new ProcessBuilder("open", path).start(); | |
101 | - break; | |
102 | - default: // Linux and others | |
103 | - new ProcessBuilder("xdg-open", path).start(); | |
104 | - break; | |
105 | - } | |
106 | - } catch (IOException ex) { | |
107 | - Log.log(ex); | |
108 | - Core.getMainWindow().showMessageDialog(StaticUtils.format( | |
109 | - L10n.getErrMsgFileHasNoAssoc(), path)); | |
110 | - } | |
111 | - } | |
112 | 66 | } |
@@ -1,7 +1,7 @@ | ||
1 | 1 | /************************************************************************** |
2 | 2 | FolderMenu - easy access to project folders from menu. |
3 | 3 | |
4 | - Copyright (C) 2013 Yu Tang | |
4 | + Copyright (C) 2013-2014 Yu Tang | |
5 | 5 | Home page: http://sourceforge.jp/users/yu-tang/ |
6 | 6 | Support center: http://sourceforge.jp/users/yu-tang/ |
7 | 7 |
@@ -43,22 +43,14 @@ | ||
43 | 43 | public static String getUserConfigMenuLabel() { |
44 | 44 | return bundle.getString("USER_CONFIG_MENU_LABEL"); |
45 | 45 | } |
46 | - | |
47 | - public static String getCurrentSourceFileNoneMenuLabel() { | |
48 | - return bundle.getString("CURRENT_SOURCE_FILE_NONE_MENU_LABEL"); | |
46 | + | |
47 | + public static String getSourceDocumentMenuLabel() { | |
48 | + return bundle.getString("SOURCE_DOC_MENU_LABEL"); | |
49 | 49 | } |
50 | 50 | |
51 | - public static String getCurrentTargetFileNoneMenuLabel() { | |
52 | - return bundle.getString("CURRENT_TARGET_FILE_NONE_MENU_LABEL"); | |
51 | + public static String getTargetDocumentMenuLabel() { | |
52 | + return bundle.getString("TARGET_DOC_MENU_LABEL"); | |
53 | 53 | } |
54 | - | |
55 | - public static String getCurrentSourceFileMenuLabel() { | |
56 | - return bundle.getString("CURRENT_SOURCE_FILE_MENU_LABEL"); | |
57 | - } | |
58 | - | |
59 | - public static String getCurrentTargetFileMenuLabel() { | |
60 | - return bundle.getString("CURRENT_TARGET_FILE_MENU_LABEL"); | |
61 | - } | |
62 | 54 | |
63 | 55 | // for Word |
64 | 56 |
@@ -1,7 +1,7 @@ | ||
1 | 1 | /************************************************************************** |
2 | 2 | FolderMenu - easy access to project folders from menu. |
3 | 3 | |
4 | - Copyright (C) 2013 Yu Tang | |
4 | + Copyright (C) 2013-2014 Yu Tang | |
5 | 5 | Home page: http://sourceforge.jp/users/yu-tang/ |
6 | 6 | Support center: http://sourceforge.jp/users/yu-tang/pf/ |
7 | 7 |
@@ -22,7 +22,6 @@ | ||
22 | 22 | import javax.swing.JMenu; |
23 | 23 | import static jp.sourceforge.users.yutang.omegat.plugin.foldermenu.MenuHelper.getComparator; |
24 | 24 | import static jp.sourceforge.users.yutang.omegat.plugin.foldermenu.MenuHelper.getFilteredListFiles; |
25 | -import static jp.sourceforge.users.yutang.omegat.plugin.foldermenu.MenuHelper.getIcon; | |
26 | 25 | import static jp.sourceforge.users.yutang.omegat.plugin.foldermenu.MenuHelper.getMenuListener; |
27 | 26 | import static jp.sourceforge.users.yutang.omegat.plugin.foldermenu.MenuHelper.getMouseListener; |
28 | 27 | import org.omegat.util.Log; |
@@ -32,46 +31,38 @@ | ||
32 | 31 | * |
33 | 32 | * @author Yu Tang |
34 | 33 | */ |
35 | -public class ShellLinkMenu extends ShellLinkMenuItem { | |
34 | +public class ShellLinkMenu extends JMenu { | |
36 | 35 | |
37 | - public ShellLinkMenu(JMenu m) { | |
38 | - super(m); | |
36 | + @SuppressWarnings("LeakingThisInConstructor") | |
37 | + public ShellLinkMenu(File folder, String label) throws IOException { | |
38 | + this(folder); | |
39 | + Mnemonics.setLocalizedText(this, label); | |
39 | 40 | } |
40 | 41 | |
41 | 42 | public ShellLinkMenu(File folder) throws IOException { |
42 | - this(folder, null); | |
43 | + super(folder.getName()); | |
44 | + | |
45 | + addMenuListener(getMenuListener()); | |
46 | + addMouseListener(getMouseListener()); | |
47 | + | |
48 | + setIcon(MenuHelper.getIcon(folder)); | |
49 | + setActionCommand(folder.getCanonicalPath()); | |
43 | 50 | } |
44 | 51 | |
52 | + @SuppressWarnings("LeakingThisInConstructor") | |
45 | 53 | public ShellLinkMenu(String label) throws IOException { |
46 | - this(null, label); | |
47 | - } | |
54 | + super(); | |
55 | + Mnemonics.setLocalizedText(this, label); | |
48 | 56 | |
49 | - public ShellLinkMenu(File folder, String label) throws IOException { | |
50 | - JMenu m; | |
51 | - if (label == null) { | |
52 | - m = new JMenu(folder.getName()); | |
53 | - } else { | |
54 | - m = new JMenu(); | |
55 | - Mnemonics.setLocalizedText(m, label); | |
56 | - } | |
57 | - | |
58 | - m.addMenuListener(getMenuListener()); | |
59 | - m.addMouseListener(getMouseListener()); | |
60 | - | |
61 | - if (folder != null) { | |
62 | - m.setIcon(getIcon(folder)); | |
63 | - m.setActionCommand(folder.getCanonicalPath()); | |
64 | - } else { | |
65 | - m.setEnabled(false); | |
66 | - } | |
67 | - | |
68 | - menuItem = m; | |
57 | + addMenuListener(getMenuListener()); | |
58 | + addMouseListener(getMouseListener()); | |
59 | + | |
60 | + setEnabled(false); | |
69 | 61 | } |
70 | 62 | |
71 | 63 | public void createChildren() { |
72 | - JMenu menu = (JMenu) menuItem; | |
73 | - if (menu.isEnabled() && menu.getItemCount() == 0) { | |
74 | - File folder = new File(menu.getActionCommand()); | |
64 | + if (isEnabled() && getItemCount() == 0) { | |
65 | + File folder = new File(getActionCommand()); | |
75 | 66 | File[] filteredListFiles = getFilteredListFiles(folder); |
76 | 67 | Arrays.sort(filteredListFiles, getComparator()); |
77 | 68 |
@@ -78,9 +69,9 @@ | ||
78 | 69 | for (File file : filteredListFiles) { |
79 | 70 | try { |
80 | 71 | if (file.isDirectory() && hasChildren(file)) { |
81 | - menu.add(new ShellLinkMenu(file).getMenuItem()); | |
72 | + add(new ShellLinkMenu(file)); | |
82 | 73 | } else { |
83 | - menu.add(new ShellLinkMenuItem(file).getMenuItem()); | |
74 | + add(new ShellLinkMenuItem(file)); | |
84 | 75 | } |
85 | 76 | } catch (IOException ex) { |
86 | 77 | Log.log(ex); |
@@ -90,25 +81,24 @@ | ||
90 | 81 | } |
91 | 82 | |
92 | 83 | public JMenu getMenu() { |
93 | - return (JMenu) menuItem; | |
84 | + return (JMenu) this; | |
94 | 85 | } |
95 | 86 | |
96 | 87 | public void link(File folder) throws IOException { |
97 | - JMenu menu = (JMenu) menuItem; | |
98 | - menu.setActionCommand(folder.getCanonicalPath()); | |
99 | - menu.setIcon(getIcon(folder)); | |
100 | - menu.setEnabled(true); | |
88 | + setActionCommand(folder.getCanonicalPath()); | |
89 | + setIcon(MenuHelper.getIcon(folder)); | |
90 | + setEnabled(true); | |
101 | 91 | } |
102 | 92 | |
103 | 93 | public void unlink() { |
104 | - JMenu menu = (JMenu) menuItem; | |
105 | - menu.setEnabled(false); | |
106 | - menu.removeAll(); | |
107 | - menu.setActionCommand(""); | |
108 | - menu.setIcon(null); | |
94 | + setEnabled(false); | |
95 | + removeAll(); | |
96 | + setActionCommand(""); | |
97 | + setIcon(null); | |
109 | 98 | } |
110 | 99 | |
111 | 100 | private boolean hasChildren(File folder) { |
112 | 101 | return getFilteredListFiles(folder).length > 0; |
113 | 102 | } |
103 | + | |
114 | 104 | } |