]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/ModuleEditor/src/org/tianocore/packaging/common/ui/ITree.java
Remove ModuleEditor and PackageEditor from Tools\Source
[mirror_edk2.git] / Tools / Source / ModuleEditor / src / org / tianocore / packaging / common / ui / ITree.java
diff --git a/Tools/Source/ModuleEditor/src/org/tianocore/packaging/common/ui/ITree.java b/Tools/Source/ModuleEditor/src/org/tianocore/packaging/common/ui/ITree.java
deleted file mode 100644 (file)
index eeb51fc..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/** @file\r
\r
- The file is used to override JTree to provides customized interfaces \r
\r
- Copyright (c) 2006, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution.  The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
- **/\r
-\r
-package org.tianocore.packaging.common.ui;\r
-\r
-import javax.swing.JTree;\r
-import javax.swing.tree.DefaultMutableTreeNode;\r
-import javax.swing.tree.DefaultTreeModel;\r
-import javax.swing.tree.TreeNode;\r
-import javax.swing.tree.TreePath;\r
-\r
-/**\r
- The class is used to override JTree to provides customized interfaces \r
- It extends JTree\r
\r
- @since ModuleEditor 1.0\r
-\r
- **/\r
-public class ITree extends JTree {\r
-    ///\r
-    /// Define class Serial Version UID\r
-    ///\r
-    private static final long serialVersionUID = -7907086164518295327L;\r
-    \r
-    //\r
-    // Define class members\r
-    //\r
-    DefaultTreeModel treeModel = null;\r
-\r
-    /**\r
-     This is the default constructor\r
-     \r
-     **/\r
-    public ITree() {\r
-        super();\r
-    }\r
-\r
-    /**\r
-     This is the overrided constructor\r
-     Init class members with input data\r
-     \r
-     @param iDmtRoot The root node of the tree\r
-     \r
-     **/\r
-    public ITree(IDefaultMutableTreeNode iDmtRoot) {\r
-        super(iDmtRoot);\r
-    }\r
-\r
-    /**\r
-     Get category of selected node\r
-     \r
-     @return The category of selected node\r
-     \r
-     **/\r
-    public int getSelectCategory() {\r
-        int intCategory = 0;\r
-        TreePath path = this.getSelectionPath();\r
-        IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();\r
-        intCategory = node.getCategory();\r
-        return intCategory;\r
-    }\r
-\r
-    /**\r
-     Get operation of selected node\r
-     \r
-     @return The operation of selected node\r
-     \r
-     **/\r
-    public int getSelectOperation() {\r
-        int intOperation = 0;\r
-        TreePath path = this.getSelectionPath();\r
-        IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();\r
-        intOperation = node.getOperation();\r
-        return intOperation;\r
-    }\r
-\r
-    /**\r
-     Get selectLoaction of selected node\r
-     \r
-     @return The selectLoaction of selected node\r
-     \r
-     **/\r
-    public int getSelectLoaction() {\r
-        int intLocation = 0;\r
-        TreePath path = this.getSelectionPath();\r
-        IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();\r
-        intLocation = node.getLocation();\r
-        return intLocation;\r
-    }\r
-\r
-    /**\r
-     Main class, reserved for test\r
-     \r
-     @param args\r
-     \r
-     **/\r
-    public static void main(String[] args) {\r
-        // TODO Auto-generated method stub\r
-    }\r
-\r
-    /**\r
-     Add input node as child node for current selected node\r
-     \r
-     @param strNewNode The name of the node which need be added\r
-     \r
-     **/\r
-    public void addNode(String strNewNode) {\r
-        DefaultMutableTreeNode parentNode = null;\r
-        DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(strNewNode);\r
-        newNode.setAllowsChildren(true);\r
-        TreePath parentPath = this.getSelectionPath();\r
-\r
-        /**\r
-         * Get parent node of new node\r
-         */\r
-        parentNode = (DefaultMutableTreeNode) (parentPath.getLastPathComponent());\r
-\r
-        /**\r
-         * Insert new node\r
-         */\r
-        treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());\r
-        this.scrollPathToVisible(new TreePath(newNode.getPath()));\r
-    }\r
-\r
-    /**\r
-     Add input node as child node for current selected node\r
-     \r
-     @param newNode The node need be added\r
-     \r
-     **/\r
-    public void addNode(IDefaultMutableTreeNode newNode) {\r
-        IDefaultMutableTreeNode parentNode = null;\r
-        newNode.setAllowsChildren(true);\r
-        TreePath parentPath = this.getSelectionPath();\r
-        parentNode = (IDefaultMutableTreeNode) (parentPath.getLastPathComponent());\r
-        treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());\r
-        this.scrollPathToVisible(new TreePath(newNode.getPath()));\r
-    }\r
-\r
-    /**\r
-     Remove current selectd node\r
-     \r
-     **/\r
-    public void removeNode() {\r
-        TreePath treepath = this.getSelectionPath();\r
-        if (treepath != null) {\r
-            DefaultMutableTreeNode selectionNode = (DefaultMutableTreeNode) treepath.getLastPathComponent();\r
-            TreeNode parent = (TreeNode) selectionNode.getParent();\r
-            if (parent != null) {\r
-                treeModel.removeNodeFromParent(selectionNode);\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     Remove all node on a same level\r
-     \r
-     **/\r
-    public void removeNodeOnSameLevel() {\r
-        TreePath treepath = this.getSelectionPath();\r
-        IDefaultMutableTreeNode parentNode = (IDefaultMutableTreeNode) treepath.getLastPathComponent();\r
-        parentNode.removeAllChildren();\r
-        treeModel.reload();\r
-    }\r
-\r
-    /**\r
-     Remove the input node by name\r
-     \r
-     @param strRemovedNode\r
-     \r
-     **/\r
-    public void removeNode(String strRemovedNode) {\r
-        TreePath treepath = this.getSelectionPath();\r
-        if (treepath != null) {\r
-            DefaultMutableTreeNode selectionNode = (DefaultMutableTreeNode) treepath.getLastPathComponent();\r
-            TreeNode parent = (TreeNode) selectionNode.getParent();\r
-            if (parent != null) {\r
-                treeModel.removeNodeFromParent(selectionNode);\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     Remove all nodes of the tree\r
-     \r
-     **/\r
-    public void removeAllNode() {\r
-        DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeModel.getRoot();\r
-        rootNode.removeAllChildren();\r
-        treeModel.reload();\r
-    }\r
-}\r