use of org.pentaho.di.ui.core.dialog.ErrorDialog in project pentaho-kettle by pentaho.
the class GetRepositoryNamesDialog method displaydirectoryList.
private void displaydirectoryList() {
try {
if (repository == null) {
throw new KettleException(BaseMessages.getString(PKG, "GetRepositoryNames.Exception.NotConnectedToRepository"));
}
SelectDirectoryDialog sdd = new SelectDirectoryDialog(shell, SWT.NONE, repository);
RepositoryDirectoryInterface rd = sdd.open();
if (rd != null) {
wDirectory.setText(rd.getPath());
}
} catch (Exception e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.Error.Title"), BaseMessages.getString(PKG, "GetRepositoryNames.ErrorGettingFolderds.DialogMessage"), e);
}
}
use of org.pentaho.di.ui.core.dialog.ErrorDialog in project pentaho-kettle by pentaho.
the class ExcelWriterStepDialog method get.
private void get() {
try {
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null) {
TableItemInsertListener listener = new TableItemInsertListener() {
@Override
public boolean tableItemInserted(TableItem tableItem, ValueMetaInterface v) {
if (v.isNumber()) {
if (v.getLength() > 0) {
int le = v.getLength();
int pr = v.getPrecision();
if (v.getPrecision() <= 0) {
pr = 0;
}
String mask = "";
for (int m = 0; m < le - pr; m++) {
mask += "0";
}
if (pr > 0) {
mask += ".";
}
for (int m = 0; m < pr; m++) {
mask += "0";
}
tableItem.setText(3, mask);
}
}
return true;
}
};
BaseStepDialog.getFieldsFromPrevious(r, wFields, 1, new int[] { 1, 5 }, new int[] { 2 }, 0, 0, listener);
}
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), ke);
}
}
use of org.pentaho.di.ui.core.dialog.ErrorDialog in project pentaho-kettle by pentaho.
the class ExecSQLRowDialog method get.
private void get() {
if (!gotPreviousFields) {
gotPreviousFields = true;
try {
String sqlfield = wSQLFieldName.getText();
wSQLFieldName.removeAll();
RowMetaInterface r = transMeta.getPrevStepFields(stepname);
if (r != null) {
wSQLFieldName.removeAll();
wSQLFieldName.setItems(r.getFieldNames());
}
if (sqlfield != null) {
wSQLFieldName.setText(sqlfield);
}
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "ExecSQLRowDialog.FailedToGetFields.DialogTitle"), BaseMessages.getString(PKG, "ExecSQLRowDialog.FailedToGetFields.DialogMessage"), ke);
}
}
}
use of org.pentaho.di.ui.core.dialog.ErrorDialog in project pentaho-kettle by pentaho.
the class PaloCubeDeleteDialog method doSelectConnection.
private void doSelectConnection(boolean clearCurrentData) {
try {
if (clearCurrentData) {
comboCubeName.removeAll();
}
if (comboCubeName.getItemCount() > 1) {
return;
}
if (addConnectionLine.getText() != null) {
DatabaseMeta dbMeta = DatabaseMeta.findDatabase(jobMeta.getDatabases(), addConnectionLine.getText());
if (dbMeta != null) {
PaloHelper helper = new PaloHelper(dbMeta, DefaultLogLevel.getLogLevel());
helper.connect();
List<String> cubes = helper.getCubesNames();
Collections.sort(cubes, new PaloNameComparator());
for (String cubename : cubes) {
if (comboCubeName.indexOf(cubename) == -1) {
comboCubeName.add(cubename);
}
}
helper.disconnect();
}
}
} catch (Exception ex) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "PaloDimInputFlatDialog.RetreiveDimensionsErrorTitle"), BaseMessages.getString(PKG, "PaloDimInputFlatDialog.RetreiveDimensionsError"), ex);
}
}
use of org.pentaho.di.ui.core.dialog.ErrorDialog in project pentaho-kettle by pentaho.
the class PaloCellOutputDialog method doGetFields.
private void doGetFields() {
try {
List<String> cubeDimensions = null;
if (comboCube.getText() != null && comboCube.getText() != "") {
if (addConnectionLine.getText() != null) {
DatabaseMeta dbMeta = transMeta.findDatabase(addConnectionLine.getText());
if (dbMeta != null) {
PaloCellOutputData data = new PaloCellOutputData(dbMeta);
data.helper.connect();
cubeDimensions = data.helper.getCubeDimensions(comboCube.getText());
data.helper.disconnect();
}
}
tableViewFields.table.removeAll();
for (int i = 0; i < cubeDimensions.size(); i++) {
final TableItem item = new TableItem(tableViewFields.table, SWT.NONE);
item.setText(1, cubeDimensions.get(i));
// item.setText(3, "String");
}
final TableItem item = new TableItem(tableViewFields.table, SWT.NONE);
item.setText(1, "Cube Measure");
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN));
tableViewFields.removeEmptyRows();
tableViewFields.setRowNums();
tableViewFields.optWidth(true);
tableViewFields.setReadonly(true);
} else {
new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), new Exception(BaseMessages.getString(PKG, "PaloCellOutputDialog.SelectCubeFirstError")));
}
this.fillPreviousFieldTableViewColumn();
} catch (KettleException ke) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Title"), BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"), ke);
}
}
Aggregations