本文整理汇总了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();
}
} );
}