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


Java TreeMemory.addTreeListener方法代码示例

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


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

示例1: addControls

import org.pentaho.di.ui.core.widget.TreeMemory; //导入方法依赖的package包/类
/**
 * Add the controls to the tab
 */
private void addControls() {

  // Create the tree table...
  wTree = new Tree( jobGraph.extraViewTabFolder, SWT.V_SCROLL | SWT.H_SCROLL );
  wTree.setHeaderVisible( true );
  TreeMemory.addTreeListener( wTree, STRING_CHEF_LOG_TREE_NAME );

  TreeColumn column1 = new TreeColumn( wTree, SWT.LEFT );
  column1.setText( BaseMessages.getString( PKG, "JobLog.Column.JobJobEntry" ) );
  column1.setWidth( 200 );

  TreeColumn column2 = new TreeColumn( wTree, SWT.LEFT );
  column2.setText( BaseMessages.getString( PKG, "JobLog.Column.Comment" ) );
  column2.setWidth( 200 );

  TreeColumn column3 = new TreeColumn( wTree, SWT.LEFT );
  column3.setText( BaseMessages.getString( PKG, "JobLog.Column.Result" ) );
  column3.setWidth( 100 );

  TreeColumn column4 = new TreeColumn( wTree, SWT.LEFT );
  column4.setText( BaseMessages.getString( PKG, "JobLog.Column.Reason" ) );
  column4.setWidth( 200 );

  TreeColumn column5 = new TreeColumn( wTree, SWT.LEFT );
  column5.setText( BaseMessages.getString( PKG, "JobLog.Column.Filename" ) );
  column5.setWidth( 200 );

  TreeColumn column6 = new TreeColumn( wTree, SWT.RIGHT );
  column6.setText( BaseMessages.getString( PKG, "JobLog.Column.Nr" ) );
  column6.setWidth( 50 );

  TreeColumn column7 = new TreeColumn( wTree, SWT.RIGHT );
  column7.setText( BaseMessages.getString( PKG, "JobLog.Column.LogDate" ) );
  column7.setWidth( 120 );

  FormData fdTree = new FormData();
  fdTree.left = new FormAttachment( 0, 0 );
  fdTree.top = new FormAttachment( 0, 0 );
  fdTree.right = new FormAttachment( 100, 0 );
  fdTree.bottom = new FormAttachment( 100, 0 );
  wTree.setLayoutData( fdTree );

  final Timer tim = new Timer( "JobGrid: " + jobGraph.getMeta().getName() );
  TimerTask timtask = new TimerTask() {
    public void run() {
      Display display = jobGraph.getDisplay();
      if ( display != null && !display.isDisposed() ) {
        display.asyncExec( new Runnable() {
          public void run() {
            // Check if the widgets are not disposed.
            // This happens is the rest of the window is not yet disposed.
            // We ARE running in a different thread after all.
            //
            // TODO: add a "auto refresh" check box somewhere
            if ( !wTree.isDisposed() ) {
              refreshTreeTable();
            }
          }
        } );
      }
    }
  };
  tim.schedule( timtask, 10L, 2000L ); // refresh every 2 seconds...

  jobGraph.jobLogDelegate.getJobLogTab().addDisposeListener( new DisposeListener() {
    public void widgetDisposed( DisposeEvent disposeEvent ) {
      tim.cancel();
    }
  } );

}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:75,代码来源:JobGridDelegate.java


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