當前位置: 首頁>>代碼示例>>Java>>正文


Java ErrorDialog類代碼示例

本文整理匯總了Java中org.pentaho.di.ui.core.dialog.ErrorDialog的典型用法代碼示例。如果您正苦於以下問題:Java ErrorDialog類的具體用法?Java ErrorDialog怎麽用?Java ErrorDialog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ErrorDialog類屬於org.pentaho.di.ui.core.dialog包,在下文中一共展示了ErrorDialog類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: removeService

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
protected boolean removeService( Shell shell, IMetaStore metaStore, String elementName ) {
  MessageDialog dialog = new MessageDialog( shell, "Confirm removal", shell.getDisplay().getSystemImage( SWT.ICON_QUESTION ),
    "Are you sure you want to remove streaming service '" + elementName + "'?", SWT.NONE, new String[] { "Yes", "No" }, 1 );
  int answerIndex = dialog.open();
  if ( answerIndex == 0 ) {
    try {
      MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, metaStore, PentahoDefaults.NAMESPACE );
      rtFactory.deleteElement( elementName );
      return true;
    } catch ( MetaStoreException e ) {
      new ErrorDialog( shell, "Error", "Error deleting streaming service with name '" + elementName + "'", e );
      return false;
    }

  }

  return false;
}
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-streaming,代碼行數:19,代碼來源:StreamingTransDialogTab.java

示例2: createNewService

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
protected String createNewService( Shell shell, IMetaStore metaStore ) {
  EnterStringDialog dialog = new EnterStringDialog( shell, "table1", "Enter service name", "Enter the name of the new streaming service" );
  String name = dialog.open();
  if ( name != null ) {

    try {
      MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, metaStore, PentahoDefaults.NAMESPACE );
      if ( rtFactory.loadElement( name ) != null ) {
        throw new MetaStoreException( "The streaming service with name '" + name + "' already exists" );
      }
    } catch ( MetaStoreException e ) {
      new ErrorDialog( shell, "Error", "Error creating new streaming service", e );
      return null;
    }

    return name;
  } else {
    return null;
  }
}
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-streaming,代碼行數:21,代碼來源:StreamingTransDialogTab.java

示例3: editConnection

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
public static void editConnection(Shell shell, MetaStoreFactory<HCPConnection> factory, String connectionName) {
  if (StringUtils.isEmpty(connectionName)) {
    return;
  }
  try {
    HCPConnection hcpConnection = factory.loadElement(connectionName);
    if (hcpConnection==null) {
      newConnection(shell, factory);
    } else {
      HCPConnectionDialog hcpConnectionDialog = new HCPConnectionDialog(shell, hcpConnection);
      if (hcpConnectionDialog.open()) {
        factory.saveElement(hcpConnection);
      }
    }
  } catch(Exception exception) {
    new ErrorDialog(shell,
        BaseMessages.getString(PKG, "HCPConnectionUtils.Error.ErrorEditingConnection.Title"),
        BaseMessages.getString(PKG, "HCPConnectionUtils.Error.ErrorEditingConnection.Message"),
        exception);
  }
}
 
開發者ID:mattcasters,項目名稱:pdi-hcp-plugin,代碼行數:22,代碼來源:HCPConnectionUtils.java

示例4: deleteConnection

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
public static void deleteConnection(Shell shell, MetaStoreFactory<HCPConnection> factory, String connectionName) {
  if (StringUtils.isEmpty(connectionName)) {
    return;
  }
  
  MessageBox box = new MessageBox(shell, SWT.YES | SWT.NO | SWT.ICON_ERROR);
  box.setText(BaseMessages.getString(PKG, "HCPConnectionUtils.DeleteConnectionConfirmation.Title"));
  box.setMessage(BaseMessages.getString(PKG, "HCPConnectionUtils.DeleteConnectionConfirmation.Message", connectionName));
  int answer = box.open();      
  if ((answer&SWT.YES)!=0) {
    try {
      factory.deleteElement(connectionName);
    } catch(Exception exception) {
      new ErrorDialog(shell,
          BaseMessages.getString(PKG, "HCPConnectionUtils.Error.ErrorDeletingConnection.Title"),
          BaseMessages.getString(PKG, "HCPConnectionUtils.Error.ErrorDeletingConnection.Message", connectionName),
          exception);
    }
  }

}
 
開發者ID:mattcasters,項目名稱:pdi-hcp-plugin,代碼行數:22,代碼來源:HCPConnectionUtils.java

示例5: ok

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
private void ok() {
  if ( Const.isEmpty( wStepname.getText() ) ) {
    return;
  }

  stepname = wStepname.getText(); // return value

  input.setConnection(null);
  String connectionName = wConnection.getText();
  if (StringUtils.isNotEmpty(connectionName)) {
    try{
      HCPConnection connection = HCPConnectionUtils.getConnectionFactory(metaStore).loadElement(connectionName);
      input.setConnection(connection);
    } catch(Exception exception) {
      new ErrorDialog(shell, 
          BaseMessages.getString(PKG, "HCPDeleteDialog.Error.ErrorLoadingConnectionWithName.Title"), 
          BaseMessages.getString(PKG, "HCPDeleteDialog.Error.ErrorLoadingConnectionWithName.Message", connectionName), exception);
    }
  }
  input.setTargetFileField(wTargetFileField.getText() );
  input.setResponseCodeField(wResponseCodeField.getText());
  input.setResponseTimeField(wResponseTimeField.getText());
  
  dispose();
}
 
開發者ID:mattcasters,項目名稱:pdi-hcp-plugin,代碼行數:26,代碼來源:HCPDeleteDialog.java

示例6: editUnitTest

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
protected void editUnitTest(String unitTestName, TransMeta transMeta) {
  try {
    Spoon spoon = Spoon.getInstance();
    MetaStoreFactory<TransUnitTest> setFactory = new MetaStoreFactory<TransUnitTest>(
        TransUnitTest.class, spoon.getMetaStore(), PentahoDefaults.NAMESPACE);
    TransUnitTest unitTest = setFactory.loadElement(unitTestName);
    if (unitTest==null) {
      throw new KettleException(BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorEditingUnitTest.Message", unitTestName));
    }
    TransUnitTestDialog dialog = new TransUnitTestDialog(spoon.getShell(), transMeta, spoon.getMetaStore(), unitTest);
    if (dialog.open()) {
      setFactory.saveElement(unitTest);
    }
  } catch(Exception exception) {
    new ErrorDialog(Spoon.getInstance().getShell(), 
        BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorEditingUnitTest.Title"),
        BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorEditingUnitTest.Message", unitTestName), 
        exception);
  }
}
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:21,代碼來源:ShowUnitTestMenuExtensionPoint.java

示例7: deleteUnitTest

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
protected void deleteUnitTest(String unitTestName) {
  MessageBox box = new MessageBox(Spoon.getInstance().getShell(), SWT.YES | SWT.NO);
  box.setText(BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.YouSureToDelete.Title"));
  box.setMessage(BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.YouSureToDelete.Message", unitTestName));
  int answer = box.open();
  if ((answer&SWT.YES)!=0) {
    try {
      MetaStoreFactory<TransUnitTest> factory = new MetaStoreFactory<TransUnitTest>(TransUnitTest.class, Spoon.getInstance().getMetaStore(), PentahoDefaults.NAMESPACE);
      factory.deleteElement(unitTestName);
      DataSetHelper.getInstance().detachUnitTest();
    } catch(Exception exception) {
      new ErrorDialog(Spoon.getInstance().getShell(), 
          BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorDeletingUnitTest.Title"),
          BaseMessages.getString(PKG, "ShowUnitTestMenuExtensionPoint.ErrorDeletingUnitTest.Message", unitTestName), 
          exception);

    }
  }
}
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:20,代碼來源:ShowUnitTestMenuExtensionPoint.java

示例8: removeDataSetGroup

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的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 );
    }
  }
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:24,代碼來源:DataSetHelper.java

示例9: addDataSet

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
public void addDataSet() {

    Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );

    IMetaStore metaStore = spoon.getMetaStore();

    try {
      MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
      List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
      groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
      List<DataSetGroup> groups = groupFactory.getElements();

      MetaStoreFactory<DataSet> setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE );
      setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groups );

      DataSet dataSet = new DataSet();

      editDataSet( spoon, dataSet, groups, setFactory, null );

    } catch ( Exception e ) {
      new ErrorDialog( spoon.getShell(), "Error", "Error creating a new data set", e );
    }
  }
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:24,代碼來源:DataSetHelper.java

示例10: editDataSet

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
private void editDataSet( Spoon spoon, DataSet dataSet, List<DataSetGroup> groups, MetaStoreFactory<DataSet> setFactory, String setName ) throws MetaStoreException {
  
  try {
    DataSetDialog setDialog = new DataSetDialog( spoon.getShell(), setFactory.getMetaStore(), dataSet, groups, getAvailableDatabases(spoon.getRepository()) );
    while ( setDialog.open() ) {
      String message = validateDataSet( dataSet, setName, setFactory.getElementNames() );

      // Save the data set...
      //
      if ( message == null ) {
        setFactory.saveElement( dataSet );
        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", "Unable to edit data set", e);
  }

}
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:25,代碼來源:DataSetHelper.java

示例11: detachUnitTest

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
public void detachUnitTest() {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  try {
    TransGraph transGraph = spoon.getActiveTransGraph();
    if ( transGraph == null ) {
      return;
    }
    TransMeta transMeta = spoon.getActiveTransformation();
    if (transMeta == null ) {
      return;
    }

    transMeta.setAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_TRANS_SELECTED_UNIT_TEST_NAME, null );
    transMeta.setChanged();
    
    DataSetConst.clearStepDataSetIndicators( transMeta );
    
    spoon.refreshGraph();
  } catch ( Exception e ) {
    new ErrorDialog( spoon.getShell(), "Error", "Error detaching unit test", e );
  }
}
 
開發者ID:mattcasters,項目名稱:pentaho-pdi-dataset,代碼行數:23,代碼來源:DataSetHelper.java

示例12: getFields

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
private void getFields(){
   try {
      RowMetaInterface rowMeta = transMeta.getPrevStepFields( stepname );
      if ( rowMeta != null ) {
         BaseStepDialog.getFieldsFromPrevious( rowMeta, m_fieldsView, 1,
                                               new int[]{1}, null, -1, -1,
                                               null );
      }
   }
   catch ( KettleException e ){
      logError( BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Message" ), //$NON-NLS-1$
            e );
      new ErrorDialog( shell,
            BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Title" ), BaseMessages.getString( PKG, //$NON-NLS-1$
                "System.Dialog.GetFieldsFailed.Message" ), e ); //$NON-NLS-1$
   }
}
 
開發者ID:SequoiaDB,項目名稱:pentaho-sequoiadb-plugin,代碼行數:18,代碼來源:SequoiaDBOutputDialog.java

示例13: PopulateFields

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
private void PopulateFields( CCombo cc ) {
  if ( cc.isDisposed() ) {
    return;
  }
  try {
    String initValue = cc.getText();
    cc.removeAll();
    RowMetaInterface r = transMeta.getPrevStepFields( stepname );
    if ( r != null ) {
      cc.setItems( r.getFieldNames() );
    }
    if ( !Const.isEmpty( initValue ) ) {
      cc.setText( initValue );
    }
  } catch ( KettleException ke ) {
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "XsltDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "XsltDialog.FailedToGetFields.DialogMessage" ), ke );
  }

}
 
開發者ID:griddynamics,項目名稱:xml-dom-kettle-etl-plugin,代碼行數:22,代碼來源:DOMXsltDialog.java

示例14: setSourceStreamField

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
private void setSourceStreamField() {
	try {
		String value = wFieldValue.getText();
		wFieldValue.removeAll();

		RowMetaInterface r = transMeta.getPrevStepFields(stepname);
		if (r != null) {
			wFieldValue.setItems(r.getFieldNames());
		}
		if (value != null) {
			wFieldValue.setText(value);
		}
	} catch (KettleException ke) {
		new ErrorDialog(
				shell,
				BaseMessages
						.getString(PKG,
								"FastJsonInputDialog.FailedToGetFields.DialogTitle"),
				BaseMessages
						.getString(PKG,
								"FastJsonInputDialog.FailedToGetFields.DialogMessage"),
				ke);
	}
}
 
開發者ID:etdube,項目名稱:pdi-fastjsoninput-plugin,代碼行數:25,代碼來源:FastJsonInputDialog.java

示例15: getPreviousFields

import org.pentaho.di.ui.core.dialog.ErrorDialog; //導入依賴的package包/類
private void getPreviousFields()
{
	try
	{
		RowMetaInterface r = transMeta.getPrevStepFields(stepname);
		if (r!=null)
		{
             r.getFieldNames();
             
             for (int i=0;i<r.getFieldNames().length;i++)
				{	
					wfieldevaluate.add(r.getFieldNames()[i]);					
					
				}
		}
	}
	catch(KettleException ke)
	{
		new ErrorDialog(shell, BaseMessages.getString(PKG, "RegexEvalDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "RegexEvalDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$ //$NON-NLS-2$
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:22,代碼來源:RegexEvalDialog.java


注:本文中的org.pentaho.di.ui.core.dialog.ErrorDialog類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。