當前位置: 首頁>>代碼示例>>Java>>正文


Java ITreeContentProvider.getChildren方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.ITreeContentProvider.getChildren方法的典型用法代碼示例。如果您正苦於以下問題:Java ITreeContentProvider.getChildren方法的具體用法?Java ITreeContentProvider.getChildren怎麽用?Java ITreeContentProvider.getChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.ITreeContentProvider的用法示例。


在下文中一共展示了ITreeContentProvider.getChildren方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: selectfirstMatching

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
private boolean selectfirstMatching(Object[] elements) {
	if (elements == null) {
		return false;
	}
	for (int i = 0; i < elements.length; i++) {
		Object element = elements[i];
		if (Boolean.TRUE.equals(textFilter.isMatchingOrNull(element))) {
			StructuredSelection selection = new StructuredSelection(element);
			treeViewer.setSelection(selection, true);
			return true;
		}
		ITreeContentProvider contentProvider = getTreeContentProvider();
		Object[] children = contentProvider.getChildren(element);
		boolean selectionDone = selectfirstMatching(children);
		if (selectionDone) {
			return true;
		}

	}
	return false;
}
 
開發者ID:de-jcup,項目名稱:egradle,代碼行數:22,代碼來源:AbstractFilterableTreeQuickDialog.java

示例2: select

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
@Override
public boolean select(Viewer viewer, Object parentElement,
		Object element) {

	StructuredViewer sviewer = (StructuredViewer) viewer;
	ITreeContentProvider provider = (ITreeContentProvider) sviewer
			.getContentProvider();
	
	if (element instanceof Group ) {
		for (Object child: provider.getChildren(element)) {
			if (select(viewer, element, child)) 
				return true; 
		}
	}
	else {
		Test test = (Test)element;
		if (test.getTestName().contains(searchTestName)) {
			return true;
		}
	}
	return false;
}
 
開發者ID:FutureProcessing,項目名稱:RFRunnerPlugin,代碼行數:23,代碼來源:Filter.java

示例3: checkStateChanged

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
public void checkStateChanged(CheckStateChangedEvent event) {
	Object element = event.getElement();
	// in case of changed category, go to all problems
	if (element instanceof String) {
		ITreeContentProvider contentProvider = (ITreeContentProvider)getTreeViewer().getContentProvider();
		Object[] problems = contentProvider.getChildren(element);
		for (Object problem : problems) {
			if (problem instanceof Problem) {
				((Problem)problem).setEnabled(event.getChecked());
			}
		}
	}
	
	if (element instanceof Problem) {
		((Problem) element).setEnabled(event.getChecked());
	}

}
 
開發者ID:kwin,項目名稱:cppcheclipse,代碼行數:19,代碼來源:ProblemsTreeEditor.java

示例4: isElementVisible

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
@Override
public boolean isElementVisible(Viewer viewer, Object element) {
    if (WorkbenchActivityHelper.restrictUseOf(element))
        return false;
    
	// Nodes are not differentiated based on category since 
	// categories are selectable nodes.
	if (isLeafMatch(viewer, element)) {
		return true;
	}

	ITreeContentProvider contentProvider = 
			(ITreeContentProvider) ((TreeViewer) viewer).getContentProvider();
	IPropertiesViewerNode node = (IPropertiesViewerNode) element;
	Object[] children = contentProvider.getChildren(node);
	// Will return true if any subnode of the element matches the search
	if (filter(viewer, element, children).length > 0) {
		return true;
	}		
	return false;
}
 
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:22,代碼來源:PropertiesPatternFilter.java

示例5: select

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {

    if (element instanceof Variant || element instanceof Commentable || element instanceof SoftwareElement) {
        return true;
    } else if (element instanceof VariationPoint) {
        return select((VariationPoint) element);

    } else {
        StructuredViewer sviewer = (StructuredViewer) viewer;
        ITreeContentProvider provider = (ITreeContentProvider) sviewer.getContentProvider();
        for (Object child : provider.getChildren(element)) {
            if (select(viewer, element, child)) {
                return true;
            }
        }
        return false;
    }
}
 
開發者ID:kopl,項目名稱:SPLevo,代碼行數:20,代碼來源:AbstractJaMoPPVPFilter.java

示例6: isElementVisible

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
public boolean isElementVisible( Viewer viewer, Object element )
{
	if ( isLeafMatch( viewer, element ) )
	{
		return true;
	}

	if ( element instanceof DataSourceType )
	{
		ITreeContentProvider contentProvider = (ITreeContentProvider) ( (TreeViewer) viewer ).getContentProvider( );
		DataSourceType node = (DataSourceType) element;
		Object[] children = contentProvider.getChildren( node );
		// Will return true if any subnode of the element matches the search
		if ( filter( viewer, element, children ).length > 0 )
		{
			return true;
		}
	}
	return false;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:21,代碼來源:DataSetBasePage.java

示例7: containElement

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
private static boolean containElement( Object parent,
		ITreeContentProvider provider, Object element )
{
	if ( parent == null )
	{
		return false;
	}
	if ( parent == element || parent.equals( element ) )
	{
		return true;
	}

	if ( provider == null )
	{
		return false;
	}
	Object[] children = provider.getChildren( parent );
	for ( int i = 0; i < children.length; i++ )
	{
		if ( containElement( children[i], provider, element ) )
		{
			return true;
		}
	}
	return false;
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:27,代碼來源:UIUtil.java

示例8: selectfirstMatching

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
private boolean selectfirstMatching(Object[] elements) {
	if (treeViewer==null){
		return false;
	}
	if (textFilter==null){
		return false;
	}
	if (elements == null) {
		return false;
	}
	for (int i = 0; i < elements.length; i++) {
		Object element = elements[i];
		if (Boolean.TRUE.equals(textFilter.isMatchingOrNull(element))) {
			StructuredSelection selection = new StructuredSelection(element);
			treeViewer.setSelection(selection, true);
			return true;
		}
		ITreeContentProvider contentProvider = getTreeContentProvider();
		Object[] children = contentProvider.getChildren(element);
		boolean selectionDone = selectfirstMatching(children);
		if (selectionDone) {
			return true;
		}

	}
	return false;
}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:28,代碼來源:AbstractFilterableTreeQuickDialog.java

示例9: isElementVisible

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
public boolean isElementVisible(Viewer viewer, Object element) {
	// Preference nodes are not differentiated based on category since
	// categories are selectable nodes.
	if (isLeafMatch(viewer, element)) {
		return true;
	}

	ITreeContentProvider contentProvider = (ITreeContentProvider) ((TreeViewer) viewer).getContentProvider();
	Object[] children = contentProvider.getChildren(element);
	// Will return true if any subnode of the element matches the search
	if (filter(viewer, element, children).length > 0) {
		return true;
	}
	return false;
}
 
開發者ID:aroog,項目名稱:code,代碼行數:16,代碼來源:ObjectGraphPatternFilter.java

示例10: updateChecksForParents

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
private void updateChecksForParents(Object object, boolean state) {
	ITreeContentProvider provider = (ITreeContentProvider)getContentProvider();
	Object child = object;
	Object parent = provider.getParent(child);
	boolean change = true;
	while (parent != null && change) {
		Object[] siblings = provider.getChildren(parent);
		int numberChecked = 0;
		boolean grayed = false;
		change = false;
		for (int i = 0; i < siblings.length; i++) {
			if (getChecked(siblings[i])) numberChecked++;
			if (getGrayed(siblings[i])) grayed = true;
		}
		if (numberChecked == 0) {
			if (getChecked(parent) || getGrayed(parent)) change = true;
			setGrayChecked(parent, false);
		}
		else if (numberChecked == siblings.length) {
			if (!getChecked(parent) || getGrayed(parent) != grayed) change = true;
			setGrayed(parent, false);
			setChecked(parent, true);
		}
		else {
			if (!getChecked(parent) || !getGrayed(parent)) change = true;
			setGrayChecked(parent, true);
		}
		child = parent;
		parent = provider.getParent(child);
	}
	
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:33,代碼來源:IncludeInDeploymentTreeViewer.java

示例11: getChildren

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
public Object[] getChildren(Object parentElement)
{
	List<ITreeContentProvider> providers = this.getProcessors();
	List<Object> result = new ArrayList<Object>();

	for (ITreeContentProvider provider : providers)
	{
		Object[] items = provider.getChildren(parentElement);

		result.addAll(Arrays.asList(items));
	}

	return result.toArray();
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:15,代碼來源:IndexViewContentProvider.java

示例12: getMatchCount

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
private int getMatchCount(ITreeContentProvider cp, Object[] elements) {
	int count= 0;
	for (int j = 0; j < elements.length; j++) {
		count+= getDisplayedMatchCount(elements[j]);
		Object[] children = cp.getChildren(elements[j]);
		count+= getMatchCount(cp, children);
	}
	return count;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:10,代碼來源:JavaSearchResultPage.java

示例13: select

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {                
    if (element instanceof VariationPoint && ((VariationPoint) element).getVariabilityMechanism() == null) {
        return true;
    } else if (element instanceof VariationPointGroup) {
        ITreeContentProvider contentProvider = (ITreeContentProvider) ((CommonViewer) viewer).getContentProvider();
        for (Object child : contentProvider.getChildren(element)) {
            if (select(viewer, element, child)) {
                return true;
            }
        }
    }
    return false;
}
 
開發者ID:kopl,項目名稱:SPLevo,代碼行數:15,代碼來源:NoVariabilityMechanismAction.java

示例14: select

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
/**
 * Returns whether the given element makes it through this filter.
 * 
 * @param viewer
 * @param parentElement
 * @param element
 * @return true if element meets the search criteria 
 */
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
	
	// sanity check
	if(findFilterMode == null || findFilterText == null) return true; 
	
	// retrieve the current case insensitive search criteria
	String mode       = findFilterMode.getText();
	String filterText = findFilterText.getText().trim().toUpperCase();
	
	// return true if no search criteria specified
	if(filterText.length() == 0) return true;
	
	TreeViewer treeViewer         = (TreeViewer) viewer;
	ITreeContentProvider provider = (ITreeContentProvider) treeViewer.getContentProvider();
	
	
	if(mode.equals(getDisplayText(DEFINITION_CATEGORY))) {
		// walk up the tree until reaching a category containter
		while(!(element instanceof String))
			element = provider.getParent(element);
		
		// apply case insensitive search criteria to the category
		return ((String) element).toUpperCase().indexOf(filterText) != -1;
	}
	
	else if(mode.equals(getDisplayText(DEFINITION_NAME))) {
		// if the current element is an activity then immediately apply
		// case insensitive search criteria
		if (element instanceof INamedDefinition)
			return ((INamedDefinition) element).getName().toUpperCase().indexOf(filterText) != -1;
		
		// if the current element is not an activity then recurse
		// through all children until either a match is found or all
		// have been examined
		Queue<Object> openList = new LinkedList<Object>();
		openList.offer(element);
		while (!openList.isEmpty()) {
			Object thisElement = openList.poll();
			for(Object childElement : provider.getChildren(thisElement)) {
				if(childElement instanceof INamedDefinition &&
					((INamedDefinition) childElement).getName().toUpperCase().indexOf(filterText) != -1)
					return true;
				
				openList.offer(childElement);
			}
		}
	}
	
	// if all else fails, return false
	return false;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:61,代碼來源:DefinitionTreeView.java

示例15: select

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
/**
 * Returns whether the given element makes it through this filter.
 * 
 * @param viewer
 * @param parentElement
 * @param element
 * @return true if element meets the search criteria 
 */
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
	String filterText = getNameFilterText();
	
	// sanity check
	if(filterText == null) {
		return true; 
	}
	
	// retrieve the current case insensitive search criteria
	filterText = filterText.trim().toUpperCase();
	
	// return true if no search criteria specified
	if(filterText.length() == 0) return true;
	
	TreeViewer treeViewer         = (TreeViewer) viewer;
	ITreeContentProvider provider = (ITreeContentProvider) treeViewer.getContentProvider();
	
	// if the current element is an activity then immediately apply
	// case insensitive search criteria
	if (matchesProfile(treeViewer, element, filterText)) {
		return true;
	}
	
	// if the current element is not an activity then recurse
	// through all children until either a match is found or all
	// have been examined
	Queue<Object> openList = new LinkedList<Object>();
	openList.offer(element);
	while (!openList.isEmpty()) {
		Object thisElement = openList.poll();
		for(Object childElement : provider.getChildren(thisElement)) {
			if (matchesProfile(treeViewer, childElement, filterText)) {
				return true;
			}
			openList.offer(childElement);
		}
	}
	// if all else fails, return false
	return false;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:50,代碼來源:ProfileTreePage.java


注:本文中的org.eclipse.jface.viewers.ITreeContentProvider.getChildren方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。