private void expandCategory(String category) { if (category != null) { ISiteCategoryDefinition[] catDefs = fModel.getSite().getCategoryDefinitions(); for (int i = 0; i < catDefs.length; i++) { if (category.equals(catDefs[i].getName())) { fCategoryViewer.expandToLevel(catDefs[i], 1); break; } } } }
/** @param children list of elements to be expand with their children */ private void expandChildrenElements(Object[] children, boolean fullExpand) { for (int i = 0; i < children.length; i++) { Object child = children[i]; if (child instanceof PluginParentNode) { PluginParentNode node = (PluginParentNode) child; if (node.getChildCount() > 0 && fullExpand) { boolean furtherExpanding = !(node instanceof PluginExtensionNode && !fExtensionTree.getExpandedState(node)); expandChildrenElements(node.getChildren(), furtherExpanding); } else { fExtensionTree.expandToLevel(node, 0); } } } }