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


Java TransAction.setNew方法代码示例

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


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

示例1: insertRowBefore

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
private void insertRowBefore()
{
	if (readonly) return;
	
       TableItem row = activeTableItem;
       if (row==null) return;
       int rownr = table.indexOf(row);
       
	TableItem item = new TableItem(table, SWT.NONE, rownr);		
	item.setText(1, "");
	
	// Add undo information
	TransAction ta = new TransAction();
	String str[] = getItemText(item);
	ta.setNew(new String[][] { str }, new int[] { rownr });
	addUndo(ta);
	
	setRowNums();
	
	edit(rownr, 1);
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:22,代码来源:TableView.java

示例2: insertRowAfter

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
private void insertRowAfter()
{
	if (readonly) return;
	
       TableItem row = activeTableItem;
       if (row==null) return;
       int rownr = table.indexOf(row);
       
	TableItem item = new TableItem(table, SWT.NONE, rownr+1);
	item.setText(1, "");

	// Add undo information
	TransAction ta = new TransAction();
	String str[] = getItemText(item);
	ta.setNew(new String[][] { str }, new int[] { rownr+1 });
	addUndo(ta);
	
	setRowNums();

	edit(rownr+1, 1);	
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:22,代码来源:TableView.java

示例3: insertRowBefore

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
private void insertRowBefore() {
  if (readonly)
    return;

  TableItem row = activeTableItem;
  if (row == null)
    return;
  int rownr = table.indexOf(row);

  TableItem item = new TableItem(table, SWT.NONE, rownr);
  item.setText(1, "");

  // Add undo information
  TransAction ta = new TransAction();
  String str[] = getItemText(item);
  ta.setNew(new String[][] { str }, new int[] { rownr });
  addUndo(ta);

  setRowNums();

  edit(rownr, 1);
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:23,代码来源:TableView.java

示例4: insertRowAfter

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
private void insertRowAfter() {
  if (readonly)
    return;

  TableItem row = activeTableItem;
  if (row == null)
    return;
  int rownr = table.indexOf(row);

  TableItem item = new TableItem(table, SWT.NONE, rownr + 1);
  item.setText(1, "");

  // Add undo information
  TransAction ta = new TransAction();
  String str[] = getItemText(item);
  ta.setNew(new String[][] { str }, new int[] { rownr + 1 });
  addUndo(ta);

  setRowNums();

  edit(rownr + 1, 1);
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:23,代码来源:TableView.java

示例5: addUndo

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
public void addUndo(Object from[], Object to[], int pos[], Point prev[], Point curr[], int type_of_change, boolean nextAlso) {
	// First clean up after the current position.
	// Example: position at 3, size=5
	// 012345
	// ^
	// remove 34
	// Add 4
	// 01234

	while (undo.size() > undo_position + 1 && undo.size() > 0) {
		int last = undo.size() - 1;
		undo.remove(last);
	}

	TransAction ta = new TransAction();
	switch (type_of_change) {
	case TYPE_UNDO_CHANGE:
		ta.setChanged(from, to, pos);
		break;
	case TYPE_UNDO_DELETE:
		ta.setDelete(from, pos);
		break;
	case TYPE_UNDO_NEW:
		ta.setNew(from, pos);
		break;
	case TYPE_UNDO_POSITION:
		ta.setPosition(from, pos, prev, curr);
		break;
	}
	undo.add(ta);
	undo_position++;

	if (undo.size() > max_undo) {
		undo.remove(0);
		undo_position--;
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:38,代码来源:JobMeta.java

示例6: insertRow

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
private void insertRow( int ronr ) {
  TableItem item = new TableItem( table, SWT.NONE, ronr );
  item.setText( 1, "" );

  // Add undo information
  TransAction ta = new TransAction();
  String[] str = getItemText( item );
  ta.setNew( new String[][]{ str }, new int[]{ronr} );
  addUndo( ta );

  setRowNums();

  edit( ronr, 1 );
  tableViewModifyListener.insertRow( ronr );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:16,代码来源:TableView.java

示例7: addUndo

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
/**
 * Add an undo operation to the undo list
 *
 * @param from array of objects representing the old state
 * @param to array of objectes representing the new state
 * @param pos An array of object locations
 * @param prev An array of points representing the old positions
 * @param curr An array of points representing the new positions
 * @param type_of_change The type of change that's being done to the transformation.
 * @param nextAlso indicates that the next undo operation needs to follow this one.
 */
public void addUndo(Object from[], Object to[], int pos[], Point prev[], Point curr[], int type_of_change, boolean nextAlso)
{
    // First clean up after the current position.
    // Example: position at 3, size=5
    // 012345
    // ^
    // remove 34
    // Add 4
    // 01234

    while (undo.size() > undo_position + 1 && undo.size() > 0)
    {
        int last = undo.size() - 1;
        undo.remove(last);
    }

    TransAction ta = new TransAction();
    switch (type_of_change)
    {
    case TYPE_UNDO_CHANGE:
        ta.setChanged(from, to, pos);
        break;
    case TYPE_UNDO_DELETE:
        ta.setDelete(from, pos);
        break;
    case TYPE_UNDO_NEW:
        ta.setNew(from, pos);
        break;
    case TYPE_UNDO_POSITION:
        ta.setPosition(from, pos, prev, curr);
        break;
    }
    ta.setNextAlso(nextAlso);
    undo.add(ta);
    undo_position++;

    if (undo.size() > max_undo)
    {
        undo.remove(0);
        undo_position--;
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:54,代码来源:TransMeta.java

示例8: addUndo

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
/**
 * Adds an undo operation to the undo list.
 *
 * @param from array of objects representing the old state
 * @param to array of objectes representing the new state
 * @param pos An array of object locations
 * @param prev An array of points representing the old positions
 * @param curr An array of points representing the new positions
 * @param type_of_change The type of change that's being done to the transformation.
 * @param nextAlso indicates that the next undo operation needs to follow this one.
 */
public void addUndo(Object from[], Object to[], int pos[], Point prev[], Point curr[], int type_of_change, boolean nextAlso)
{
    // First clean up after the current position.
    // Example: position at 3, size=5
    // 012345
    // ^
    // remove 34
    // Add 4
    // 01234

    while (undo.size() > undo_position + 1 && undo.size() > 0)
    {
        int last = undo.size() - 1;
        undo.remove(last);
    }

    TransAction ta = new TransAction();
    switch (type_of_change)
    {
    case TYPE_UNDO_CHANGE:
        ta.setChanged(from, to, pos);
        break;
    case TYPE_UNDO_DELETE:
        ta.setDelete(from, pos);
        break;
    case TYPE_UNDO_NEW:
        ta.setNew(from, pos);
        break;
    case TYPE_UNDO_POSITION:
        ta.setPosition(from, pos, prev, curr);
        break;
    }
    ta.setNextAlso(nextAlso);
    undo.add(ta);
    undo_position++;

    if (undo.size() > max_undo)
    {
        undo.remove(0);
        undo_position--;
    }
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:54,代码来源:TransMeta.java

示例9: pasteSelected

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
private void pasteSelected()
{
	int rownr = getCurrentRownr();

	if (clipboard!=null) 
	{
		clipboard.dispose();
		clipboard=null;
	}
	
	clipboard = new Clipboard(getDisplay());
	TextTransfer tran = TextTransfer.getInstance();

	String text = (String)clipboard.getContents(tran);
	
	if (text!=null)
	{
		String lines[] = convertTextToLines(text);
		if (lines.length>1)
		{
			// ALlocate complete paste grid!
			String[] grid[] = new String[lines.length-1][];
			int      idx[]  = new int[lines.length-1];
			
			for (int i=1;i<lines.length;i++)
			{
				grid[i-1] = convertLineToStrings(lines[i]);
				idx[i-1] = rownr+i;
				addItem(idx[i-1], grid[i-1]);
			}
			
			TransAction ta = new TransAction();
			ta.setNew(grid , idx);
			addUndo(ta);
		}
		if (rownr==0 && table.getItemCount()>rownr+1) // Empty row at rownr?  Remove it!
		{
			if (isEmpty(rownr, -1)) table.remove(rownr);
		}
		setRowNums();
		unEdit();
		
		setModified();
	}
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:46,代码来源:TableView.java

示例10: pasteSelected

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
private void pasteSelected() {
  int rownr = getCurrentRownr();

  if (clipboard != null) {
    clipboard.dispose();
    clipboard = null;
  }

  clipboard = new Clipboard(getDisplay());
  TextTransfer tran = TextTransfer.getInstance();

  String text = (String) clipboard.getContents(tran);

  if (text != null) {
    String lines[] = convertTextToLines(text);
    if (lines.length > 1) {
      // ALlocate complete paste grid!
      String[] grid[] = new String[lines.length - 1][];
      int idx[] = new int[lines.length - 1];

      for (int i = 1; i < lines.length; i++) {
        grid[i - 1] = convertLineToStrings(lines[i]);
        idx[i - 1] = rownr + i;
        addItem(idx[i - 1], grid[i - 1]);
      }

      TransAction ta = new TransAction();
      ta.setNew(grid, idx);
      addUndo(ta);
    }
    if (rownr == 0 && table.getItemCount() > rownr + 1) // Empty row at rownr?
                                                        // Remove it!
    {
      if (isEmpty(rownr, -1))
        table.remove(rownr);
    }
    setRowNums();
    unEdit();

    setModified();
  }
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:43,代码来源:TableView.java

示例11: addUndo

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
@Override
public void addUndo( Object[] from, Object[] to, int[] pos, Point[] prev, Point[] curr, int type_of_change,
                     boolean nextAlso ) {
  // First clean up after the current position.
  // Example: position at 3, size=5
  // 012345
  // ^
  // remove 34
  // Add 4
  // 01234

  while ( undo.size() > undo_position + 1 && undo.size() > 0 ) {
    int last = undo.size() - 1;
    undo.remove( last );
  }

  TransAction ta = new TransAction();
  switch ( type_of_change ) {
    case TYPE_UNDO_CHANGE:
      ta.setChanged( from, to, pos );
      break;
    case TYPE_UNDO_DELETE:
      ta.setDelete( from, pos );
      break;
    case TYPE_UNDO_NEW:
      ta.setNew( from, pos );
      break;
    case TYPE_UNDO_POSITION:
      ta.setPosition( from, pos, prev, curr );
      break;
    default:
      break;
  }
  undo.add( ta );
  undo_position++;

  if ( undo.size() > max_undo ) {
    undo.remove( 0 );
    undo_position--;
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:42,代码来源:AbstractMeta.java

示例12: pasteSelected

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
private void pasteSelected() {
  int rownr = getCurrentRownr();

  if ( clipboard != null ) {
    clipboard.dispose();
    clipboard = null;
  }

  clipboard = new Clipboard( getDisplay() );
  TextTransfer tran = TextTransfer.getInstance();

  String text = (String) clipboard.getContents( tran );

  if ( text != null ) {
    String[] lines = text.split( Const.CR );
    if ( lines.length > 1 ) {
      // ALlocate complete paste grid!
      String[][] grid = new String[lines.length - 1][];
      int[] idx = new int[lines.length - 1];

      for ( int i = 1; i < lines.length; i++ ) {
        grid[i - 1] = lines[i].split( "\t" );
        idx[i - 1] = rownr + i;
        addItem( idx[i - 1], grid[i - 1] );
      }

      TransAction ta = new TransAction();
      ta.setNew( grid, idx );
      addUndo( ta );
    }
    if ( rownr == 0 && table.getItemCount() > rownr + 1 ) {
      // Empty row at rownr?
      // Remove it!

      if ( isEmpty( rownr, -1 ) ) {
        table.remove( rownr );
      }
    }
    setRowNums();
    unEdit();

    setModified();
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:45,代码来源:TableView.java


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