本文整理汇总了Java中org.pentaho.di.ui.core.dialog.EnterSelectionDialog.open方法的典型用法代码示例。如果您正苦于以下问题:Java EnterSelectionDialog.open方法的具体用法?Java EnterSelectionDialog.open怎么用?Java EnterSelectionDialog.open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.ui.core.dialog.EnterSelectionDialog
的用法示例。
在下文中一共展示了EnterSelectionDialog.open方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openRepo
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public void openRepo() {
MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();
try {
List<String> names = repoFactory.getElementNames();
Collections.sort( names );
EnterSelectionDialog esd = new EnterSelectionDialog( getShell(), names.toArray( new String[names.size()] ), "Select Repository", "Select the repository to open..." );
String name = esd.open();
if ( name == null ) {
return;
}
GitRepository repo = repoFactory.loadElement( name );
gitController.openGit( repo );
} catch ( Exception e ) {
e.printStackTrace();
}
}
示例2: editRepo
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public void editRepo() throws MetaStoreException {
MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();
List<String> names = repoFactory.getElementNames();
Collections.sort( names );
EnterSelectionDialog esd = new EnterSelectionDialog( getShell(), names.toArray( new String[names.size()] ), "Select Repository", "Select the repository to edit..." );
String name = esd.open();
if ( name == null ) {
return;
}
GitRepository repo = repoFactory.loadElement( name );
EditRepositoryDialog dialog = new EditRepositoryDialog( getShell(), repo );
if ( dialog.open() == Window.OK ) {
repoFactory.saveElement( repo );
}
}
示例3: merge
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
@Override
public boolean merge() {
String name = null;
List<String> names = getBranches();
EnterSelectionDialog esd = new EnterSelectionDialog( shell, names.toArray( new String[names.size()] ),
"Select Branch", "Select the branch to be merged (reintegrated) into the current working copy" );
name = esd.open();
if ( name == null ) {
return false;
}
try {
svnClient.mergeReintegrate( new SVNUrl( getRemoteRoot() + File.separator + name ),
SVNRevision.HEAD, root, false, false );
return true;
} catch ( Exception e ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
}
return false;
}
示例4: removeDataSetGroup
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public void removeDataSetGroup() {
Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
IMetaStore metaStore = spoon.getMetaStore();
MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
try {
List<String> groupNames = groupFactory.getElementNames();
Collections.sort( groupNames );
EnterSelectionDialog esd = new EnterSelectionDialog( spoon.getShell(), groupNames.toArray( new String[groupNames.size()] ), "Select the group", "Select the group to edit..." );
String groupName = esd.open();
if ( groupName != null ) {
// TODO: Find the unit tests for this group, if there are any, we can't remove the group
//
groupFactory.deleteElement(groupName);
}
} catch ( Exception e ) {
new ErrorDialog( spoon.getShell(), "Error", "Error retrieving the list of data set groups or deleting a group", e );
}
}
示例5: populateLoopPaths
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void populateLoopPaths(GetXMLDataMeta meta, String XMLSource,boolean dynamicXMLSource,
boolean useURL)
{
if(Const.isEmpty(XMLSource)) return;
String[] list_xpath=null;
LoopNodesImportProgressDialog pd=null;
if(dynamicXMLSource) {
pd = new LoopNodesImportProgressDialog(shell, meta, XMLSource, useURL);
}else {
pd = new LoopNodesImportProgressDialog(shell, meta, XMLSource, meta.getEncoding()==null?"UTF-8":meta.getEncoding());
}
if(pd!=null) {
list_xpath= pd.open();
if(list_xpath!=null) {
EnterSelectionDialog s = new EnterSelectionDialog(shell, list_xpath, BaseMessages.getString(PKG, "GetXMLDataDialog.Dialog.SelectALoopPath.Title"), BaseMessages.getString(PKG, "GetXMLDataDialog.Dialog.SelectALoopPath.Message"));
String listxpaths = s.open();
if (listxpaths != null) {
wLoopXPath.setText(listxpaths);
}
}
}
this.XMLSource=XMLSource;
}
示例6: selectSlaveServers
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void selectSlaveServers()
{
String[] names = SlaveServer.getSlaveServerNames(slaveServers);
int idx[] = Const.indexsOfFoundStrings(wServers.getItems(0), names);
EnterSelectionDialog dialog = new EnterSelectionDialog(shell, names, BaseMessages.getString(PKG, "ClusterSchemaDialog.SelectServers.Label"), //$NON-NLS-1$
BaseMessages.getString(PKG, "ClusterSchemaDialog.SelectServersCluster.Label")); //$NON-NLS-1$
dialog.setAvoidQuickSearch();
dialog.setSelectedNrs(idx);
dialog.setMulti(true);
if (dialog.open()!=null)
{
clusterSchema.getSlaveServers().clear();
int[] indeces = dialog.getSelectionIndeces();
for (int i=0;i<indeces.length;i++)
{
SlaveServer slaveServer = SlaveServer.findSlaveServer(slaveServers, names[indeces[i]]);
clusterSchema.getSlaveServers().add(slaveServer);
}
refreshSlaveServers();
}
}
示例7: showFiles
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void showFiles()
{
TextFileInputMeta tfii = new TextFileInputMeta();
getInfo(tfii);
String files[] = tfii.getFilePaths(transMeta);
if (files!=null && files.length>0)
{
EnterSelectionDialog esd = new EnterSelectionDialog(shell, files, "Files read", "Files read:");
esd.setViewOnly();
esd.open();
}
else
{
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );
mb.setMessage(Messages.getString("TextFileInputDialog.NoFilesFound.DialogMessage"));
mb.setText(Messages.getString("System.Dialog.Error.Title"));
mb.open();
}
}
示例8: selectSlaveServers
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void selectSlaveServers()
{
String[] names = SlaveServer.getSlaveServerNames(slaveServers);
int idx[] = Const.indexsOfFoundStrings(wServers.getItems(0), names);
EnterSelectionDialog dialog = new EnterSelectionDialog(shell, names, Messages.getString("ClusterSchemaDialog.SelectServers.Label"), //$NON-NLS-1$
Messages.getString("ClusterSchemaDialog.SelectServersCluster.Label")); //$NON-NLS-1$
dialog.setSelectedNrs(idx);
dialog.setMulti(true);
if (dialog.open()!=null)
{
clusterSchema.getSlaveServers().clear();
int[] indeces = dialog.getSelectionIndeces();
for (int i=0;i<indeces.length;i++)
{
SlaveServer slaveServer = SlaveServer.findSlaveServer(slaveServers, names[indeces[i]]);
clusterSchema.getSlaveServers().add(slaveServer);
}
refreshSlaveServers();
}
}
示例9: showFiles
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void showFiles()
{
TextFileInputMeta tfii = new TextFileInputMeta();
getInfo(tfii);
String files[] = tfii.getFilePaths(transMeta);
if (files!=null && files.length>0)
{
EnterSelectionDialog esd = new EnterSelectionDialog(shell, files, "Files read", "Files read:");
esd.setViewOnly();
esd.open();
}
else
{
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );
mb.setMessage(BaseMessages.getString(PKG, "TextFileInputDialog.NoFilesFound.DialogMessage"));
mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
mb.open();
}
}
示例10: showFiles
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
private void showFiles() {
TextFileInputMeta tfii = new TextFileInputMeta();
getInfo( tfii, true );
String[] files =
FileInputList.createFilePathList( transMeta, tfii.inputFiles.fileName, tfii.inputFiles.fileMask,
tfii.inputFiles.excludeFileMask, tfii.inputFiles.fileRequired, tfii.inputFiles.includeSubFolderBoolean() );
if ( files != null && files.length > 0 ) {
EnterSelectionDialog esd = new EnterSelectionDialog( shell, files, "Files read", "Files read:" );
esd.setViewOnly();
esd.open();
} else {
MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
mb.setMessage( BaseMessages.getString( PKG, "TextFileInputDialog.NoFilesFound.DialogMessage" ) );
mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) );
mb.open();
}
}
示例11: 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);
}
}
示例12: removeRepo
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public void removeRepo() throws MetaStoreException {
MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();
List<String> names = repoFactory.getElementNames();
Collections.sort( names );
EnterSelectionDialog esd = new EnterSelectionDialog( getShell(), names.toArray( new String[names.size()] ), "Select Repository", "Select the repository to remove..." );
String name = esd.open();
if ( name != null ) {
repoFactory.deleteElement( name );
showMessageBox( "Success", "Success" );
}
}
示例13: deleteTag
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public void deleteTag() throws Exception {
List<String> names = vcs.getTags();
EnterSelectionDialog esd = new EnterSelectionDialog( getShell(), names.toArray( new String[names.size()] ), "Select Tag", "Select a tag to delete..." );
String name = esd.open();
if ( name != null ) {
if ( vcs.deleteTag( name ) ) {
showMessageBox( BaseMessages.getString( PKG, "Dialog.Success" ), BaseMessages.getString( PKG, "Dialog.Success" ) );
}
}
}
示例14: getSchemaNames
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
/**
* Presents a dialog box to select a schema from the database. Then sets the selected schema in the dialog
*/
private void getSchemaNames() {
DatabaseMeta databaseMeta = transMeta.findDatabase( wConnection.getText() );
if ( databaseMeta != null ) {
Database database = new Database( loggingObject, databaseMeta );
try {
database.connect();
String[] schemas = database.getSchemas();
if ( null != schemas && schemas.length > 0 ) {
schemas = Const.sortStrings( schemas );
EnterSelectionDialog dialog =
new EnterSelectionDialog( shell, schemas, BaseMessages.getString(
PKG, "SnowflakeBulkLoader.Dialog.AvailableSchemas.Title", wConnection.getText() ), BaseMessages
.getString( PKG, "SnowflakeBulkLoader.Dialog.AvailableSchemas.Message", wConnection.getText() ) );
String d = dialog.open();
if ( d != null ) {
wSchema.setText( Const.NVL( d, "" ) );
setTableFieldCombo();
}
} else {
MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
mb.setMessage( BaseMessages.getString( PKG, "SnowflakeBulkLoader.Dialog.NoSchema.Error" ) );
mb.setText( BaseMessages.getString( PKG, "SnowflakeBulkLoader.Dialog.GetSchemas.Error" ) );
mb.open();
}
} catch ( Exception e ) {
new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages
.getString( PKG, "SnowflakeBulkLoader.Dialog.ErrorGettingSchemas" ), e );
} finally {
database.disconnect();
}
}
}
示例15: editDataSetGroup
import org.pentaho.di.ui.core.dialog.EnterSelectionDialog; //导入方法依赖的package包/类
public void editDataSetGroup() {
Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
IMetaStore metaStore = spoon.getMetaStore();
MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
try {
List<String> groupNames = groupFactory.getElementNames();
Collections.sort( groupNames );
EnterSelectionDialog esd = new EnterSelectionDialog( spoon.getShell(), groupNames.toArray( new String[groupNames.size()] ), "Select the group", "Select the group to edit..." );
String groupName = esd.open();
if ( groupName != null ) {
List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
DataSetGroup dataSetGroup = groupFactory.loadElement( groupName );
DataSetGroupDialog groupDialog = new DataSetGroupDialog( spoon.getShell(), dataSetGroup, databases );
while ( groupDialog.open() ) {
String message = validateDataSetGroup( dataSetGroup, groupName, groupFactory.getElementNames() );
// Save the group ...
//
if ( message == null ) {
groupFactory.saveElement( dataSetGroup );
break;
} else {
MessageBox box = new MessageBox( spoon.getShell(), SWT.OK );
box.setText( "Error" );
box.setMessage( message );
box.open();
}
}
}
} catch ( Exception e ) {
new ErrorDialog( spoon.getShell(), "Error", "Error retrieving the list of data set groups", e );
}
}