本文整理汇总了Java中org.pentaho.di.ui.core.widget.StyledTextComp类的典型用法代码示例。如果您正苦于以下问题:Java StyledTextComp类的具体用法?Java StyledTextComp怎么用?Java StyledTextComp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StyledTextComp类属于org.pentaho.di.ui.core.widget包,在下文中一共展示了StyledTextComp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPosition
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
public void setPosition(){
StyledTextComp wScript = getStyledTextComp();
String scr = wScript.getText();
int linenr = wScript.getLineAtOffset(wScript.getCaretOffset())+1;
int posnr = wScript.getCaretOffset();
// Go back from position to last CR: how many positions?
int colnr=0;
while (posnr>0 && scr.charAt(posnr-1)!='\n' && scr.charAt(posnr-1)!='\r')
{
posnr--;
colnr++;
}
wlPosition.setText(Messages.getString("ScriptValuesDialogMod.Position.Label2")+linenr+", "+colnr); //$NON-NLS-1$ //$NON-NLS-2$
}
示例2: setPosition
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
public void setPosition(){
StyledTextComp wScript = getStyledTextComp();
String scr = wScript.getText();
int linenr = wScript.getLineAtOffset(wScript.getCaretOffset())+1;
int posnr = wScript.getCaretOffset();
// Go back from position to last CR: how many positions?
int colnr=0;
while (posnr>0 && scr.charAt(posnr-1)!='\n' && scr.charAt(posnr-1)!='\r')
{
posnr--;
colnr++;
}
wlPosition.setText(BaseMessages.getString(PKG, "ScriptDialog.Position.Label2")+linenr+", "+colnr); //$NON-NLS-1$ //$NON-NLS-2$
}
示例3: setPosition
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
public void setPosition(){
StyledTextComp wScript = getStyledTextComp();
String scr = wScript.getText();
int linenr = wScript.getLineAtOffset(wScript.getCaretOffset())+1;
int posnr = wScript.getCaretOffset();
// Go back from position to last CR: how many positions?
int colnr=0;
while (posnr>0 && scr.charAt(posnr-1)!='\n' && scr.charAt(posnr-1)!='\r')
{
posnr--;
colnr++;
}
wlPosition.setText(BaseMessages.getString(PKG, "ScriptValuesDialogMod.Position.Label2")+linenr+", "+colnr); //$NON-NLS-1$ //$NON-NLS-2$
}
示例4: setPosition
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
public void setPosition() {
StyledTextComp wScript = getStyledTextComp();
String scr = wScript.getText();
int linenr = wScript.getLineAtOffset(wScript.getCaretOffset()) + 1;
int posnr = wScript.getCaretOffset();
// Go back from position to last CR: how many positions?
int colnr = 0;
while (posnr > 0 && scr.charAt(posnr - 1) != '\n' && scr.charAt(posnr - 1) != '\r') {
posnr--;
colnr++;
}
wlPosition
.setText(BaseMessages.getString(PKG, "UserDefinedJavaClassDialog.Position.Label2") + linenr + ", " + colnr); //$NON-NLS-1$ //$NON-NLS-2$
}
示例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);
// 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());
}
}
}
示例6: setPosition
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
public void setPosition(){
StyledTextComp control = wCondition;
if(wspecifyQuery.getSelection()) control = wQuery;
String scr = control.getText();
int linenr = control.getLineAtOffset(control.getCaretOffset())+1;
int posnr = control.getCaretOffset();
// Go back from position to last CR: how many positions?
int colnr=0;
while (posnr>0 && scr.charAt(posnr-1)!='\n' && scr.charAt(posnr-1)!='\r')
{
posnr--;
colnr++;
}
wlPosition.setText(BaseMessages.getString(PKG, "SalesforceInputDialog.Position.Label",""+linenr,""+colnr));
}
示例7: setPosition
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
public void setPosition(){
StyledTextComp wScript = getStyledTextComp();
String scr = wScript.getText();
int linenr = wScript.getLineAtOffset(wScript.getCaretOffset())+1;
int posnr = wScript.getCaretOffset();
// Go back from position to last CR: how many positions?
int colnr=0;
while (posnr>0 && scr.charAt(posnr-1)!='\n' && scr.charAt(posnr-1)!='\r')
{
posnr--;
colnr++;
}
wlPosition.setText(BaseMessages.getString(PKG, "GremlinScriptDialog.Position.Label2")+linenr+", "+colnr);
}
示例8: setPosition
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
public void setPosition() {
StyledTextComp wScript = getStyledTextComp();
String scr = wScript.getText();
int linenr = wScript.getLineAtOffset( wScript.getCaretOffset() ) + 1;
int posnr = wScript.getCaretOffset();
// Go back from position to last CR: how many positions?
int colnr = 0;
while ( posnr > 0 && scr.charAt( posnr - 1 ) != '\n' && scr.charAt( posnr - 1 ) != '\r' ) {
posnr--;
colnr++;
}
wlPosition.setText( BaseMessages.getString( PKG, "ScriptValuesDialogMod.Position.Label2" )
+ linenr + ", " + colnr );
}
示例9: setPosition
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
public void setPosition() {
StyledTextComp wScript = getStyledTextComp();
String scr = wScript.getText();
int linenr = wScript.getLineAtOffset( wScript.getCaretOffset() ) + 1;
int posnr = wScript.getCaretOffset();
// Go back from position to last CR: how many positions?
int colnr = 0;
while ( posnr > 0 && scr.charAt( posnr - 1 ) != '\n' && scr.charAt( posnr - 1 ) != '\r' ) {
posnr--;
colnr++;
}
wlPosition.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.Position.Label2" )
+ linenr + ", " + colnr );
}
示例10: 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() );
}
}
}
示例11: setPosition
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
public void setPosition() {
StyledTextComp control = wCondition;
if ( wspecifyQuery.getSelection() ) {
control = wQuery;
}
String scr = control.getText();
int linenr = control.getLineAtOffset( control.getCaretOffset() ) + 1;
int posnr = control.getCaretOffset();
// Go back from position to last CR: how many positions?
int colnr = 0;
while ( posnr > 0 && scr.charAt( posnr - 1 ) != '\n' && scr.charAt( posnr - 1 ) != '\r' ) {
posnr--;
colnr++;
}
wlPosition.setText( BaseMessages.getString( PKG, "SalesforceInputDialog.Position.Label", "" + linenr, ""
+ colnr ) );
}
示例12: 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());
}*/
}
示例13: getStyledTextComp
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
private StyledTextComp getStyledTextComp() {
CTabItem item = folder.getSelection();
if (item.getControl().isDisposed())
return null;
else
return (StyledTextComp) item.getControl();
}
示例14: 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());
}*/
}
示例15: getStyledTextComp
import org.pentaho.di.ui.core.widget.StyledTextComp; //导入依赖的package包/类
private StyledTextComp getStyledTextComp() {
CTabItem item = folder.getSelection();
if ( item.getControl().isDisposed() ) {
return null;
} else {
return (StyledTextComp) item.getControl();
}
}