本文整理汇总了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);
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
}
};
}
示例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);
}
}
}
};
}
示例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 );
}
}
}
};
}
示例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 );
}
}
}
};
}