本文整理汇总了Java中org.pentaho.di.ui.core.widget.StyledTextComp.setSelection方法的典型用法代码示例。如果您正苦于以下问题:Java StyledTextComp.setSelection方法的具体用法?Java StyledTextComp.setSelection怎么用?Java StyledTextComp.setSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.ui.core.widget.StyledTextComp
的用法示例。
在下文中一共展示了StyledTextComp.setSelection方法的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());
}
}
}
示例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() );
}
}
}
示例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());
}*/
}
示例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());
}*/
}
示例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()); }
*/
}