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