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


Java EnterSelectionDialog.getSelectionNr方法代码示例

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


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

示例1: open

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public void open() {
  // List all star domains in the metastore
  //
  Shell shell = Spoon.getInstance().getShell();

  try {
    List<IdNameDescription> starDomainList = StarDomainMetaStoreUtil.getStarDomainList(Spoon.getInstance().getMetaStore());
    List<String> rows = new ArrayList<String>();
    for (IdNameDescription ind : starDomainList) {
      rows.add(ind.getName()+" : "+ind.getDescription());
    }
    EnterSelectionDialog selectionDialog = new EnterSelectionDialog(shell, rows.toArray(new String[rows.size()]), "Select star domain", "Select the star domain to open:");
    selectionDialog.setMulti(false);
    if (selectionDialog.open()!=null) {
      int index = selectionDialog.getSelectionNr();
      StarDomain starDomain = StarDomainMetaStoreUtil.loadStarDomain(Spoon.getInstance().getMetaStore(), starDomainList.get(index).getId());
      if (starDomain!=null) {
        createTabForDomain(starDomain);
      }
    }
  } catch(Exception e) {
    new ErrorDialog(shell, "Error", "Error getting list of star domains from the MetaStore:", e);
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:25,代码来源:StarModelerPerspective.java

示例2: getVariableName

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public static final String getVariableName(Shell shell, VariableSpace space)
{
	String keys[] = space.listVariables();
    Arrays.sort(keys);
    
    int size = keys.length;
    String key[] = new String[size];
    String val[] = new String[size];
    String str[] = new String[size];
    
    for (int i=0;i<keys.length;i++)
    {
        key[i] = keys[i];
        val[i] = space.getVariable(key[i]);
        str[i] = key[i]+"  ["+val[i]+"]";
    }
            
    EnterSelectionDialog esd = new EnterSelectionDialog(shell, str, Messages.getString("System.Dialog.SelectEnvironmentVar.Title"), Messages.getString("System.Dialog.SelectEnvironmentVar.Message"));
    esd.clearModal();
    if (esd.open()!=null)
    {
        int nr = esd.getSelectionNr();
        String var = key[nr];
     
        return var;
    }
    else
    {
    	return null;
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:32,代码来源:VariableButtonListenerFactory.java

示例3: getVariableName

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public static final String getVariableName(Shell shell, VariableSpace space)
{
	String keys[] = space.listVariables();
    Arrays.sort(keys);
    
    int size = keys.length;
    String key[] = new String[size];
    String val[] = new String[size];
    String str[] = new String[size];
    
    for (int i=0;i<keys.length;i++)
    {
        key[i] = keys[i];
        val[i] = space.getVariable(key[i]);
        str[i] = key[i]+"  ["+val[i]+"]";
    }
            
    EnterSelectionDialog esd = new EnterSelectionDialog(shell, str, BaseMessages.getString(PKG, "System.Dialog.SelectEnvironmentVar.Title"), BaseMessages.getString(PKG, "System.Dialog.SelectEnvironmentVar.Message"));
    esd.clearModal();
    if (esd.open()!=null)
    {
        int nr = esd.getSelectionNr();
        String var = key[nr];
     
        return var;
    }
    else
    {
    	return null;
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:32,代码来源:VariableButtonListenerFactory.java

示例4: getVariableName

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public static final String getVariableName( Shell shell, VariableSpace space ) {
  String[] keys = space.listVariables();
  Arrays.sort( keys );

  int size = keys.length;
  String[] key = new String[size];
  String[] val = new String[size];
  String[] str = new String[size];

  for ( int i = 0; i < keys.length; i++ ) {
    key[i] = keys[i];
    val[i] = space.getVariable( key[i] );
    str[i] = key[i] + "  [" + val[i] + "]";
  }

  EnterSelectionDialog esd = new EnterSelectionDialog( shell, str,
    BaseMessages.getString( PKG, "System.Dialog.SelectEnvironmentVar.Title" ),
    BaseMessages.getString( PKG, "System.Dialog.SelectEnvironmentVar.Message" ) );
  esd.clearModal();
  if ( esd.open() != null ) {
    int nr = esd.getSelectionNr();
    String var = key[nr];

    return var;
  } else {
    return null;
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:29,代码来源:VariableButtonListenerFactory.java

示例5: getSelectionAdapter

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public static final SelectionAdapter getSelectionAdapter(final Composite composite, final Text destination, final GetCaretPositionInterface getCaretPositionInterface, final InsertTextInterface insertTextInterface, final VariableSpace space)
{
    return new SelectionAdapter()
    {
        public void widgetSelected(SelectionEvent e) 
        {
        	String keys[] = space.listVariables();
            Arrays.sort(keys);
            
            int size = keys.length;
            String key[] = new String[size];
            String val[] = new String[size];
            String str[] = new String[size];
            
            for (int i=0;i<keys.length;i++)
            {
                key[i] = keys[i];
                val[i] = space.getVariable(key[i]);
                str[i] = key[i]+"  ["+val[i]+"]";
            }
            
            // Before focus is lost, we get the position of where the selected variable needs to be inserted.
            int position=0;
            if (getCaretPositionInterface!=null)
            {
                position = getCaretPositionInterface.getCaretPosition();
            }
            
            EnterSelectionDialog esd = new EnterSelectionDialog(composite.getShell(), str, Messages.getString("System.Dialog.SelectEnvironmentVar.Title"), Messages.getString("System.Dialog.SelectEnvironmentVar.Message"));
            if (esd.open()!=null)
            {
                int nr = esd.getSelectionNr();
                String var = "${"+key[nr]+"}";
                
                if (insertTextInterface==null)
                {
                    destination.insert(var);
                    //destination.setToolTipText(StringUtil.environmentSubstitute( destination.getText() ) );
                    e.doit=false;
                }
                else
                {
                    insertTextInterface.insertText(var, position);
                }
            }
        }
    };
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:49,代码来源:VariableButtonListenerFactory.java

示例6: getSelectionAdapter

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public static final SelectionAdapter getSelectionAdapter(final Composite composite, final Text destination, final GetCaretPositionInterface getCaretPositionInterface, final InsertTextInterface insertTextInterface, final VariableSpace space)
{
    return new SelectionAdapter()
    {
        public void widgetSelected(SelectionEvent e) 
        {
        	String keys[] = space.listVariables();
            Arrays.sort(keys);
            
            int size = keys.length;
            String key[] = new String[size];
            String val[] = new String[size];
            String str[] = new String[size];
            
            for (int i=0;i<keys.length;i++)
            {
                key[i] = keys[i];
                val[i] = space.getVariable(key[i]);
                str[i] = key[i]+"  ["+val[i]+"]";
            }
            
            // Before focus is lost, we get the position of where the selected variable needs to be inserted.
            int position=0;
            if (getCaretPositionInterface!=null)
            {
                position = getCaretPositionInterface.getCaretPosition();
            }
            
            EnterSelectionDialog esd = new EnterSelectionDialog(composite.getShell(), str, BaseMessages.getString(PKG, "System.Dialog.SelectEnvironmentVar.Title"), BaseMessages.getString(PKG, "System.Dialog.SelectEnvironmentVar.Message"));
            if (esd.open()!=null)
            {
                int nr = esd.getSelectionNr();
                String var = "${"+key[nr]+"}";
                
                if (insertTextInterface==null)
                {
                    destination.insert(var);
                    //destination.setToolTipText(StringUtil.environmentSubstitute( destination.getText() ) );
                    e.doit=false;
                }
                else
                {
                    insertTextInterface.insertText(var, position);
                }
            }
        }
    };
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:49,代码来源:VariableButtonListenerFactory.java

示例7: getSelectionAdapter

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public static final SelectionAdapter getSelectionAdapter( final Composite composite, final Text destination,
    final GetCaretPositionInterface getCaretPositionInterface, final InsertTextInterface insertTextInterface,
    final VariableSpace space ) {
  return new SelectionAdapter() {
    public void widgetSelected( SelectionEvent e ) {
      String[] keys = space.listVariables();
      Arrays.sort( keys );

      int size = keys.length;
      String[] key = new String[size];
      String[] val = new String[size];
      String[] str = new String[size];

      for ( int i = 0; i < keys.length; i++ ) {
        key[i] = keys[i];
        val[i] = space.getVariable( key[i] );
        str[i] = key[i] + "  [" + val[i] + "]";
      }

      // Before focus is lost, we get the position of where the selected variable needs to be inserted.
      int position = 0;
      if ( getCaretPositionInterface != null ) {
        position = getCaretPositionInterface.getCaretPosition();
      }

      EnterSelectionDialog esd =
          new EnterSelectionDialog( composite.getShell(), str, BaseMessages.getString( PKG,
              "System.Dialog.SelectEnvironmentVar.Title" ), BaseMessages.getString( PKG,
                  "System.Dialog.SelectEnvironmentVar.Message" ) );
      if ( esd.open() != null ) {
        int nr = esd.getSelectionNr();
        String var = "${" + key[nr] + "}";

        if ( insertTextInterface == null ) {
          destination.insert( var );
          // destination.setToolTipText(StringUtil.environmentSubstitute( destination.getText() ) );
          e.doit = false;
        } else {
          insertTextInterface.insertText( var, position );
        }
      }
    }
  };
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:45,代码来源:VariableButtonListenerFactory.java

示例8: getSelectionAdapter

import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public static final SelectionAdapter getSelectionAdapter( final Composite composite, final Text destination,
  final GetCaretPositionInterface getCaretPositionInterface, final InsertTextInterface insertTextInterface,
  final VariableSpace space ) {
  return new SelectionAdapter() {
    public void widgetSelected( SelectionEvent e ) {
      String[] keys = space.listVariables();
      Arrays.sort( keys );

      int size = keys.length;
      String[] key = new String[size];
      String[] val = new String[size];
      String[] str = new String[size];

      for ( int i = 0; i < keys.length; i++ ) {
        key[i] = keys[i];
        val[i] = space.getVariable( key[i] );
        str[i] = key[i] + "  [" + val[i] + "]";
      }

      // Before focus is lost, we get the position of where the selected variable needs to be inserted.
      int position = 0;
      if ( getCaretPositionInterface != null ) {
        position = getCaretPositionInterface.getCaretPosition();
      }

      EnterSelectionDialog esd = new EnterSelectionDialog( composite.getShell(), str,
        BaseMessages.getString( PKG, "System.Dialog.SelectEnvironmentVar.Title" ),
        BaseMessages.getString( PKG, "System.Dialog.SelectEnvironmentVar.Message" ) );
      if ( esd.open() != null ) {
        int nr = esd.getSelectionNr();
        String var = "${" + key[nr] + "}";

        if ( insertTextInterface == null ) {
          destination.insert( var );
          // destination.setToolTipText(StringUtil.environmentSubstitute( destination.getText() ) );
          e.doit = false;
        } else {
          insertTextInterface.insertText( var, position );
        }
      }
    }
  };
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:44,代码来源:VariableButtonListenerFactory.java


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