当前位置: 首页>>代码示例>>Java>>正文


Java TreeViewer.setAutoExpandLevel方法代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.TreeViewer.setAutoExpandLevel方法的典型用法代码示例。如果您正苦于以下问题:Java TreeViewer.setAutoExpandLevel方法的具体用法?Java TreeViewer.setAutoExpandLevel怎么用?Java TreeViewer.setAutoExpandLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.viewers.TreeViewer的用法示例。


在下文中一共展示了TreeViewer.setAutoExpandLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initContextualView

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
private void initContextualView(IEditorPart editor) {
  if (editor == null) {
    return;
  }
  IFile file = editor.getEditorInput().getAdapter(IFile.class);
  TreeViewer treeViewer = ContextualView.getTreeViewer();
  if (treeViewer != null) {
    // Finding all markers in given file.
    ArrayList<IMarker> allMarkers;
    allMarkers = MarkerFactory.findMarkersAsArrayList(file);
    if (allMarkers == null) {
      return;
    }
    Iterator<IMarker> iter = allMarkers.iterator();
    while (iter.hasNext()) {
      IMarker marker = iter.next();
      if (MarkUtilities.getLeaderId(marker) == null && MarkUtilities.getGroupId(marker) != null) {
        iter.remove();
      }
    }
    if (!treeViewer.getTree().isDisposed()) {
      treeViewer.setInput(allMarkers.toArray());
    }
    treeViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:27,代码来源:Startup.java

示例2: createDialogArea

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
@Override
protected Control createDialogArea ( final Composite parent )
{
    setTitle ( "Select driver" );
    setMessage ( "Choose a driver from the world model" );

    final Composite composite = (Composite)super.createDialogArea ( parent );

    final ObservablesManager mgr = new ObservablesManager ();

    final TreeViewer viewer = new TreeViewer ( composite );
    viewer.setAutoExpandLevel ( 2 );
    viewer.getControl ().setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );
    viewer.addDoubleClickListener ( new IDoubleClickListener () {

        @Override
        public void doubleClick ( final DoubleClickEvent event )
        {
            handleDoubleClick ();
        }
    } );

    mgr.runAndCollect ( new Runnable () {

        @Override
        public void run ()
        {
            createDataModel ( viewer );
        }
    } );

    return composite;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:34,代码来源:DriverSelectionDialog.java

示例3: createDialogArea

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
@Override
protected Control createDialogArea ( final Composite parent )
{
    setTitle ( "Select master server" );
    setMessage ( "Choose a master server from the world model" );

    final Composite composite = (Composite)super.createDialogArea ( parent );

    final Composite wrapper = new Composite ( composite, SWT.NONE );
    wrapper.setLayout ( new GridLayout ( 1, true ) );
    wrapper.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );

    final ObservablesManager mgr = new ObservablesManager ();

    final TreeViewer viewer = new TreeViewer ( wrapper );
    viewer.setAutoExpandLevel ( 2 );
    viewer.getControl ().setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true, 1, 1 ) );
    viewer.addDoubleClickListener ( new IDoubleClickListener () {

        @Override
        public void doubleClick ( final DoubleClickEvent event )
        {
            handleDoubleClick ();
        }
    } );

    final Button add = new Button ( wrapper, SWT.RADIO );
    add.setText ( "Add master server" );
    add.setToolTipText ( "Assign the component to the selected master server in addition" );

    this.replace = new Button ( wrapper, SWT.RADIO );
    this.replace.setText ( "Replace all master servers" );
    this.replace.setToolTipText ( "Assign the component soley to the selected master server" );
    this.replace.setSelection ( true );

    this.delete = new Button ( wrapper, SWT.RADIO );
    this.delete.setText ( "Remove master server" );
    this.delete.setToolTipText ( "Un-assign the component from the selected master server" );

    mgr.runAndCollect ( new Runnable () {

        @Override
        public void run ()
        {
            createDataModel ( viewer );
        }
    } );

    if ( this.lastSelection != null )
    {
        viewer.setSelection ( new StructuredSelection ( this.lastSelection ) );
        viewer.reveal ( this.lastSelection );
    }

    return composite;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:57,代码来源:MasterSelectionDialog.java


注:本文中的org.eclipse.jface.viewers.TreeViewer.setAutoExpandLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。