Package javax.help
Class MergeHelpUtilities
- java.lang.Object
-
- javax.help.MergeHelpUtilities
-
public class MergeHelpUtilities extends java.lang.Object
Common utilities for merge types
-
-
Constructor Summary
Constructors Constructor Description MergeHelpUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
compareNames(javax.swing.tree.DefaultMutableTreeNode master, javax.swing.tree.DefaultMutableTreeNode slave)
Compares name of nodesstatic javax.swing.tree.DefaultMutableTreeNode
getChildWithName(javax.swing.tree.DefaultMutableTreeNode parent, java.lang.String name)
Returns node with given namestatic java.util.Locale
getLocale(javax.swing.tree.DefaultMutableTreeNode node)
Returns locale of nodestatic java.lang.String
getNodeName(javax.swing.tree.DefaultMutableTreeNode node)
Returns name of nodestatic boolean
haveEqualID(javax.swing.tree.DefaultMutableTreeNode master, javax.swing.tree.DefaultMutableTreeNode slave)
Method for comparing ID of nodesstatic void
markNodes(javax.swing.tree.DefaultMutableTreeNode master, javax.swing.tree.DefaultMutableTreeNode slave)
Marks nodes with the same name but diferent IDs with their HelpSet titlestatic void
mergeNodeChildren(java.lang.String masterMergeType, javax.swing.tree.DefaultMutableTreeNode node)
Merge a nodes children according the merging rules of the node's merge typestatic void
mergeNodes(java.lang.String masterMergeType, javax.swing.tree.DefaultMutableTreeNode masterNode, javax.swing.tree.DefaultMutableTreeNode slaveNode)
Merge the nodes according the merging rules of the masterNode's merge type
-
-
-
Method Detail
-
mergeNodes
public static void mergeNodes(java.lang.String masterMergeType, javax.swing.tree.DefaultMutableTreeNode masterNode, javax.swing.tree.DefaultMutableTreeNode slaveNode)
Merge the nodes according the merging rules of the masterNode's merge type- Parameters:
masterMergeType
- The fallback mergeType if masterNode does not have a mergeTypemasterNode
- The master node to merge intoslaveNode
- A secondary node that will merge into the master node
-
mergeNodeChildren
public static void mergeNodeChildren(java.lang.String masterMergeType, javax.swing.tree.DefaultMutableTreeNode node)
Merge a nodes children according the merging rules of the node's merge type- Parameters:
masterMergeType
- The fallback mergeType if masterNode does not have a mergeTypenode
- The node
-
getNodeName
public static java.lang.String getNodeName(javax.swing.tree.DefaultMutableTreeNode node)
Returns name of node- Parameters:
node
- The node- Returns:
- The name of node
-
getChildWithName
public static javax.swing.tree.DefaultMutableTreeNode getChildWithName(javax.swing.tree.DefaultMutableTreeNode parent, java.lang.String name)
Returns node with given name- Parameters:
parent
- The parent nodename
- The name of child- Returns:
- The child with given name
-
getLocale
public static java.util.Locale getLocale(javax.swing.tree.DefaultMutableTreeNode node)
Returns locale of node- Parameters:
node
- The node- Returns:
- The locale object
-
compareNames
public static int compareNames(javax.swing.tree.DefaultMutableTreeNode master, javax.swing.tree.DefaultMutableTreeNode slave)
Compares name of nodes- Parameters:
master
- The master nodeslave
- The slave node- Returns:
- negative is master is lexically lower than slave; positive if master is lexically higher than slave and zero if lexically identical.
-
haveEqualID
public static boolean haveEqualID(javax.swing.tree.DefaultMutableTreeNode master, javax.swing.tree.DefaultMutableTreeNode slave)
Method for comparing ID of nodes- Parameters:
master
- The master nodeslave
- The slave node- Returns:
- True if ID is the same
-
markNodes
public static void markNodes(javax.swing.tree.DefaultMutableTreeNode master, javax.swing.tree.DefaultMutableTreeNode slave)
Marks nodes with the same name but diferent IDs with their HelpSet title- Parameters:
master
- The master node to markslave
- The slave node to mark
-
-