diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e2ace42..6c4d0b1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,7 +12,7 @@ on: # The branches below must be a subset of the branches above branches: [master] # schedule: -# - cron: '0 10 * * 6' +# - cron: '0 6 * * 3' jobs: analyze: @@ -30,20 +30,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -54,7 +45,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # â„¹ï¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -68,4 +59,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..1ba3aa0 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,26 @@ +name: Java CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Check w/o SNAPSHOT when "bump version" + if: ${{ contains(github.event.head_commit.message, 'bump version') }} + run: grep "" pom.xml | head -1 | grep -v SNAPSHOT + + - name: Set up JDK 1.8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + + - name: Build with Maven + run: mvn -B package --file pom.xml diff --git a/.gitignore b/.gitignore index 3fec32c..a9bc98b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ tmp/ +local.properties diff --git a/pom.xml b/pom.xml index 371d5c9..e793982 100644 --- a/pom.xml +++ b/pom.xml @@ -5,18 +5,64 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 + vavi vavi-apps-treeview + 0.0.2 + Vavi TreeView Application - + vavi - 0.0.1 https://github.com/umjammer/vavi-apps-treeview + + https://github.com/umjammer/vavi-apps-treeview + + + https://github.com/umjammer/vavi-apps-treeview/issues + + + + + + run + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + run + + + + + + + + + + + + + + + + + + + + + + + org.apache.maven.plugins maven-compiler-plugin + 3.10.1 1.8 1.8 @@ -26,82 +72,84 @@ org.codehaus.mojo native2ascii-maven-plugin + 2.0.1 - native2ascii + resources - **/*_ja.properties + **/*.properties + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M7 + + + -Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties + + false + + - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.codehaus.mojo - native2ascii-maven-plugin - [1.0-alpha-1,) - - native2ascii - - - - - - - - - - - - + jitpack.io https://jitpack.io + + + + + org.junit + junit-bom + 5.9.1 + pom + import + + + + - - junit - junit - 4.13.1 - test - false - com.github.umjammer vavi-commons - 1.0.6 - false + 1.1.8 com.github.umjammer vavi-awt - 1.0.1 - false + 1.0.6 - - - https://github.com/umjammer/vavi-apps-treeview - - - https://github.com/umjammer/vavi-apps-treeview/issues - - TODO - + + com.formdev + flatlaf + 2.6 + runtime + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.platform + junit-platform-commons + test + + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e686659 --- /dev/null +++ b/readme.md @@ -0,0 +1,12 @@ +[![Release](https://jitpack.io/v/umjammer/vavi-apps-treeview.svg)](https://jitpack.io/#umjammer/vavi-apps-treeview) +[![Java CI](https://github.com/umjammer/vavi-apps-treeview/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/vavi-apps-treeview/actions/workflows/maven.yml) +[![CodeQL](https://github.com/umjammer/vavi-apps-treeview/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/umjammer/vavi-apps-treeview/actions/workflows/codeql-analysis.yml) +![Java](https://img.shields.io/badge/Java-8-b07219) + +# vavi-apps-treeview + +🣠Incubation for tree and application bindings. + +## References + + * [vavi-commons-sandbox](https://github.com/umjammer/vavi-commons-sandbox):dynamicmorphizm \ No newline at end of file diff --git a/src/main/java/vavi/apps/treeView/TreeNodeInfo.java b/src/main/java/vavi/apps/treeView/TreeNodeInfo.java index eb325b7..fafd663 100644 --- a/src/main/java/vavi/apps/treeView/TreeNodeInfo.java +++ b/src/main/java/vavi/apps/treeView/TreeNodeInfo.java @@ -18,16 +18,16 @@ public interface TreeNodeInfo extends BeanInfo { /** */ - public static final int ICON_COLOR_16x16_EXT1 = 4; + int ICON_COLOR_16x16_EXT1 = 4; /** */ - public static final int ICON_COLOR_32x32_EXT1 = 5; + int ICON_COLOR_32x32_EXT1 = 5; /** */ - public static final int ICON_COLOR_16x16_EXT2 = 6; + int ICON_COLOR_16x16_EXT2 = 6; /** */ - public static final int ICON_COLOR_32x32_EXT2 = 7; + int ICON_COLOR_32x32_EXT2 = 7; } /* */ diff --git a/src/main/java/vavi/apps/treeView/TreeView.java b/src/main/java/vavi/apps/treeView/TreeView.java index 813f856..8af9ab3 100644 --- a/src/main/java/vavi/apps/treeView/TreeView.java +++ b/src/main/java/vavi/apps/treeView/TreeView.java @@ -12,21 +12,19 @@ import java.awt.event.KeyEvent; import java.io.BufferedOutputStream; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.file.Files; import java.util.List; import java.util.Locale; import java.util.Properties; import java.util.ResourceBundle; - import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFileChooser; -import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; @@ -48,7 +46,7 @@ /** - * ツリービューã§ã™ï¼Ž + * The tree view. * * @author Naohide Sano (nsano) * @version 0.00 010820 nsano initial version
@@ -56,16 +54,16 @@ */ public class TreeView { - /** リソースãƒãƒ³ãƒ‰ãƒ« */ + /** */ private static final ResourceBundle rb = ResourceBundle.getBundle("vavi.apps.treeView.TreeViewResource", Locale.getDefault()); - /** Tree ã® UI */ + /** UI */ private TreeViewTree tree; - /** ルートã®ãƒ„リーノード */ + /** root tree node */ private TreeViewTreeNode root; - /** ステータスãƒãƒ¼ */ + /** status bar */ private JLabel statusBar = new JLabel(rb.getString("statusBar.welcome")); /** The popup menu */ @@ -74,31 +72,33 @@ public class TreeView { private TreeViewTreeEditor editor; /** - * TreeView を作æˆã—ã¾ã™ï¼Ž + * Creates TreeView. */ - public TreeView() { - + public TreeView(Object userObject) throws IOException { popupMenu = createPopupMenu(); setActionStates(null); - init(); - - tree = new TreeViewTree(root); + tree = new TreeViewTree(); tree.addEditorListener(el); + init(userObject); + InputStream is = vavi.swing.binding.treeview.TreeView.Util.init(userObject); + load(is); + tree.setRoot(root); + editor = new TreeViewTreeEditor(tree); editor.addEditorListener(el); } /** - * Tree ã® UI ã‚’è¿”ã—ã¾ã™ï¼Ž + * Gets Tree UI. */ public JTree getUI() { return tree; } /** - * メニューãƒãƒ¼ã‚’å–å¾—ã—ã¾ã™ï¼Ž + * Gets the menu bar. */ public JMenuBar getMenuBar() { JMenuBar menuBar = new JMenuBar(); @@ -154,7 +154,7 @@ public JMenuBar getMenuBar() { } /** - * ツールãƒãƒ¼ã‚’å–å¾—ã—ã¾ã™ï¼Ž + * Gets the tool bar. */ public JToolBar getToolBar() { JToolBar toolBar = new JToolBar(); @@ -177,26 +177,26 @@ public JToolBar getToolBar() { return toolBar; } - /** ステータスãƒãƒ¼ã‚’å–å¾—ã—ã¾ã™ï¼Ž */ + /** Gets the status bar. */ public JLabel getStatusBar() { return statusBar; } - /** ""メニュー */ + /** "" menu */ private JMenu objectMenu; - /** "ウインドウ"メニュー */ + /** "Window" menu */ private JMenu windowMenu; /** - * "ウィンドウ"メニューをå–å¾—ã—ã¾ã™ï¼Ž + * Gets "Window" menu. */ public JMenu getWindowMenu() { return windowMenu; } /** - * ãƒãƒƒãƒ—アップメニューã®è¨­å®šã‚’ã—ã¾ã™ï¼Ž + * Creates the popup menu. */ private JPopupMenu createPopupMenu() { @@ -221,64 +221,55 @@ private JPopupMenu createPopupMenu() { // ------------------------------------------------------------------------- /** */ - private Dao dao = new XmlDao(); + private Object userObject; /** - * åˆæœŸçŠ¶æ…‹ã«ã—ã¾ã™ï¼Ž + * Initializes. */ - private void init() { - try { - InputStream is = getClass().getResourceAsStream(props.getProperty("tv.resource.tree")); - root = dao.read(is); - } catch (Exception e) { -Debug.println(props.getProperty("tv.resource.tree") + " cannot read: tv.resource.tree"); -Debug.printStackTrace(e); - // System.exit(1); - } + public void init(Object userObject) { + this.userObject = userObject; } /** - * ツリーノードをロードã—ã¾ã™ï¼Ž + * Loads a tree nodes. */ @SuppressWarnings("unused") private void load(InputStream is) throws IOException { - root = dao.read(is); + root = vavi.swing.binding.treeview.TreeView.Util.load(userObject, is); ((DefaultTreeModel) tree.getModel()).setRoot(root); } /** - * ツリーノードをセーブã—ã¾ã™ï¼Ž + * Saves the tree nodes. */ private void save(OutputStream os) throws IOException { - dao.write(root, os); + vavi.swing.binding.treeview.TreeView.Util.save(userObject, os, root); } /** - * 終了ã—ã¾ã™ï¼Ž + * Exits the program. */ private void exit() { System.exit(0); } - // ------------------------------------------------------------------------- - private boolean isPastable = false; /** - * é¸æŠžã•ã‚Œã¦ã„るノードã«å¿œã˜ã¦ãƒ¡ãƒ‹ãƒ¥ãƒ¼è¡¨ç¤ºã‚’制御ã—ã¾ã™ï¼Ž + * Displays a menu suitable for a selected node. * - * @param node é¸æŠžã•ã‚ŒãŸãƒŽãƒ¼ãƒ‰ + * @param node selected dnode */ private void setActionStates(TreeViewTreeNode node) { - // ãã‚Œãžã‚Œã®ãƒ¡ãƒ‹ãƒ¥ãƒ¼ãŒå®Ÿè¡Œã§ãã‚‹ã‹ã‚’ãƒã‚§ãƒƒã‚¯ã—ã¦è¡¨ç¤ºã‚’決定 + // determine a menu for displaying by checking each menu is able to execute or not. - if (node != null) { // アイテムé¸æŠžæ™‚ + if (node != null) { // when item selected cutAction.setEnabled(node.canCut()); copyAction.setEnabled(node.canCopy()); pasteAction.setEnabled(node.canCopy() && isPastable); deleteAction.setEnabled(node.canDelete()); - } else { // アイテムéžé¸æŠžæ™‚ + } else { // when item not selected cutAction.setEnabled(false); copyAction.setEnabled(false); @@ -287,9 +278,7 @@ private void setActionStates(TreeViewTreeNode node) { } } - // ------------------------------------------------------------------------- - - /** ノードを開ãアクション */ + /** "Open" action */ private Action openAction = new AbstractAction(rb.getString("action.open"), (ImageIcon) UIManager.get("treeView.openIcon")) { public void actionPerformed(ActionEvent ev) { @@ -302,7 +291,7 @@ public void actionPerformed(ActionEvent ev) { }; /** - * オープンã®å‡¦ç†ã‚’è¡Œã„ã¾ã™ï¼Ž + * Processes "Open". * * @param node */ @@ -316,7 +305,7 @@ private void open(TreeViewTreeNode node) { } } - /** オブジェクトをカットã™ã‚‹ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ */ + /** "Cut" action */ private Action cutAction = new AbstractAction(rb.getString("action.cut"), (ImageIcon) UIManager.get("treeView.cutIcon")) { public void actionPerformed(ActionEvent ev) { @@ -330,7 +319,7 @@ public void actionPerformed(ActionEvent ev) { } }; - /** オブジェクトをコピーã™ã‚‹ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ */ + /** "Copy" action */ private Action copyAction = new AbstractAction(rb.getString("action.copy"), (ImageIcon) UIManager.get("treeView.copyIcon")) { public void actionPerformed(ActionEvent ev) { @@ -344,7 +333,7 @@ public void actionPerformed(ActionEvent ev) { } }; - /** オブジェクトをペーストã™ã‚‹ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ */ + /** "Paste" action */ private Action pasteAction = new AbstractAction(rb.getString("action.paste"), (ImageIcon) UIManager.get("treeView.pasteIcon")) { public void actionPerformed(ActionEvent ev) { @@ -358,14 +347,14 @@ public void actionPerformed(ActionEvent ev) { } }; - /** オブジェクトを削除ã™ã‚‹ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ */ + /** "Delete" action */ private Action deleteAction = new AbstractAction(rb.getString("action.delete"), (ImageIcon) UIManager.get("treeView.deleteIcon")) { public void actionPerformed(ActionEvent ev) { try { statusBar.setText(rb.getString("action.delete.start")); - // ダイアログã§å‰Šé™¤ã®ç¢ºèªã‚’ã—ã¾ã™ï¼Ž + // show confirm dialog if (JOptionPane.showConfirmDialog(null, rb.getString("action.delete.dialog"), rb.getString("dialog.title.confirm"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { editor.delete(); @@ -378,7 +367,7 @@ public void actionPerformed(ActionEvent ev) { } }; - /** ツリービューを終了ã™ã‚‹ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ */ + /** "Exit" action */ private Action exitAction = new AbstractAction(rb.getString("action.exit")) { public void actionPerformed(ActionEvent ev) { @@ -401,7 +390,7 @@ public void actionPerformed(ActionEvent ev) { /** */ private static final RegexFileFilter fileFilter = new RegexFileFilter(".+\\.xml", "XML File"); - /** åˆæœŸãƒ„リーã®ã‚»ãƒ¼ãƒ–ã‚’è¡Œã†ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ */ + /** "Save" action */ private Action saveAction = new AbstractAction(rb.getString("action.save")) { private JFileChooser fc = new JFileChooser(); { @@ -416,7 +405,7 @@ public void actionPerformed(ActionEvent ev) { return; } File file = fc.getSelectedFile(); - OutputStream os = new BufferedOutputStream(new FileOutputStream(file)); + OutputStream os = new BufferedOutputStream(Files.newOutputStream(file.toPath())); save(os); } catch (Exception e) { @@ -425,7 +414,7 @@ public void actionPerformed(ActionEvent ev) { } }; - /** ãƒãƒ¼ã‚¸ãƒ§ãƒ³è¡¨ç¤ºã‚’è¡Œã†ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ */ + /** "About" action */ private Action showVersionAction = new AbstractAction(rb.getString("action.showVersion")) { public void actionPerformed(ActionEvent ev) { @@ -435,55 +424,51 @@ public void actionPerformed(ActionEvent ev) { } }; - /** 使用説明ã®è¡¨ç¤ºã‚’è¡Œã†ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ */ + /** "Help" action */ private Action showManualAction = new AbstractAction(rb.getString("action.showManual")) { public void actionPerformed(ActionEvent ev) { try { - Runtime.getRuntime().exec(props.getProperty("tv.path.browser") + " " + props.getProperty("tv.url.manual")); + Runtime.getRuntime().exec(new String[] {props.getProperty("tv.path.browser"), props.getProperty("tv.url.manual")}); } catch (Exception e) { showError(e); } } }; - /** エラーメッセージã®ãƒ€ã‚¤ã‚¢ãƒ­ã‚°ã‚’表示ã—ã¾ã™ï¼Ž */ + /** Shows error dialog */ private void showError(Exception e) { - // Debug.printStackTrace(e); +// Debug.printStackTrace(e); statusBar.setText(e.getMessage()); JOptionPane.showMessageDialog(null, e.getMessage(), rb.getString("dialog.title.error"), JOptionPane.ERROR_MESSAGE); } - // ------------------------------------------------------------------------- - /** */ - private EditorListener el = new EditorListener() { - @SuppressWarnings("unchecked") - public void editorUpdated(EditorEvent ev) { - String name = ev.getName(); - if ("select".equals(name)) { - select((List) ev.getArgument()); - } else if ("expand".equals(name)) { - expand((TreeViewTreeNode) ev.getArgument()); - } else if ("popupMenu".equals(name)) { - Object[] args = (Object[]) ev.getArgument(); - showPopupMenu((TreeViewTreeNode) args[0], (Point) args[1]); - } else if ("rename".equals(name)) { - Object[] args = (Object[]) ev.getArgument(); - rename((TreeViewTreeNode) args[0], (String) args[1]); - } else if ("cut".equals(name)) { - isPastable = true; - } else if ("copy".equals(name)) { - isPastable = true; - } else if ("lostOwnership".equals(name)) { - isPastable = false; - } + @SuppressWarnings("unchecked") + private EditorListener el = ev -> { + String name = ev.getName(); + if ("select".equals(name)) { + select((List) ev.getArgument()); + } else if ("expand".equals(name)) { + expand((TreeViewTreeNode) ev.getArgument()); + } else if ("popupMenu".equals(name)) { + Object[] args = (Object[]) ev.getArgument(); + showPopupMenu((TreeViewTreeNode) args[0], (Point) args[1]); + } else if ("rename".equals(name)) { + Object[] args = (Object[]) ev.getArgument(); + rename((TreeViewTreeNode) args[0], (String) args[1]); + } else if ("cut".equals(name)) { + isPastable = true; + } else if ("copy".equals(name)) { + isPastable = true; + } else if ("lostOwnership".equals(name)) { + isPastable = false; } }; /** */ private void select(List selection) { - if (selection.size() == 1) { // アイテム(å˜ä½“)é¸æŠžæ™‚ + if (selection.size() == 1) { // one item selected TreeViewTreeNode node = selection.get(0); statusBar.setText(node.getUserObject().toString()); setActionStates(node); @@ -524,42 +509,35 @@ private void rename(TreeViewTreeNode node, String newValue) { } } - // ------------------------------------------------------------------------- - - /** EditorEvent 機構ã®ãƒ¦ãƒ¼ãƒ†ã‚£ãƒªãƒ†ã‚£ */ + /** EditorEvent utility */ private EditorSupport editorSupport = new EditorSupport(); - /** Editor リスナーを追加ã—ã¾ã™ï¼Ž */ + /** Adds an Editor listener. */ public void addEditorListener(EditorListener l) { editorSupport.addEditorListener(l); } - /** Editor リスナーを削除ã—ã¾ã™ï¼Ž */ + /** Removes an Editor listener. */ public void removeEditorListener(EditorListener l) { editorSupport.removeEditorListener(l); } - /** EditorEvent を発行ã—ã¾ã™ï¼Ž */ + /** Fires an Editor event. */ protected void fireEditorUpdated(EditorEvent ev) { editorSupport.fireEditorUpdated(ev); } - // ------------------------------------------------------------------------- - - /** プロパティ */ + /** */ static Properties props = new Properties(); - /** - * åˆæœŸåŒ–ã—ã¾ã™ï¼Ž - */ + /* */ static { final String path = "TreeView.properties"; final Class clazz = TreeView.class; try { - Properties ps = new Properties(); InputStream is = clazz.getResourceAsStream(path); - ps.load(is); + props.load(is); is.close(); Toolkit t = Toolkit.getDefaultToolkit(); @@ -581,30 +559,10 @@ protected void fireEditorUpdated(EditorEvent ev) { i++; } - - props = new Properties(); - is = clazz.getResourceAsStream("/local.properties"); - props.load(is); - is.close(); } catch (Exception e) { - e.printStackTrace();; - System.exit(1); + throw new IllegalStateException(e); } } - - // ------------------------------------------------------------------------- - - /** - * プログラムエントリã§ã™ï¼Ž - */ - public static void main(String[] args) throws Exception { - - TreeView tree = new TreeView(); - - JFrame frame = new TreeViewFrame(tree); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - frame.setVisible(true); - } } /* */ diff --git a/src/main/java/vavi/apps/treeView/TreeViewFrame.java b/src/main/java/vavi/apps/treeView/TreeViewFrame.java index 66b12a2..70a514e 100644 --- a/src/main/java/vavi/apps/treeView/TreeViewFrame.java +++ b/src/main/java/vavi/apps/treeView/TreeViewFrame.java @@ -8,9 +8,12 @@ import java.awt.BorderLayout; import java.awt.Dimension; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; import java.util.Locale; import java.util.Properties; import java.util.ResourceBundle; +import java.util.prefs.Preferences; import javax.swing.JDesktopPane; import javax.swing.JFrame; @@ -19,6 +22,8 @@ import javax.swing.JSplitPane; import javax.swing.border.BevelBorder; +import vavi.util.Debug; + /** * TreeView をアプリケーションã¨ã—ã¦ä½¿ç”¨ã™ã‚‹éš›ã®ãƒ•ãƒ¬ãƒ¼ãƒ ã§ã™ï¼Ž @@ -44,14 +49,11 @@ public TreeViewFrame(TreeView treeView) { JLabel statusBar = treeView.getStatusBar(); statusBar.setBorder(new BevelBorder(BevelBorder.LOWERED)); - /* - * statusBar.setPreferredSize(new Dimension( statusBar.getWidth() + statusBar.getInsets().left + - * statusBar.getInsets().right, statusBar.getHeight() + statusBar.getInsets().top + statusBar.getInsets().bottom)); - * Debug.println("status bar: " + statusBar.getWidth() + ", " + statusBar.getHeight()); Debug.println("status bar: " + - * statusBar.getPreferredSize().width + ", " + statusBar.getPreferredSize().height); Debug.println("status bar: " + - * statusBar.getWidth() + statusBar.getInsets().left + statusBar.getInsets().right + ", " + statusBar.getHeight() + - * statusBar.getInsets().top + statusBar.getInsets().bottom); - */ + +//statusBar.setPreferredSize(new Dimension(statusBar.getWidth() + statusBar.getInsets().left + statusBar.getInsets().right, statusBar.getHeight() + statusBar.getInsets().top + statusBar.getInsets().bottom)); +//Debug.println("status bar: " + statusBar.getWidth() + ", " + statusBar.getHeight()); +//Debug.println("status bar: " + statusBar.getPreferredSize().width + ", " + statusBar.getPreferredSize().height); +//Debug.println("status bar: " + statusBar.getWidth() + statusBar.getInsets().left + statusBar.getInsets().right + ", " + statusBar.getHeight() + statusBar.getInsets().top + statusBar.getInsets().bottom); Dimension d = this.getToolkit().getScreenSize(); @@ -59,6 +61,12 @@ public TreeViewFrame(TreeView treeView) { scrollPane.setPreferredSize(new Dimension(d.width / 5, d.height)); JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scrollPane, desktop); + sp.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, e -> { +Debug.println("split out: " + (double) (int) e.getNewValue() / sp.getMaximumDividerLocation()); + prefs.putDouble("tv.frame.split", (double) (int) e.getNewValue() / sp.getMaximumDividerLocation()); + }); +Debug.println("split in: " + prefs.getDouble("tv.frame.split", 0.3)); + sp.setDividerLocation(prefs.getDouble("tv.frame.split", 0.3)); setJMenuBar(treeView.getMenuBar()); getContentPane().add(treeView.getToolBar(), BorderLayout.NORTH); @@ -67,13 +75,28 @@ public TreeViewFrame(TreeView treeView) { setSize(d.width * 6 / 7, d.height * 6 / 7); - setSize(FRAME_WIDTH, FRAME_HEIGHT); - setLocation(FRAME_X, FRAME_Y); - - validate(); + int width = prefs.getInt("tv.frame.width", 800); + int height = prefs.getInt("tv.frame.height", 640); + int x = prefs.getInt("tv.frame.x", 100); + int y = prefs.getInt("tv.frame.y", 200); + + setPreferredSize(new Dimension(width, height)); + setLocation(x, y); + + pack(); + + addComponentListener(new ComponentAdapter() { + @Override public void componentResized(ComponentEvent e) { + prefs.putInt("tv.frame.width", getWidth()); + prefs.putInt("tv.frame.height", getHeight()); + } + @Override public void componentMoved(ComponentEvent e) { + prefs.putInt("tv.frame.x", getX()); + prefs.putInt("tv.frame.y", getY()); + } + }); } - // ------------------------------------------------------------------------- /** * Gets the virtual desktop. @@ -82,28 +105,8 @@ public JDesktopPane getUI() { return desktop; } - // ------------------------------------------------------------------------- - - /** å¹… */ - private static final int FRAME_WIDTH; - - /** 高㕠*/ - private static final int FRAME_HEIGHT; - - /** 横ã®ä½ç½® */ - private static final int FRAME_X; - - /** 縦ã®ä½ç½® */ - private static final int FRAME_Y; - - static { - Properties props = TreeView.props; - - FRAME_WIDTH = Integer.parseInt(props.getProperty("tv.frame.width")); - FRAME_HEIGHT = Integer.parseInt(props.getProperty("tv.frame.height")); - FRAME_X = Integer.parseInt(props.getProperty("tv.frame.x")); - FRAME_Y = Integer.parseInt(props.getProperty("tv.frame.y")); - } + /** */ + private static Preferences prefs = Preferences.userNodeForPackage(TreeView.class); } /* */ diff --git a/src/main/java/vavi/apps/treeView/TreeViewTree.java b/src/main/java/vavi/apps/treeView/TreeViewTree.java index c4e58ac..67fbebb 100644 --- a/src/main/java/vavi/apps/treeView/TreeViewTree.java +++ b/src/main/java/vavi/apps/treeView/TreeViewTree.java @@ -49,7 +49,7 @@ /** * ツリービューã§ã™ï¼Ž * - * @todo 複数 DnD + * TODO 複数 DnD * * @event EditorEvent("expand") * @event EditorEvent("popupMenu") @@ -62,18 +62,23 @@ public class TreeViewTree extends JTree { /** - * æ画ツリーを作æˆã—ã¾ã™ï¼Ž - * * @param root ツリーã®ãƒ¢ãƒ‡ãƒ« */ - public TreeViewTree(TreeViewTreeNode root) { + public void setRoot(TreeViewTreeNode root) { root.addEditorListener(el); TreeViewTreeModel treeModel = new TreeViewTreeModel(root); - setModel(treeModel); + super.setModel(treeModel); + } + + /** + * æ画ツリーを作æˆã—ã¾ã™ï¼Ž + */ + public TreeViewTree() { + setCellRenderer(tcr); - // rename ã§ãるよã†ã«ã™ã‚‹ + // make the tree view able to rename setEditable(true); addMouseListener(ml); @@ -89,7 +94,7 @@ public TreeViewTree(TreeViewTreeNode root) { image = (Image) UIManager.get("treeViewTree.dragImage"); } - /** Transferable データをå–å¾—ã—ã¾ã™ï¼Ž */ + /** gets Transferable */ protected Transferable getTransferable(DragGestureEvent ev) { TreeViewTreeNode node = getTreeNode(); if (node == null) { @@ -110,21 +115,21 @@ protected Transferable getTransferable(DragGestureEvent ev) { } } - /** DnD を終了ã—ã¾ã™ï¼Ž */ + /** terminates DnD */ protected void dragDropEnd(DragSourceEvent ev) { Debug.println("here"); setEditable(true); } }; - // ドロップã•ã‚Œã‚‹å´ã®ã‚¯ãƒ©ã‚¹ + // the class to drop new DropTarget(this, DnDConstants.ACTION_COPY_OR_MOVE, new TreeViewTreeDTListener(this), true); } // ------------------------------------------------------------------------- /** - * é¸æŠžã•ã‚Œã¦ã„るツリーノードを返ã—ã¾ã™ï¼Ž + * Returns a selected tree node. * * @return a selected tree node */ @@ -138,7 +143,7 @@ public TreeViewTreeNode getTreeNode() { } /** - * ç¾åœ¨ã®ãƒžã‚¦ã‚¹ã®ãƒã‚¸ã‚·ãƒ§ãƒ³ã«ã‚るツリーノードを返ã—ã¾ã™ï¼Ž + * Returns a node that located at mouse pointer. * * @param x x point of mouse * @param y y point of mouse @@ -154,9 +159,9 @@ private TreeViewTreeNode getTreeNode(int x, int y) { } /** - * TreeViewTree ã®ã‚»ãƒ¬ã‚¯ã‚·ãƒ§ãƒ³ãƒªã‚¹ãƒŠã§ã™ï¼Ž + * The selection listener for TreeViewTree. */ - private TreeSelectionListener tsl = new TreeSelectionListener() { + private final TreeSelectionListener tsl = new TreeSelectionListener() { /** ツリーã®é¸æŠžãŒå¤‰æ›´ã•ã‚ŒãŸå ´åˆã«å‘¼ã°ã‚Œã¾ã™ï¼Ž */ public void valueChanged(TreeSelectionEvent ev) { @@ -166,8 +171,8 @@ public void valueChanged(TreeSelectionEvent ev) { } Vector selection = new Vector<>(); - for (int i = 0; i < selected.length; i++) { - selection.addElement(selected[i].getLastPathComponent()); + for (TreePath treePath : selected) { + selection.addElement(treePath.getLastPathComponent()); } // TreeViewActions @@ -176,9 +181,9 @@ public void valueChanged(TreeSelectionEvent ev) { }; /** - * ツリー上ã®ãƒžã‚¦ã‚¹ã®ã‚¤ãƒ™ãƒ³ãƒˆå‡¦ç†ã‚’è¡Œã†ã‚¯ãƒ©ã‚¹ã§ã™ï¼Ž + * Process mouse events for the tree. */ - private MouseListener ml = new MouseAdapter() { + private final MouseListener ml = new MouseAdapter() { /** マウスãŒã‚¯ãƒªãƒƒã‚¯ã•ã‚ŒãŸã¨ã呼ã°ã‚Œã¾ã™ï¼Ž */ public void mouseClicked(MouseEvent ev) { @@ -189,7 +194,7 @@ public void mouseClicked(MouseEvent ev) { TreeViewTree.this, "expand", node)); } - // ãƒãƒƒãƒ—アップメニューをãã®ä½ç½®ã«è¡¨ç¤ºã™ã‚‹ + // display the popup menu at the mouse cursor if (SwingUtilities.isRightMouseButton(ev)) { // if (ev.getModifiers() == MouseEvent.BUTTON3_MASK) { // if (ev.isPopupTrigger()) { @@ -203,9 +208,9 @@ public void mouseClicked(MouseEvent ev) { }; /** - * ツリーã®ãƒ¢ãƒ‡ãƒ«ã®ã‚¯ãƒ©ã‚¹ã§ã™ï¼Ž + * Thr tree model. * - * @version 000214 nsano fix not renamable node bug. + * @version 000214 nsano fix not able to rename node bug. */ private final class TreeViewTreeModel extends DefaultTreeModel { /** */ @@ -222,20 +227,16 @@ public void valueForPathChanged(TreePath path, Object newValue) { } } - // ------------------------------------------------------------------------- - /** */ - private EditorListener el = new EditorListener() { - public void editorUpdated(EditorEvent ev) { - String name = ev.getName(); - if ("expand".equals(name)) { // フォルダã®å±•é–‹ - expand((TreePath) ev.getArgument()); - } else if ("delete".equals(name)) { // 削除 - Object[] args = (Object[]) ev.getArgument(); - delete((TreeNode) args[0], (int[]) args[1], (TreeNode[]) args[2]); - } else if ("insert".equals(name)) { // 追加 - insert((TreeNode) ev.getArgument()); - } + private final EditorListener el = ev -> { + String name = ev.getName(); + if ("expand".equals(name)) { // expands folders + expand((TreePath) ev.getArgument()); + } else if ("delete".equals(name)) { // remove + Object[] args = (Object[]) ev.getArgument(); + delete((TreeNode) args[0], (int[]) args[1], (TreeNode[]) args[2]); + } else if ("insert".equals(name)) { // insert + insert((TreeNode) ev.getArgument()); } }; @@ -256,10 +257,8 @@ private void insert(TreeNode node) { treeModel.nodeStructureChanged(node); } - // ------------------------------------------------------------------------- - /** - * ツリーã®ã‚»ãƒ«ãƒ¬ãƒ³ãƒ€ãƒ©ã®ã‚¯ãƒ©ã‚¹ã§ã™ï¼Ž + * The tree cell renderer. */ private TreeCellRenderer tcr = new DefaultTreeCellRenderer() { /** @@ -272,10 +271,14 @@ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean this.hasFocus = hasFocus; + if (!(value instanceof TreeViewTreeNode)) { + return this; + } + TreeViewTreeNode node = (TreeViewTreeNode) value; - // Debug.println(Debug.DEBUG, "node: " + node); +// Debug.println(Debug.DEBUG, "node: " + node); Object data = node.getUserObject(); - // Debug.println(Debug.DEBUG, "data: " + data); +// Debug.println(Debug.DEBUG, "data: " + data); /* Set the text. */ setText(data.toString()); @@ -293,7 +296,7 @@ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean try { Class beanClass = data.getClass(); - // Debug.println(beanClass); +//Debug.println(beanClass); BeanInfo info = Introspector.getBeanInfo(beanClass); /* Set the image. */ Image image; @@ -316,7 +319,7 @@ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean Debug.println(Level.SEVERE, e); } - // Debug.println(Debug.DEBUG, item); +//Debug.println(Debug.DEBUG, item); /* Set the image. */ if (node.isCut()) { setIcon(UIManager.getIcon("treeViewTree.markIcon")); @@ -343,35 +346,31 @@ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean } }; - // ------------------------------------------------------------------------- - - /** EditorEvent 機構ã®ãƒ¦ãƒ¼ãƒ†ã‚£ãƒªãƒ†ã‚£ */ + /** EditorEvent utility */ private EditorSupport editorSupport = new EditorSupport(); - /** Editor リスナーを追加ã—ã¾ã™ï¼Ž */ + /** Adds an Editor listener. */ public void addEditorListener(EditorListener l) { editorSupport.addEditorListener(l); } - /** Editor リスナーを削除ã—ã¾ã™ï¼Ž */ + /** Removes an Editor listener. */ public void removeEditorListener(EditorListener l) { editorSupport.removeEditorListener(l); } - /** EditorEvent を発行ã—ã¾ã™ï¼Ž */ + /** Fires an Editor event. */ protected void fireEditorUpdated(EditorEvent ev) { editorSupport.fireEditorUpdated(ev); } - // ------------------------------------------------------------------------- - static { Toolkit t = Toolkit.getDefaultToolkit(); Class clazz = TreeViewTree.class; UIDefaults table = UIManager.getDefaults(); - table.put("treeViewTree.markIcon", LookAndFeel.makeIcon(clazz, "resources/mark.png")); - table.put("treeViewTree.defaultIcon", LookAndFeel.makeIcon(clazz, "resources/default_file.png")); - table.put("treeViewTree.dragImage", t.getImage(clazz.getResource("resources/default_file.png"))); + table.put("treeViewTree.markIcon", LookAndFeel.makeIcon(clazz, "node/mark.png")); + table.put("treeViewTree.defaultIcon", LookAndFeel.makeIcon(clazz, "node/default_file.png")); + table.put("treeViewTree.dragImage", t.getImage(clazz.getResource("node/default_file.png"))); } } diff --git a/src/main/java/vavi/apps/treeView/TreeViewTreeNode.java b/src/main/java/vavi/apps/treeView/TreeViewTreeNode.java index c703454..20abd5b 100644 --- a/src/main/java/vavi/apps/treeView/TreeViewTreeNode.java +++ b/src/main/java/vavi/apps/treeView/TreeViewTreeNode.java @@ -62,8 +62,6 @@ public String toString() { public void setActionStates() { } - // ------------------------------------------------------------------------- - /** * オープンã—ã¾ã™ï¼Ž * @@ -128,8 +126,6 @@ public void delete() throws TreeViewException { throw new TreeViewException(rb.getString("action.delete.error")); } - // ------------------------------------------------------------------------- - /** オープンã—ãŸã¨ãビューを変更ã—ã¾ã™ï¼Ž */ protected void openController() { fireEditorUpdated(new EditorEvent(this, "expand", new TreePath(getPath()))); @@ -209,8 +205,6 @@ public boolean canDelete() { return false; } - // ------------------------------------------------------------------------- - /** * {@link DefaultMutableTreeNode#getUserObject()} 㯠transient ã§ã™ã€‚ * ã“ã®ãƒ„リーノードを直列化ã™ã‚‹ãŸã‚ã«ã‚ªãƒ¼ãƒãƒ©ã‚¤ãƒ‰ã—ã¾ã™ã€‚ @@ -234,8 +228,6 @@ public Object getUserObject() { return userObject; } - //---- - /** EditorEvent 機構ã®ãƒ¦ãƒ¼ãƒ†ã‚£ãƒªãƒ†ã‚£ */ private static EditorSupport editorSupport = new EditorSupport(); @@ -254,8 +246,6 @@ protected void fireEditorUpdated(EditorEvent ev) { editorSupport.fireEditorUpdated(ev); } - //---- - private boolean isSelected; /** */ diff --git a/src/main/java/vavi/apps/treeView/node/package.html b/src/main/java/vavi/apps/treeView/node/package.html deleted file mode 100644 index b1224d6..0000000 --- a/src/main/java/vavi/apps/treeView/node/package.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - -vavi.apps.treeView.node - - - - - - -

-ツリービューを実装ã™ã‚‹ãŸã‚ã®ãƒŽãƒ¼ãƒ‰ã‚’æä¾›ã—ã¾ã™ï¼Ž -

- -

-ã“ã‚Œã‹ã‚‰å®Ÿè£…ã™ã‚‹ã“㨠-

- -
    -
  • -
  • -
- - - - diff --git a/src/main/java/vavi/apps/treeView/package-info.java b/src/main/java/vavi/apps/treeView/package-info.java new file mode 100644 index 0000000..7ba4f3b --- /dev/null +++ b/src/main/java/vavi/apps/treeView/package-info.java @@ -0,0 +1,14 @@ +/** + * Provides TreeView classes. + *

+ * TODO + * * make "userObject" "java beans" + * * tell node modification to user object via messaging (observer, observable?) + * * pluggable menu + * * create menus by extracting verbs from a bean + * * multiple DnD + * * right panel is "beans property editor" + * * try PropertyResourceBundle + */ +package vavi.apps.treeView; + diff --git a/src/main/java/vavi/apps/treeView/package.html b/src/main/java/vavi/apps/treeView/package.html deleted file mode 100644 index 45c537b..0000000 --- a/src/main/java/vavi/apps/treeView/package.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - -vavi.apps.treeView - - - - - -

-ツリービューを実装ã™ã‚‹ãŸã‚ã®åŸºæœ¬ã‚¯ãƒ©ã‚¹ã‚’æä¾›ã—ã¾ã™ï¼Ž -

- -

-習作 -

- -
    -
  • {@link vavi.apps.treeView.XMLSaver} ã¯æ–°è¦ã« XML ドキュメントを作æˆã™ã‚‹ã‚µãƒ³ãƒ—ルã«ãªã£ã¦ã„ã¾ã™ï¼Ž -
  • -
- -

-ã“ã‚Œã‹ã‚‰å®Ÿè£…ã™ã‚‹ã“㨠-

- -
    -
  • userObject ã‚’ java beans ã«ã™ã‚‹
  • -
  • ノードã®å¤‰æ›´ã‚’ユーザオブジェクトã«ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãƒ³ã‚°ã§çŸ¥ã‚‰ã›ã‚‹(observer, observable?)
  • -
  • プラガブルメニュー
  • -
  • ビーンズã‹ã‚‰å‹•è©žã‚’å–å¾—ã—ã¦ãƒ¡ãƒ‹ãƒ¥ãƒ¼ã‚’作æˆ
  • -
  • 複数ドラッグアンドドロップ
  • -
  • å³ã®ãƒ‘ãƒãƒ«ã¯ãƒ“ーンズã®ãƒ—ロパティエディタ
  • -
  • PropertyResourceBundle を使ã£ã¦ã¿ã‚‹
  • -
- - - - diff --git a/src/main/java/vavi/swing/binding/treeview/TreeView.java b/src/main/java/vavi/swing/binding/treeview/TreeView.java new file mode 100644 index 0000000..d5d7d82 --- /dev/null +++ b/src/main/java/vavi/swing/binding/treeview/TreeView.java @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2022 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package vavi.swing.binding.treeview; + +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.NoSuchElementException; + +import vavi.apps.treeView.TreeViewTreeNode; + + +/** + * TreeView. + * + * @author Naohide Sano (nsano) + * @version 0.00 2022/12/11 nsano initial version
+ */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface TreeView { + + String init() default "init"; + + String load() default "load"; + + String save() default "save"; + + /** + * TODO when annotated to method + */ + class Util { + + private Util() { + } + + /** */ + public static InputStream init(Object bean) { + // + TreeView annotation = bean.getClass().getAnnotation(TreeView.class); + if (annotation == null) { + throw new IllegalArgumentException("bean is not annotated with @TreeView"); + } + + String name = annotation.init(); + + Class clazz = bean.getClass(); + while (clazz != null) { + for (Method method : clazz.getDeclaredMethods()) { + if (method.getName().equals(name)) { + try { + return (InputStream) method.invoke(bean); + } catch (IllegalAccessException | InvocationTargetException e) { + throw new IllegalStateException(e); + } + } + } + clazz = clazz.getSuperclass(); + } + + throw new NoSuchElementException(name); + } + + /** */ + public static TreeViewTreeNode load(Object bean, InputStream is) { + // + TreeView annotation = bean.getClass().getAnnotation(TreeView.class); + if (annotation == null) { + throw new IllegalArgumentException("bean is not annotated with @TreeView"); + } + + String name = annotation.load(); + + Class clazz = bean.getClass(); + while (clazz != null) { + for (Method method : clazz.getDeclaredMethods()) { + if (method.getName().equals(name)) { + try { + return (TreeViewTreeNode) method.invoke(bean, is); + } catch (IllegalAccessException | InvocationTargetException e) { + throw new IllegalStateException(e); + } + } + } + clazz = clazz.getSuperclass(); + } + + throw new NoSuchElementException(name); + } + + /** */ + public static void save(Object bean, OutputStream os, TreeViewTreeNode root) { + // + TreeView annotation = bean.getClass().getAnnotation(TreeView.class); + if (annotation == null) { + throw new IllegalArgumentException("bean is not annotated with @TreeView"); + } + + String name = annotation.save(); + + Class clazz = bean.getClass(); + while (clazz != null) { + for (Method method : clazz.getDeclaredMethods()) { + if (method.getName().equals(name)) { + try { + method.invoke(bean, os, root); + return; + } catch (IllegalAccessException | InvocationTargetException e) { + throw new IllegalStateException(e); + } + } + } + clazz = clazz.getSuperclass(); + } + + throw new NoSuchElementException(name); + } + } +} + +/* */ diff --git a/src/main/resources/vavi/apps/treeView/TreeViewResource_ja.properties b/src/main/native2ascii/vavi/apps/treeView/TreeViewResource_ja_JP.properties similarity index 100% rename from src/main/resources/vavi/apps/treeView/TreeViewResource_ja.properties rename to src/main/native2ascii/vavi/apps/treeView/TreeViewResource_ja_JP.properties diff --git a/src/main/native2ascii/vavi/apps/treeView/ja.properties b/src/main/native2ascii/vavi/apps/treeView/ja.properties deleted file mode 100644 index 9f96321..0000000 --- a/src/main/native2ascii/vavi/apps/treeView/ja.properties +++ /dev/null @@ -1,140 +0,0 @@ -# -# Copyright (c) 2001 by Naohide Sano, All rights reserved. -# -# Programmed by Naohide Sano -# -# TreeView ‚ÅŽg—p‚³‚ê‚郃bƒZ[ƒW‚̃Šƒ\[ƒX(“ú–{Œê)‚Å‚·D -# -# @author Naohide Sano (nsano) -# @version 0.00 010820 nsano initial version
-# 1.00 010909 nsano refine
-# 2.00 010909 nsano use PropertyResourceBundle
-# - -# -# ƒo[ƒWƒ‡ƒ“î•ñ -# -version.title=ƒcƒŠ[ƒrƒ…[ -version.copyright=Copyright (c) 2001-2002 by Naohide Sano -version.revision=Ver. 0.20 -version.build=2002-05-22 - -# -# TreeViewActions -# -menu.file=ƒtƒ@ƒCƒ‹(F) -action.open=ŠJ‚­ -action.save=•Û‘¶ -action.exit=I—¹ - -menu.edit=•ÒW(E) -action.cut=Ø‚èŽæ‚è -action.copy=ƒRƒs[ -action.paste=“\‚è•t‚¯ -action.delete=íœ - -menu.object=ƒIƒuƒWƒFƒNƒg(O) - -menu.window=ƒEƒCƒ“ƒhƒE(W) - -menu.help=ƒwƒ‹ƒv(H) -action.showVersion=ƒo[ƒWƒ‡ƒ“î•ñ -action.showManual=ƒwƒ‹ƒv - -# -# exit -# -action.exit.dialog=I—¹‚µ‚Ä‚à‚æ‚낵‚¢‚Å‚·‚©H - -# -# new -# -action.new.start=V‹K쬂µ‚Ü‚·D -action.new.end=V‹K쬂µ‚Ü‚µ‚½D -action.new.error=V‹K쬂ł«‚Ü‚¹‚ñD - -# -# open -# -action.open.start=ŠJ‚«‚Ü‚·D -action.open.end=ŠJ‚«‚Ü‚µ‚½D -action.open.error=ŠJ‚¯‚Ü‚¹‚ñD - -# -# insert -# -action.insert.start=’ljÁ‚µ‚Ü‚µ‚½D -action.insert.error=’ljÁ‚Å‚«‚Ü‚¹‚ñD - -# -# rename -# -action.rename.error=–¼‘O‚ð•ÏX‚Å‚«‚Ü‚¹‚ñD - -# -# cut -# -action.cut.start=ƒJƒbƒg‚µ‚Ü‚·D -action.cut.end=ƒJƒbƒg‚µ‚Ü‚µ‚½D -action.cut.error=ƒJƒbƒg‚Å‚«‚Ü‚¹‚ñD - -# -# copy -# -action.copy.start=ƒRƒs[‚µ‚Ü‚·D -action.copy.end=ƒRƒs[‚µ‚Ü‚µ‚½D -action.copy.error=ƒRƒs[‚Å‚«‚Ü‚¹‚ñD - -# -# paste -# -action.paste.start=“\‚è•t‚¯‚Ü‚·D -action.paste.end=“\‚è•t‚¯‚Ü‚µ‚½D -action.paste.error=“\‚è•t‚¯‚ç‚ê‚Ü‚¹‚ñD -action.paste.nest=ƒlƒXƒg‚µ‚Ä‚¢‚é‚Ì‚Å“\‚è•t‚¯‚ç‚ê‚Ü‚¹‚ñD -action.paste.same=“¯‚¶êŠ‚É“\‚è•t‚¯‚ç‚ê‚Ü‚¹‚ñD - -# -# delete -# -action.delete.start=휂µ‚Ü‚·D -action.delete.end=휂µ‚Ü‚µ‚½D -action.delete.dialog=‚ð휂µ‚Ä‚à‚æ‚낵‚¢‚Å‚·‚©H -action.delete.error=휂ł«‚Ü‚¹‚ñD - -# -# setProperty -# -action.setProperty.start=ƒvƒƒpƒeƒB‚ð•ÏX‚µ‚Ü‚·D -action.setProperty.end=ƒvƒƒpƒeƒB‚ð•ÏX‚µ‚Ü‚µ‚½D -action.setProperty.error=ƒvƒƒpƒeƒB‚ð•ÏX‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½D -action.setProperty.cancel=ƒvƒƒpƒeƒB‚Ì•ÏX‚𒆎~‚µ‚Ü‚µ‚½D - -# -# status bar -# -statusBar.welcome=‚悤‚±‚»ƒcƒŠ[ƒrƒ…[‚ÖI - -# -# dialog title -# -dialog.title.error=ƒGƒ‰[ -dialog.title.confirm=Šm”F -dialog.title.showVersion=î•ñ -dialog.title.exit=I—¹ - -# -# TreeViewConstants -# -property.file=‚Ì‘¶Ý‚ðŠm‚©‚߂ĉº‚³‚¢I -property.value=ƒvƒƒpƒeƒB‚Ì’l‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñD - -# -# -# -action.setProperty=ƒvƒƒpƒeƒB -menu.new=V‹Kì¬ -action.newFolder=ƒtƒHƒ‹ƒ_ -action.newFile=ƒtƒ@ƒCƒ‹ - -## diff --git a/src/main/resources/vavi/apps/treeView/TreeView.properties b/src/main/resources/vavi/apps/treeView/TreeView.properties index d5e15c0..79c4481 100644 --- a/src/main/resources/vavi/apps/treeView/TreeView.properties +++ b/src/main/resources/vavi/apps/treeView/TreeView.properties @@ -1,23 +1,23 @@ -# -# Copyright (c) 2001 by Naohide Sano, All rights reserved. -# -# Properties File for Oracle Workbench Applications -# -# 010821 nsano initial version -# - -# -# resource -# -tv.action.0.iconName=treeView.openIcon -tv.action.0.icon=resources/open.png -tv.action.1.iconName=treeView.deleteIcon -tv.action.1.icon=resources/delete.png -tv.action.2.iconName=treeView.cutIcon -tv.action.2.icon=resources/cut.png -tv.action.3.iconName=treeView.copyIcon -tv.action.3.icon=resources/copy.png -tv.action.4.iconName=treeView.pasteIcon -tv.action.4.icon=resources/paste.png - -# +# +# Copyright (c) 2001 by Naohide Sano, All rights reserved. +# +# Properties File for Oracle Workbench Applications +# +# 010821 nsano initial version +# + +# +# resource +# +tv.action.0.iconName=treeView.openIcon +tv.action.0.icon=open.png +tv.action.1.iconName=treeView.deleteIcon +tv.action.1.icon=delete.png +tv.action.2.iconName=treeView.cutIcon +tv.action.2.icon=cut.png +tv.action.3.iconName=treeView.copyIcon +tv.action.3.icon=copy.png +tv.action.4.iconName=treeView.pasteIcon +tv.action.4.icon=paste.png + +# diff --git a/src/main/resources/vavi/apps/treeView/resources/copy.png b/src/main/resources/vavi/apps/treeView/copy.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/resources/copy.png rename to src/main/resources/vavi/apps/treeView/copy.png diff --git a/src/main/resources/vavi/apps/treeView/resources/cut.png b/src/main/resources/vavi/apps/treeView/cut.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/resources/cut.png rename to src/main/resources/vavi/apps/treeView/cut.png diff --git a/src/main/resources/vavi/apps/treeView/node/resources/default_file.png b/src/main/resources/vavi/apps/treeView/default_file.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/node/resources/default_file.png rename to src/main/resources/vavi/apps/treeView/default_file.png diff --git a/src/main/resources/vavi/apps/treeView/resources/delete.png b/src/main/resources/vavi/apps/treeView/delete.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/resources/delete.png rename to src/main/resources/vavi/apps/treeView/delete.png diff --git a/src/main/resources/vavi/apps/treeView/resources/exit.png b/src/main/resources/vavi/apps/treeView/exit.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/resources/exit.png rename to src/main/resources/vavi/apps/treeView/exit.png diff --git a/src/main/resources/vavi/apps/treeView/resources/mark.png b/src/main/resources/vavi/apps/treeView/mark.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/resources/mark.png rename to src/main/resources/vavi/apps/treeView/mark.png diff --git a/src/main/resources/vavi/apps/treeView/node/resources/default_close.png b/src/main/resources/vavi/apps/treeView/node/default_close.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/node/resources/default_close.png rename to src/main/resources/vavi/apps/treeView/node/default_close.png diff --git a/src/main/resources/vavi/apps/treeView/resources/default_file.png b/src/main/resources/vavi/apps/treeView/node/default_file.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/resources/default_file.png rename to src/main/resources/vavi/apps/treeView/node/default_file.png diff --git a/src/main/resources/vavi/apps/treeView/node/resources/default_open.png b/src/main/resources/vavi/apps/treeView/node/default_open.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/node/resources/default_open.png rename to src/main/resources/vavi/apps/treeView/node/default_open.png diff --git a/src/main/resources/vavi/apps/treeView/node/resources/folder.png b/src/main/resources/vavi/apps/treeView/node/folder.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/node/resources/folder.png rename to src/main/resources/vavi/apps/treeView/node/folder.png diff --git a/src/main/resources/vavi/apps/treeView/node/resources/new.png b/src/main/resources/vavi/apps/treeView/node/new.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/node/resources/new.png rename to src/main/resources/vavi/apps/treeView/node/new.png diff --git a/src/main/resources/vavi/apps/treeView/node/resources/property.png b/src/main/resources/vavi/apps/treeView/node/property.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/node/resources/property.png rename to src/main/resources/vavi/apps/treeView/node/property.png diff --git a/src/main/resources/vavi/apps/treeView/resources/open.png b/src/main/resources/vavi/apps/treeView/open.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/resources/open.png rename to src/main/resources/vavi/apps/treeView/open.png diff --git a/src/main/resources/vavi/apps/treeView/resources/paste.png b/src/main/resources/vavi/apps/treeView/paste.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/resources/paste.png rename to src/main/resources/vavi/apps/treeView/paste.png diff --git a/src/main/resources/vavi/apps/treeView/resources/search.png b/src/main/resources/vavi/apps/treeView/search.png similarity index 100% rename from src/main/resources/vavi/apps/treeView/resources/search.png rename to src/main/resources/vavi/apps/treeView/search.png diff --git a/src/main/java/vavi/apps/treeView/Dao.java b/src/test/java/sample/Dao.java similarity index 91% rename from src/main/java/vavi/apps/treeView/Dao.java rename to src/test/java/sample/Dao.java index 7da6c11..469c31d 100644 --- a/src/main/java/vavi/apps/treeView/Dao.java +++ b/src/test/java/sample/Dao.java @@ -4,12 +4,14 @@ * Programmed by Naohide Sano */ -package vavi.apps.treeView; +package sample; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import vavi.apps.treeView.TreeViewTreeNode; + /** * Dao. diff --git a/src/main/java/vavi/apps/treeView/node/RootFolderTreeNode.java b/src/test/java/sample/RootFolderTreeNode.java similarity index 94% rename from src/main/java/vavi/apps/treeView/node/RootFolderTreeNode.java rename to src/test/java/sample/RootFolderTreeNode.java index 6426c95..1be822d 100644 --- a/src/main/java/vavi/apps/treeView/node/RootFolderTreeNode.java +++ b/src/test/java/sample/RootFolderTreeNode.java @@ -4,7 +4,7 @@ * Programmed by Naohide Sano */ -package vavi.apps.treeView.node; +package sample; import vavi.apps.treeView.FolderTreeNode; diff --git a/src/test/java/sample/Sample.java b/src/test/java/sample/Sample.java new file mode 100644 index 0000000..192288f --- /dev/null +++ b/src/test/java/sample/Sample.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2022 by Naohide Sano, All rights reserved. + * + * Programmed by Naohide Sano + */ + +package sample; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import javax.swing.JFrame; + +import vavi.apps.treeView.TreeViewFrame; +import vavi.apps.treeView.TreeViewTreeNode; +import vavi.swing.binding.treeview.TreeView; +import vavi.util.Debug; + + +/** + * Sample. + * + * @author Naohide Sano (nsano) + * @version 0.00 2022-12-11 nsano initial version
+ */ +@TreeView +public class Sample { + + private Dao dao = new XmlDao(); + + private TreeViewTreeNode root; + + public TreeViewTreeNode load(InputStream is) throws IOException { + root = dao.read(is); + return root; + } + + public void save(OutputStream os, TreeViewTreeNode root) throws IOException { + dao.write(root, os); + } + + public InputStream init() { + InputStream is = Test.class.getResourceAsStream(System.getProperty("tv.resource.tree")); + Debug.println(System.getProperty("tv.resource.tree") + ": " + is); + return is; + } + + /** + * The program entry pont. + */ + public static void main(String[] args) throws Exception { + + vavi.apps.treeView.TreeView tree = new vavi.apps.treeView.TreeView(new Sample()); + + JFrame frame = new TreeViewFrame(tree); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setVisible(true); + } +} diff --git a/src/test/java/vavi/apps/treeView/node/Test.java b/src/test/java/sample/Test.java similarity index 85% rename from src/test/java/vavi/apps/treeView/node/Test.java rename to src/test/java/sample/Test.java index e5e53dd..8fe132c 100644 --- a/src/test/java/vavi/apps/treeView/node/Test.java +++ b/src/test/java/sample/Test.java @@ -4,9 +4,9 @@ * Programmed by Naohide Sano */ -package vavi.apps.treeView.node; +package sample; -import java.io.*; +import java.io.Serializable; /** @@ -15,13 +15,13 @@ * @author Naohide Sano (nsano) * @version 0.00 010908 nsano initial version
*/ -public class Test - implements Serializable { +public class Test implements Serializable { private String name; private int i; - public Test() {} + public Test() { + } public Test(String name, int i) { this.name = name; diff --git a/src/test/java/vavi/apps/treeView/node/TestBeanInfo.java b/src/test/java/sample/TestBeanInfo.java similarity index 73% rename from src/test/java/vavi/apps/treeView/node/TestBeanInfo.java rename to src/test/java/sample/TestBeanInfo.java index f29719d..42469a0 100644 --- a/src/test/java/vavi/apps/treeView/node/TestBeanInfo.java +++ b/src/test/java/sample/TestBeanInfo.java @@ -4,7 +4,7 @@ * Programmed by Naohide Sano */ -package vavi.apps.treeView.node; +package sample; import java.awt.*; import java.beans.*; @@ -17,8 +17,7 @@ * @author Naohide Sano (nsano) * @version 0.00 020625 nsano initial version
*/ -public class TestBeanInfo extends SimpleBeanInfo - implements TreeNodeInfo { +public class TestBeanInfo extends SimpleBeanInfo implements TreeNodeInfo { private final Class clazz = Test.class; @@ -31,11 +30,11 @@ public BeanDescriptor getBeanDescriptor() { public Image getIcon(int iconKind) { switch (iconKind) { case ICON_COLOR_16x16_EXT2: - return loadImage("resources/default_open.png"); + return loadImage("/vavi/apps/treeView/node/default_open.png"); case ICON_COLOR_16x16_EXT1: - return loadImage("resources/default_close.png"); + return loadImage("/vavi/apps/treeView/node/default_close.png"); default: - return loadImage("resources/default_file.png"); + return loadImage("/vavi/apps/treeView/node/default_file.png"); } } diff --git a/src/test/java/vavi/apps/treeView/node/TestFileTreeNode.java b/src/test/java/sample/TestFileTreeNode.java similarity index 97% rename from src/test/java/vavi/apps/treeView/node/TestFileTreeNode.java rename to src/test/java/sample/TestFileTreeNode.java index c7106eb..1c228d9 100644 --- a/src/test/java/vavi/apps/treeView/node/TestFileTreeNode.java +++ b/src/test/java/sample/TestFileTreeNode.java @@ -4,7 +4,7 @@ * Programmed by Naohide Sano */ -package vavi.apps.treeView.node; +package sample; import vavi.apps.treeView.FileTreeNode; import vavi.apps.treeView.TreeViewException; diff --git a/src/test/java/vavi/apps/treeView/node/TestFolderTreeNode.java b/src/test/java/sample/TestFolderTreeNode.java similarity index 98% rename from src/test/java/vavi/apps/treeView/node/TestFolderTreeNode.java rename to src/test/java/sample/TestFolderTreeNode.java index a98ab2a..6ee80de 100644 --- a/src/test/java/vavi/apps/treeView/node/TestFolderTreeNode.java +++ b/src/test/java/sample/TestFolderTreeNode.java @@ -4,7 +4,7 @@ * Programmed by Naohide Sano */ -package vavi.apps.treeView.node; +package sample; import vavi.apps.treeView.FolderTreeNode; import vavi.apps.treeView.TreeViewException; diff --git a/src/main/java/vavi/apps/treeView/XmlDao.java b/src/test/java/sample/XmlDao.java similarity index 96% rename from src/main/java/vavi/apps/treeView/XmlDao.java rename to src/test/java/sample/XmlDao.java index 6cafb1c..f2f2037 100644 --- a/src/main/java/vavi/apps/treeView/XmlDao.java +++ b/src/test/java/sample/XmlDao.java @@ -4,13 +4,12 @@ * Programmed by Naohide Sano */ -package vavi.apps.treeView; +package sample; import java.beans.XMLDecoder; import java.beans.XMLEncoder; import java.io.BufferedOutputStream; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -18,6 +17,8 @@ import java.io.Writer; import java.lang.reflect.Constructor; import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; import java.util.Vector; import javax.xml.parsers.DocumentBuilder; @@ -37,6 +38,7 @@ import org.xml.sax.SAXException; +import vavi.apps.treeView.TreeViewTreeNode; import vavi.util.Debug; @@ -65,7 +67,7 @@ public TreeViewTreeNode read(InputStream is) throws IOException { try { builder = factory.newDocumentBuilder(); } catch (ParserConfigurationException e) { - throw (RuntimeException) new IllegalStateException().initCause(e); + throw new IllegalStateException(e); } factory.setValidating(true); @@ -139,7 +141,7 @@ private TreeViewTreeNode getChildTreeNode(Node node) { Debug.println("child: " + child.getNodeName() + ": " + userObject); } else if ("url".equals(child.getNodeName())) { // 0.1.0 urlString = child.getFirstChild().getNodeValue(); -Debug.println("child: " + child.getNodeName() + ": " + urlString); +Debug.println("child: " + child.getNodeName() + ": " + urlString.trim()); } else if ("node".equals(child.getNodeName())) { childTreeNodes.add(getChildTreeNode(child)); } else { @@ -166,7 +168,7 @@ private TreeViewTreeNode getChildTreeNode(Node node) { /** * æ–°ã—ã„ TreeViewTreeNode ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’è¿”ã—ã¾ã™ï¼Ž * - * @version 0.1.0 + * @since 0.1.0 */ private static TreeViewTreeNode newInstance(String className, String urlString) { try { @@ -179,14 +181,14 @@ private static TreeViewTreeNode newInstance(String className, String urlString) return newInstance(className, userObject); } catch (Exception e) { Debug.println(e); - throw (RuntimeException) new IllegalStateException().initCause(e); + throw new IllegalStateException(e); } } /** * æ–°ã—ã„ TreeViewTreeNode ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’è¿”ã—ã¾ã™ï¼Ž * - * @version 0.0.0 + * @since 0.0.0 */ private static TreeViewTreeNode newInstance(String className, Object userObject) { try { @@ -236,7 +238,7 @@ private static TreeViewTreeNode newInstance(String className, Object userObject) */ public void write(TreeViewTreeNode root, OutputStream os) throws IOException { - writer = new OutputStreamWriter(os, "UTF-8"); + writer = new OutputStreamWriter(os, StandardCharsets.UTF_8); DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder; @@ -278,7 +280,7 @@ public void write(TreeViewTreeNode root, OutputStream os) throws IOException { private Element createElement(TreeViewTreeNode node) throws IOException { File file = new File(node.toString() + ".xml"); - OutputStream os = new BufferedOutputStream(new FileOutputStream(file)); + OutputStream os = new BufferedOutputStream(Files.newOutputStream(file.toPath())); XMLEncoder xe = new XMLEncoder(os); xe.writeObject(node.getUserObject()); xe.close(); diff --git a/src/test/resources/logging.properties b/src/test/resources/logging.properties new file mode 100644 index 0000000..b82ecda --- /dev/null +++ b/src/test/resources/logging.properties @@ -0,0 +1,6 @@ +handlers=java.util.logging.ConsoleHandler +.level=INFO +java.util.logging.ConsoleHandler.level=ALL +java.util.logging.ConsoleHandler.formatter=vavi.util.logging.VaviFormatter + +vavi.util.level=FINE diff --git a/src/test/resources/vavi/apps/treeView/Test File C.xml b/src/test/resources/sample/Test File C.xml similarity index 83% rename from src/test/resources/vavi/apps/treeView/Test File C.xml rename to src/test/resources/sample/Test File C.xml index 98750a0..c82d5fa 100644 --- a/src/test/resources/vavi/apps/treeView/Test File C.xml +++ b/src/test/resources/sample/Test File C.xml @@ -1,6 +1,6 @@ - + 1 diff --git a/src/test/resources/vavi/apps/treeView/Test File D.xml b/src/test/resources/sample/Test File D.xml similarity index 83% rename from src/test/resources/vavi/apps/treeView/Test File D.xml rename to src/test/resources/sample/Test File D.xml index 1cf64d1..ba1ccc3 100644 --- a/src/test/resources/vavi/apps/treeView/Test File D.xml +++ b/src/test/resources/sample/Test File D.xml @@ -1,6 +1,6 @@ - + 1 diff --git a/src/test/resources/vavi/apps/treeView/Test File E.xml b/src/test/resources/sample/Test File E.xml similarity index 83% rename from src/test/resources/vavi/apps/treeView/Test File E.xml rename to src/test/resources/sample/Test File E.xml index 1796ddc..f044a7a 100644 --- a/src/test/resources/vavi/apps/treeView/Test File E.xml +++ b/src/test/resources/sample/Test File E.xml @@ -1,6 +1,6 @@ - + 1 diff --git a/src/test/resources/vavi/apps/treeView/Test Foler A.xml b/src/test/resources/sample/Test Foler A.xml similarity index 83% rename from src/test/resources/vavi/apps/treeView/Test Foler A.xml rename to src/test/resources/sample/Test Foler A.xml index 1a1ba02..ca8e752 100644 --- a/src/test/resources/vavi/apps/treeView/Test Foler A.xml +++ b/src/test/resources/sample/Test Foler A.xml @@ -1,6 +1,6 @@ - + 100 diff --git a/src/test/resources/vavi/apps/treeView/Test Foler B.xml b/src/test/resources/sample/Test Foler B.xml similarity index 83% rename from src/test/resources/vavi/apps/treeView/Test Foler B.xml rename to src/test/resources/sample/Test Foler B.xml index 41fd16d..83c9419 100644 --- a/src/test/resources/vavi/apps/treeView/Test Foler B.xml +++ b/src/test/resources/sample/Test Foler B.xml @@ -1,6 +1,6 @@ - + 100 diff --git a/src/test/resources/root.xml b/src/test/resources/sample/root.xml similarity index 100% rename from src/test/resources/root.xml rename to src/test/resources/sample/root.xml diff --git a/src/test/resources/sample/tree.xml b/src/test/resources/sample/tree.xml new file mode 100644 index 0000000..d733fd1 --- /dev/null +++ b/src/test/resources/sample/tree.xml @@ -0,0 +1,32 @@ + + + + sample.RootFolderTreeNode + file:src/test/resources/sample/root.xml + + sample.TestFolderTreeNode + file:src/test/resources/sample/Test Foler A.xml + + + + sample.TestFolderTreeNode + file:src/test/resources/sample/Test Foler B.xml + + + sample.TestFileTreeNode + file:src/test/resources/sample/Test File D.xml + + + + sample.TestFileTreeNode + file:src/test/resources/sample/Test File E.xml + + + + + sample.TestFileTreeNode + file:src/test/resources/sample/Test File C.xml + + + + \ No newline at end of file diff --git a/src/test/resources/tree.xml b/src/test/resources/tree.xml deleted file mode 100644 index 283ad4f..0000000 --- a/src/test/resources/tree.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - vavi.apps.treeView.node.RootFolderTreeNode - file:src/test/resources/root.xml - - vavi.apps.treeView.node.TestFolderTreeNode - file:src/test/resources/vavi/apps/treeView/Test Foler A.xml - - - - vavi.apps.treeView.node.TestFolderTreeNode - file:src/test/resources/vavi/apps/treeView/Test Foler B.xml - - - vavi.apps.treeView.node.TestFileTreeNode - file:src/test/resources/vavi/apps/treeView/Test File D.xml - - - - vavi.apps.treeView.node.TestFileTreeNode - file:src/test/resources/vavi/apps/treeView/Test File E.xml - - - - - vavi.apps.treeView.node.TestFileTreeNode - file:src/test/resources/vavi/apps/treeView/Test File C.xml - - - - \ No newline at end of file