use of org.apache.hop.core.file.IHasFilename in project hop by apache.
the class HopGuiPipelineTransformContext method openReferencedObject.
public static final void openReferencedObject(PipelineMeta pipelineMeta, IVariables variables, ITransformMeta iTransformMeta, String objectDescription, int index) {
HopGui hopGui = HopGui.getInstance();
try {
IHasFilename hasFilename = iTransformMeta.loadReferencedObject(index, pipelineMeta.getMetadataProvider(), variables);
if (hasFilename != null) {
String filename = variables.resolve(hasFilename.getFilename());
// Is this object already loaded?
//
HopDataOrchestrationPerspective perspective = HopGui.getDataOrchestrationPerspective();
TabItemHandler tabItemHandler = perspective.findTabItemHandlerWithFilename(filename);
if (tabItemHandler != null) {
perspective.switchToTab(tabItemHandler);
} else {
hopGui.fileDelegate.fileOpen(filename);
}
}
} catch (Exception e) {
new ErrorDialog(hopGui.getShell(), "Error", "Error opening referenced object '" + objectDescription + "'", e);
}
}
use of org.apache.hop.core.file.IHasFilename in project hop by apache.
the class HopGuiWorkflowActionContext method openReferencedObject.
public static final void openReferencedObject(WorkflowMeta workflowMeta, IVariables variables, IAction action, String objectDescription, int index) {
HopGui hopGui = HopGui.getInstance();
try {
IHasFilename hasFilename = action.loadReferencedObject(index, workflowMeta.getMetadataProvider(), variables);
if (hasFilename != null) {
String filename = variables.resolve(hasFilename.getFilename());
// Is this object already loaded?
//
HopDataOrchestrationPerspective perspective = HopGui.getDataOrchestrationPerspective();
TabItemHandler tabItemHandler = perspective.findTabItemHandlerWithFilename(filename);
if (tabItemHandler != null) {
perspective.switchToTab(tabItemHandler);
} else {
hopGui.fileDelegate.fileOpen(filename);
}
}
} catch (Exception e) {
new ErrorDialog(hopGui.getShell(), "Error", "Error opening referenced object '" + objectDescription + "'", e);
}
}
use of org.apache.hop.core.file.IHasFilename in project hop by apache.
the class HopGuiWorkflowGraph method loadReferencedObject.
protected void loadReferencedObject(ActionMeta actionCopy, int index) {
try {
IHasFilename referencedMeta = actionCopy.getAction().loadReferencedObject(index, hopGui.getMetadataProvider(), variables);
if (referencedMeta == null) {
// Sorry, nothing loaded
return;
}
IHopFileType fileTypeHandler = hopGui.getPerspectiveManager().findFileTypeHandler(referencedMeta);
fileTypeHandler.openFile(hopGui, referencedMeta.getFilename(), hopGui.getVariables());
} catch (Exception e) {
new ErrorDialog(hopShell(), BaseMessages.getString(PKG, "HopGuiWorkflowGraph.ErrorDialog.FileNotLoaded.Header"), BaseMessages.getString(PKG, "HopGuiWorkflowGraph.ErrorDialog.FileNotLoaded.Message"), e);
}
}
Aggregations