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


Java StyledTextComp.insert方法代码示例

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


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

示例1: treeDblClick

import org.pentaho.di.ui.core.widget.StyledTextComp; //导入方法依赖的package包/类
private void treeDblClick(Event event) {
	StyledTextComp wScript = getStyledTextComp();
	Point point = new Point(event.x, event.y);
	TreeItem item = wTree.getItem(point);

	// Qualification where the Click comes from
	if (item != null && item.getParentItem() != null) {
		if (item.getParentItem().equals(wTreeClassesItem)) {
			setActiveCtab(item.getText());
		} else if (!item.getData().equals("Snippit")) {
			int iStart = wScript.getCaretOffset();
			int selCount = wScript.getSelectionCount(); // this selection
			// will be replaced
			// by wScript.insert
			iStart = iStart - selCount; // when a selection is already there
			// we need to subtract the position
			if (iStart < 0) iStart = 0; // just safety
			String strInsert = (String) item.getData();
			wScript.insert(strInsert);
			wScript.setSelection(iStart, iStart + strInsert.length());
		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:UserDefinedJavaClassDialog.java

示例2: treeDblClick

import org.pentaho.di.ui.core.widget.StyledTextComp; //导入方法依赖的package包/类
private void treeDblClick( Event event ) {
  StyledTextComp wScript = getStyledTextComp();
  Point point = new Point( event.x, event.y );
  TreeItem item = wTree.getItem( point );

  // Qualification where the Click comes from
  if ( item != null && item.getParentItem() != null ) {
    if ( item.getParentItem().equals( wTreeClassesItem ) ) {
      setActiveCtab( item.getText() );
    } else if ( !item.getData().equals( "Snippit" ) ) {
      int iStart = wScript.getCaretOffset();
      int selCount = wScript.getSelectionCount(); // this selection
      // will be replaced
      // by wScript.insert
      iStart = iStart - selCount; // when a selection is already there
      // we need to subtract the position
      if ( iStart < 0 ) {
        iStart = 0; // just safety
      }
      String strInsert = (String) item.getData();
      wScript.insert( strInsert );
      wScript.setSelection( iStart, iStart + strInsert.length() );
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:UserDefinedJavaClassDialog.java

示例3: treeDblClick

import org.pentaho.di.ui.core.widget.StyledTextComp; //导入方法依赖的package包/类
private void treeDblClick(Event event){
	StyledTextComp wScript = getStyledTextComp();
	Point point = new Point(event.x, event.y);
       TreeItem item = wTree.getItem(point);
       
       // Qualifikation where the Click comes from
       if(item !=null && item.getParentItem()!=null){
       	if(item.getParentItem().equals(wTreeScriptsItem)){
       		setActiveCtab(item.getText());
       	}else if(!item.getData().equals("Function")){
       		int iStart = wScript.getCaretOffset();
       		int selCount = wScript.getSelectionCount();  // this selection will be replaced by wScript.insert
       		iStart=iStart-selCount; //when a selection is already there we need to subtract the position
       		if (iStart<0) iStart=0; // just safety
           	String strInsert =(String)item.getData();
           	if(strInsert.equals("jsFunction")) strInsert = (String)item.getText();
           	wScript.insert(strInsert);
           	wScript.setSelection(iStart,iStart+strInsert.length());
       	}
       }
       /*
       if (item != null && item.getParentItem()!=null && !item.getData().equals("Function")) {
       	int iStart = wScript.getCaretOffset();
       	String strInsert =(String)item.getData();
       	if(strInsert.equals("jsFunction")) strInsert = (String)item.getText();
       	wScript.insert(strInsert);
       	wScript.setSelection(iStart,iStart+strInsert.length());
       }*/
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:30,代码来源:ScriptValuesModDialog.java

示例4: treeDblClick

import org.pentaho.di.ui.core.widget.StyledTextComp; //导入方法依赖的package包/类
private void treeDblClick(Event event){
	StyledTextComp wScript = getStyledTextComp();
	Point point = new Point(event.x, event.y);
       TreeItem item = wTree.getItem(point);
       
       // Qualifikation where the Click comes from
       if(item !=null && item.getParentItem()!=null){
       	if(item.getParentItem().equals(wTreeScriptsItem)){
       		setActiveCtab(item.getText());
       	}else if(!item.getData().equals("Function")){
       		int iStart = wScript.getCaretOffset();
       		int selCount = wScript.getSelectionCount();  // this selection will be replaced by wScript.insert
       		iStart=iStart-selCount; //when a selection is already there we need to subtract the position
       		if (iStart<0) iStart=0; // just safety
           	String strInsert =(String)item.getData();
           	if(strInsert.equals("jsFunction")) strInsert = item.getText();
           	wScript.insert(strInsert);
           	wScript.setSelection(iStart,iStart+strInsert.length());
       	}
       }
       /*
       if (item != null && item.getParentItem()!=null && !item.getData().equals("Function")) {
       	int iStart = wScript.getCaretOffset();
       	String strInsert =(String)item.getData();
       	if(strInsert.equals("jsFunction")) strInsert = (String)item.getText();
       	wScript.insert(strInsert);
       	wScript.setSelection(iStart,iStart+strInsert.length());
       }*/
}
 
开发者ID:mattyb149,项目名称:pdi-graph-computing,代码行数:30,代码来源:GremlinScriptDialog.java

示例5: treeDblClick

import org.pentaho.di.ui.core.widget.StyledTextComp; //导入方法依赖的package包/类
private void treeDblClick( Event event ) {
  StyledTextComp wScript = getStyledTextComp();
  Point point = new Point( event.x, event.y );
  TreeItem item = wTree.getItem( point );

  // Qualifikation where the Click comes from
  if ( item != null && item.getParentItem() != null ) {
    if ( item.getParentItem().equals( wTreeScriptsItem ) ) {
      setActiveCtab( item.getText() );
    } else if ( !item.getData().equals( "Function" ) ) {
      int iStart = wScript.getCaretOffset();
      int selCount = wScript.getSelectionCount(); // this selection will be replaced by wScript.insert
      iStart = iStart - selCount; // when a selection is already there we need to subtract the position
      if ( iStart < 0 ) {
        iStart = 0; // just safety
      }
      String strInsert = (String) item.getData();
      if ( strInsert.equals( "jsFunction" ) ) {
        strInsert = item.getText();
      }
      wScript.insert( strInsert );
      wScript.setSelection( iStart, iStart + strInsert.length() );
    }
  }
  /*
   * if (item != null && item.getParentItem()!=null && !item.getData().equals("Function")) { int iStart =
   * wScript.getCaretOffset(); String strInsert =(String)item.getData(); if(strInsert.equals("jsFunction")) strInsert
   * = (String)item.getText(); wScript.insert(strInsert); wScript.setSelection(iStart,iStart+strInsert.length()); }
   */
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:31,代码来源:ScriptDialog.java


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