Java Code Examples for org.eclipse.swt.widgets.Tree.setItemCount()

The following are Jave code examples for showing how to use setItemCount() of the org.eclipse.swt.widgets.Tree class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: convertigo-eclipse   File: TwsDomTree.java   View Source Code Vote up 5 votes
/**
 * Fills an SWT Tree object with a parsed XML document
 * 
 * @param document		the parsed XML document
 */
public void fillDomTree(final Document document) {
	selectedTreeItem = null;
	
	removeAll();
	if (document != null) {
		Tree t = getTree();
		Node[] childs = XMLUtils.toNodeArray(document.getChildNodes());
		t.setData(document);
		t.setData("childs", childs);
		t.setItemCount(childs.length);
	}
}
 
Example 2
Project: NEXCORE-UML-Modeler   File: StereotypePropertyComposite.java   View Source Code Vote up 5 votes
/**
 * 뷰어가 담길 컴포지트 생성
 * 
 * @param parent
 * @return Composite
 */
public Composite createComposite(final Composite parent) {
    Tree tree = new Tree(parent, SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);

    tree.setLinesVisible(true);
    tree.setHeaderVisible(true);

    String[] strHeadings = { UMLMessage.LABEL_PROPERTY, UMLMessage.LABEL_VALUE };

    TreeColumn propertyTreeColumn = new TreeColumn(tree, SWT.NONE);
    propertyTreeColumn.setWidth(240);
    propertyTreeColumn.setText(strHeadings[0]);
    propertyTreeColumn.setAlignment(SWT.LEFT);
    propertyTreeColumn.setResizable(true);

    TreeColumn valueTreeColumn = new TreeColumn(tree, SWT.NONE);
    valueTreeColumn.setWidth(300);
    valueTreeColumn.setText(strHeadings[1]);
    valueTreeColumn.setAlignment(SWT.LEFT);
    valueTreeColumn.setResizable(true);

    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.heightHint = 150;
    gridData.horizontalSpan = 2;
    tree.setLayoutData(gridData);

    viewer = new TreeViewer(tree);
    tree.setItemCount(20);

    viewer.setContentProvider(new StereotypePropertyTreeContentProvider());
    viewer.setLabelProvider(new StereotypePropertyTableColumnLabelProvider(this));

    // viewer.setInput(input);
    viewer.addSelectionChangedListener(new StereotypePropertySelectionChangedListener(parent, this));

    return parent;
}
 
Example 3
Project: scouter   File: MainProcessor.java   View Source Code Vote up 5 votes
private void closeStackAllFileInfo() {
	Tree tree = this.getMainTree();
    if ( tree != null ){
    	tree.clearAll(true);
    	tree.setItemCount(0);
    }
    
    clearTable();
    this.displayContent(null);
}