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


Java ITreeContentProvider.hasChildren方法代碼示例

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


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

示例1: doubleClick

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
@Override
public void doubleClick(DoubleClickEvent event) {
	final IStructuredSelection selection = (IStructuredSelection) event.getSelection();
	if (selection == null || selection.isEmpty())
		return;
	final Object sel = selection.getFirstElement();

	final ITreeContentProvider provider = (ITreeContentProvider) viewer.getContentProvider();

	if (!provider.hasChildren(sel))
		return;

	if (viewer.getExpandedState(sel))
		viewer.collapseToLevel(sel, AbstractTreeViewer.ALL_LEVELS);
	else
		viewer.expandToLevel(sel, 1);

}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:19,代碼來源:ExpandCollapseDoubleClickListener.java

示例2: hasChildren

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
public boolean hasChildren(Object element)
{
	List<ITreeContentProvider> providers = this.getProcessors();
	boolean result = false;

	for (ITreeContentProvider provider : providers)
	{
		if (provider.hasChildren(element))
		{
			result = true;
			break;
		}
	}

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

示例3: doTraverse

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
/**
 * Set selection to the next or previous element if possible.
 * 
 * @param next <code>true</code> if the next element should be selected,
 *          otherwise the previous one will be selected
 */
void doTraverse(boolean next) {
  if (fSelectedItem == null)
    return;

  int index = fBreadcrumbItems.indexOf(fSelectedItem);
  if (next) {
    if (index == fBreadcrumbItems.size() - 1) {
      BreadcrumbItem current = (BreadcrumbItem) fBreadcrumbItems.get(index);

      ITreeContentProvider contentProvider = (ITreeContentProvider) getContentProvider();
      if (!contentProvider.hasChildren(current.getData()))
        return;

      current.openDropDownMenu();
      current.getDropDownShell().setFocus();
    } else {
      BreadcrumbItem nextItem = (BreadcrumbItem) fBreadcrumbItems.get(index + 1);
      selectItem(nextItem);
    }
  } else {
    if (index == 1) {
      BreadcrumbItem root = (BreadcrumbItem) fBreadcrumbItems.get(0);
      root.openDropDownMenu();
      root.getDropDownShell().setFocus();
    } else {
      selectItem((BreadcrumbItem) fBreadcrumbItems.get(index - 1));
    }
  }
}
 
開發者ID:gwt-plugins,項目名稱:gwt-eclipse-plugin,代碼行數:36,代碼來源:BreadcrumbViewer.java

示例4: doTraverse

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
/**
 * Set selection to the next or previous element if possible.
 *
 * @param next <code>true</code> if the next element should be selected, otherwise the previous
 *            one will be selected
 */
void doTraverse(boolean next) {
	if (fSelectedItem == null)
		return;

	int index= fBreadcrumbItems.indexOf(fSelectedItem);
	if (next) {
		if (index == fBreadcrumbItems.size() - 1) {
			BreadcrumbItem current= fBreadcrumbItems.get(index);

			ITreeContentProvider contentProvider= (ITreeContentProvider) getContentProvider();
			if (!contentProvider.hasChildren(current.getData()))
				return;

			current.openDropDownMenu();
			current.getDropDownShell().setFocus();
		} else {
			BreadcrumbItem nextItem= fBreadcrumbItems.get(index + 1);
			selectItem(nextItem);
		}
	} else {
		if (index == 1) {
			BreadcrumbItem root= fBreadcrumbItems.get(0);
			root.openDropDownMenu();
			root.getDropDownShell().setFocus();
		} else {
			selectItem(fBreadcrumbItems.get(index - 1));
		}
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:36,代碼來源:BreadcrumbViewer.java

示例5: addFilteredChildren

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
/**
 * If the element is a leaf node, it is added to the result collection.  If the element has
 * children, this method will recursively look at the children and add any visible leaf nodes
 * to the collection.
 *
 * @param element element to check
 * @param contentProvider tree content provider to check for children
 * @param result collection to collect leaf nodes in
 */
private void addFilteredChildren(Object element, ITreeContentProvider contentProvider, Collection<Object> result) {
	if (!contentProvider.hasChildren(element)) {
		result.add(element);
	} else {
		Object[] visibleChildren = getFilteredChildren(element);
		for (int i = 0; i < visibleChildren.length; i++) {
			addFilteredChildren(visibleChildren[i], contentProvider, result);
		}
	}
}
 
開發者ID:SEMERU-WM,項目名稱:ChangeScribe,代碼行數:20,代碼來源:CachedCheckboxTreeViewer.java

示例6: doTraverse

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
/**
 * Set selection to the next or previous element if possible.
 * 
 * @param next
 *            <code>true</code> if the next element should be selected,
 *            otherwise the previous one will be selected
 */
void doTraverse( boolean next )
{
	if ( fSelectedItem == null )
		return;

	int index = fBreadcrumbItems.indexOf( fSelectedItem );
	if ( next )
	{
		if ( index == fBreadcrumbItems.size( ) - 1 )
		{
			BreadcrumbItem current = (BreadcrumbItem) fBreadcrumbItems.get( index );

			ITreeContentProvider contentProvider = (ITreeContentProvider) getContentProvider( );
			if ( !contentProvider.hasChildren( current.getData( ) ) )
				return;

			current.openDropDownMenu( );
			current.getDropDownShell( ).setFocus( );
		}
		else
		{
			BreadcrumbItem nextItem = (BreadcrumbItem) fBreadcrumbItems.get( index + 1 );
			selectItem( nextItem );
		}
	}
	else
	{
		if ( index == 1 )
		{
			BreadcrumbItem root = (BreadcrumbItem) fBreadcrumbItems.get( 0 );
			root.openDropDownMenu( );
			root.getDropDownShell( ).setFocus( );
		}
		else
		{
			selectItem( (BreadcrumbItem) fBreadcrumbItems.get( index - 1 ) );
		}
	}
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:47,代碼來源:BreadcrumbViewer.java

示例7: hasChildren

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
@Override
protected boolean hasChildren(Object element) {
	ITreeContentProvider contentProvider= (ITreeContentProvider) fPage.getViewer().getContentProvider();
	return contentProvider.hasChildren(element);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:6,代碼來源:PostfixLabelProvider.java

示例8: canView

import org.eclipse.jface.viewers.ITreeContentProvider; //導入方法依賴的package包/類
private boolean canView(final ITreeContentProvider contentProvider, final Object element) {
    return !UMLPackage.Literals.PACKAGE.isInstance(element) || contentProvider.hasChildren(element);
}
 
開發者ID:GRA-UML,項目名稱:tool,代碼行數:4,代碼來源:ReferenceLibrarySearchResultPage.java


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