• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TreeMemory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



TreeMemory类属于org.pentaho.di.ui.core.widget包,在下文中一共展示了TreeMemory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: refreshTreeTable

import org.pentaho.di.ui.core.widget.TreeMemory; //导入依赖的package包/类
/**
    * Refresh the data in the tree-table...
    * Use the data from the JobTracker in the job
    */
private void refreshTreeTable()
   {
       if (jobTracker!=null)
       {
           int nrItems = jobTracker.getTotalNumberOfItems();
           
           if (nrItems!=previousNrItems)
           {
               // Allow some flickering for now ;-)
               wTree.removeAll();
               
               // Re-populate this...
               TreeItem treeItem = new TreeItem(wTree, SWT.NONE);
               String jobName = jobTracker.getJobName();

               if(Const.isEmpty(jobName)) 
               {
                   if (!Const.isEmpty(jobTracker.getJobFilename())) jobName = jobTracker.getJobFilename();
                   else jobName = Messages.getString("JobLog.Tree.StringToDisplayWhenJobHasNoName"); //$NON-NLS-1$
               }
               treeItem.setText(0, jobName);
               TreeMemory.getInstance().storeExpanded(STRING_CHEF_LOG_TREE_NAME, new String[] { jobName }, true);

               for (int i=0;i<jobTracker.nrJobTrackers();i++)
               {
                   addTrackerToTree(jobTracker.getJobTracker(i), treeItem);
               }
               previousNrItems = nrItems;
               
               TreeMemory.setExpandedFromMemory(wTree, STRING_CHEF_LOG_TREE_NAME);
           }
       }
   }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:38,代码来源:JobGridDelegate.java


示例2: expandAllItems

import org.pentaho.di.ui.core.widget.TreeMemory; //导入依赖的package包/类
private void expandAllItems(TreeItem[] treeitems,boolean expand)
{
  for (TreeItem item : treeitems) { 
	    item.setExpanded(expand);
	    TreeMemory.getInstance().storeExpanded(STRING_REPOSITORY_EXPLORER_TREE_NAME, ConstUI.getTreeStrings(item), expand);
	    if(item.getItemCount()>0)
	    	expandAllItems(item.getItems(),expand);
    }
  
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:11,代码来源:RepositoryExplorerDialog.java


示例3: refreshTreeTable

import org.pentaho.di.ui.core.widget.TreeMemory; //导入依赖的package包/类
/**
    * Refresh the data in the tree-table...
    * Use the data from the JobTracker in the job
    */
private void refreshTreeTable()
   {
       if (jobTracker!=null)
       {
           int nrItems = jobTracker.getTotalNumberOfItems();
           
           if (nrItems!=previousNrItems)
           {
               // Allow some flickering for now ;-)
               wTree.removeAll();
               
               // Re-populate this...
               TreeItem treeItem = new TreeItem(wTree, SWT.NONE);
               String jobName = jobTracker.getJobName();

               if(Const.isEmpty(jobName)) 
               {
                   if (!Const.isEmpty(jobTracker.getJobFilename())) jobName = jobTracker.getJobFilename();
                   else jobName = BaseMessages.getString(PKG, "JobLog.Tree.StringToDisplayWhenJobHasNoName"); //$NON-NLS-1$
               }
               treeItem.setText(0, jobName);
               TreeMemory.getInstance().storeExpanded(STRING_CHEF_LOG_TREE_NAME, new String[] { jobName }, true);

               for (int i=0;i<jobTracker.nrJobTrackers();i++)
               {
                   addTrackerToTree(jobTracker.getJobTracker(i), treeItem);
               }
               previousNrItems = nrItems;
               
               TreeMemory.setExpandedFromMemory(wTree, STRING_CHEF_LOG_TREE_NAME);
           }
       }
   }
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:JobGridDelegate.java


示例4: expandAllItems

import org.pentaho.di.ui.core.widget.TreeMemory; //导入依赖的package包/类
private void expandAllItems( TreeItem[] treeitems, boolean expand ) {
  for ( TreeItem item : treeitems ) {
    item.setExpanded( expand );
    TreeMemory.getInstance().storeExpanded(
      STRING_REPOSITORY_EXPLORER_TREE_NAME, ConstUI.getTreeStrings( item ), expand );
    if ( item.getItemCount() > 0 ) {
      expandAllItems( item.getItems(), expand );
    }
  }

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


示例5: refreshTreeTable

import org.pentaho.di.ui.core.widget.TreeMemory; //导入依赖的package包/类
/**
 * Refresh the data in the tree-table... Use the data from the JobTracker in the job
 */
private void refreshTreeTable() {
  if ( jobTracker != null ) {
    int nrItems = jobTracker.getTotalNumberOfItems();

    if ( nrItems != previousNrItems ) {
      // Allow some flickering for now ;-)
      wTree.removeAll();

      // Re-populate this...
      TreeItem treeItem = new TreeItem( wTree, SWT.NONE );
      String jobName = jobTracker.getJobName();

      if ( Utils.isEmpty( jobName ) ) {
        if ( !Utils.isEmpty( jobTracker.getJobFilename() ) ) {
          jobName = jobTracker.getJobFilename();
        } else {
          jobName = BaseMessages.getString( PKG, "JobLog.Tree.StringToDisplayWhenJobHasNoName" );
        }
      }
      treeItem.setText( 0, jobName );
      TreeMemory.getInstance().storeExpanded( STRING_CHEF_LOG_TREE_NAME, new String[] { jobName }, true );

      for ( int i = 0; i < jobTracker.nrJobTrackers(); i++ ) {
        addTrackerToTree( jobTracker.getJobTracker( i ), treeItem );
      }
      previousNrItems = nrItems;

      TreeMemory.setExpandedFromMemory( wTree, STRING_CHEF_LOG_TREE_NAME );
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:35,代码来源:JobGridDelegate.java


示例6: refreshTree

import org.pentaho.di.ui.core.widget.TreeMemory; //导入依赖的package包/类
public void refreshTree() throws MetaStoreException {
  tree.removeAll();

  // Top level: the MetaStore
  //
  for ( int m = 0; m < metaStoreList.size(); m++ ) {
    IMetaStore metaStore = metaStoreList.get( m );
    TreeItem metaStoreItem = new TreeItem( tree, SWT.NONE );

    metaStoreItem.setText( 0, Const.NVL( metaStore.getName(), "metastore-" + ( m + 1 ) ) );
    metaStoreItem.setText( 1, Const.NVL( metaStore.getDescription(), "" ) );

    // level: Namespace
    //
    List<String> namespaces = metaStore.getNamespaces();
    for ( String namespace : namespaces ) {
      TreeItem namespaceItem = new TreeItem( metaStoreItem, SWT.NONE );

      namespaceItem.setText( 0, Const.NVL( namespace, "" ) );

      // level: element type
      //
      List<IMetaStoreElementType> elementTypes = metaStore.getElementTypes( namespace );
      for ( IMetaStoreElementType elementType : elementTypes ) {
        TreeItem elementTypeItem = new TreeItem( namespaceItem, SWT.NONE );

        elementTypeItem.setText( 0, Const.NVL( elementType.getName(), "" ) );
        elementTypeItem.setText( 1, Const.NVL( elementType.getDescription(), "" ) );

        // level: element
        //
        List<IMetaStoreElement> elements = metaStore.getElements( namespace, elementType );
        for ( final IMetaStoreElement element : elements ) {
          TreeItem elementItem = new TreeItem( elementTypeItem, SWT.NONE );

          elementItem.setText( 0, Const.NVL( element.getName(), "" ) );
          elementItem.setText( 2, Const.NVL( element.getId(), "" ) );

          elementItem.addListener( SWT.Selection, new Listener() {

            @Override
            public void handleEvent( Event event ) {
              log.logBasic( "Selected : " + element.getName() );
            }
          } );

          addAttributesToTree( elementItem, element );
        }

      }
    }
  }
  TreeUtil.setOptimalWidthOnColumns( tree );
  TreeMemory.setExpandedFromMemory( tree, META_STORE_EXPLORER_DIALOG_TREE );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:56,代码来源:MetaStoreExplorerDialog.java


示例7: 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类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MaintenanceDocumentAuthorizerBase类代码示例发布时间:2022-05-22
下一篇:
Java SQLUpdateClause类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap