use of org.knime.core.node.workflow.WorkflowManager in project knime-core by knime.
the class SetupSubnodeWizard method addPages.
/**
* {@inheritDoc}
*/
@Override
public void addPages() {
setWindowTitle("Setup Wrapped Metanode Wizard");
setDefaultPageImageDescriptor(ImageDescriptor.createFromImage(ImageRepository.getImage(KNIMEEditorPlugin.PLUGIN_ID, "icons/meta/meta_node_wizard2.png")));
WorkflowManager wfManager = m_subNode.getWorkflowManager();
Map<NodeID, NodeModel> allNodes = wfManager.findNodes(NodeModel.class, false);
LinkedHashMap<NodeID, NodeModel> usageNodes = new LinkedHashMap<NodeID, NodeModel>();
List<NodeID> nodeIDs = new ArrayList<NodeID>();
nodeIDs.addAll(allNodes.keySet());
Collections.sort(nodeIDs);
for (NodeID id : nodeIDs) {
NodeModel model = allNodes.get(id);
if (considerNodeForUsage(model)) {
usageNodes.put(id, model);
}
}
m_portsPage = new ConfigureMetaNodePortsPage("Change the Wrapped Metanode configuration");
m_portsPage.setSubNode(m_subNode);
m_portsPage.setTemplate(null);
addPage(m_portsPage);
}
use of org.knime.core.node.workflow.WorkflowManager in project knime-core by knime.
the class WFShowJobMgrViewAction method run.
/**
* {@inheritDoc}
*/
@Override
public void run() {
final WorkflowManager workflow = getWorkflow();
final Rectangle knimeWindowBounds = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getBounds();
Runnable runner = new Runnable() {
@Override
public void run() {
java.awt.Rectangle bounds = new java.awt.Rectangle(knimeWindowBounds.x, knimeWindowBounds.y, knimeWindowBounds.width, knimeWindowBounds.height);
Node.invokeOpenView(workflow.getJobManager().getView(workflow), workflow.getNameWithID(), bounds);
}
};
SwingUtilities.invokeLater(runner);
}
use of org.knime.core.node.workflow.WorkflowManager in project knime-core by knime.
the class FileUtil method getWorkflowTempDir.
/**
* Reads the temporary directory associated with the current workflow (set in the {@link WorkflowContext}), or - if
* that is <code>null</code> - the global temp dir (see {@link KNIMEConstants#getKNIMETempPath()}).
*
* @return the temp dir of the current {@link WorkflowContext} or the standard temp dir, if no context is set.
* @since 3.5
*/
public static File getWorkflowTempDir() {
final File fallbackDir = KNIMEConstants.getKNIMETempPath().toFile();
NodeContext nodeContext = NodeContext.getContext();
if (nodeContext == null) {
return fallbackDir;
}
WorkflowManager wfm = nodeContext.getWorkflowManager();
if (wfm == null) {
return fallbackDir;
}
WorkflowContext workflowContext = wfm.getContext();
if (workflowContext == null) {
return fallbackDir;
}
if (!workflowContext.getTempLocation().isDirectory()) {
LOGGER.error("Temp folder \"" + workflowContext.getTempLocation().getAbsolutePath() + "\" does not exist (associated with node context \"" + nodeContext + "\") - using fallback temp folder (\"" + fallbackDir.getAbsolutePath() + "\"");
return fallbackDir;
} else {
return workflowContext.getTempLocation();
}
}
Aggregations