use of org.pentaho.di.ui.repository.repositoryexplorer.RepositoryExplorer in project pentaho-kettle by pentaho.
the class Spoon method exploreRepository.
public void exploreRepository() {
if (rep != null) {
final RepositoryExplorerCallback cb = new RepositoryExplorerCallback() {
@Override
public boolean open(UIRepositoryContent element, String revision) throws Exception {
String objName = element.getName();
if (objName != null) {
RepositoryObjectType objectType = element.getRepositoryElementType();
RepositoryDirectory repDir = element.getRepositoryDirectory();
if (element.getObjectId() != null) {
// new way
loadObjectFromRepository(element.getObjectId(), objectType, revision);
} else {
// old way
loadObjectFromRepository(objName, objectType, repDir, revision);
}
}
// do not close explorer
return false;
}
@Override
public boolean error(String message) throws Exception {
closeRepository();
return true;
}
};
try {
final KettleWaitBox box = (KettleWaitBox) this.mainSpoonContainer.getDocumentRoot().createElement("iconwaitbox");
box.setIndeterminate(true);
box.setCanCancel(false);
box.setIcon("ui/images/kettle_logo_small.svg");
box.setTitle(BaseMessages.getString(RepositoryDialogInterface.class, "RepositoryExplorerDialog.Connection.Wait.Title"));
box.setMessage(BaseMessages.getString(RepositoryDialogInterface.class, "RepositoryExplorerDialog.Explorer.Wait.Message"));
box.setDialogParent(shell);
box.setRunnable(new WaitBoxRunnable(box) {
@Override
public void run() {
shell.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
RepositoryExplorer explorer;
try {
try {
explorer = new RepositoryExplorer(shell, rep, cb, Variables.getADefaultVariableSpace(), sharedObjectSyncUtil);
} catch (final KettleRepositoryLostException krle) {
handleRepositoryLost(krle);
closeRepository();
return;
} finally {
box.stop();
}
if (explorer.isInitialized()) {
explorer.show();
} else {
return;
}
explorer.dispose();
} catch (final Throwable e) {
shell.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
new ErrorDialog(shell, BaseMessages.getString(PKG, "Spoon.Error"), e.getMessage(), e);
}
});
}
}
});
}
@Override
public void cancel() {
}
});
box.start();
} catch (Throwable e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "Spoon.Error"), e.getMessage(), e);
}
}
}
use of org.pentaho.di.ui.repository.repositoryexplorer.RepositoryExplorer in project pentaho-kettle by pentaho.
the class ManageUserUISupport method setup.
@Override
protected void setup() {
SecurityController securityController = new SecurityController();
controllerNames.add(securityController.getName());
handlers.add(securityController);
overlays.add(new RepositoryExplorerDefaultXulOverlay("org/pentaho/di/ui/repository/repositoryexplorer/xul/security-enabled-layout-overlay.xul", RepositoryExplorer.class));
}
Aggregations