use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.
the class DataProcessTest method before.
@Before
public void before() {
process = new Process(TestUtils.createDefaultProperty());
dataProcess = new DataProcess(process);
testNode = new Node(testComponent, process);
//$NON-NLS-1$
TestProperties testProps = (TestProperties) new TestProperties("test").init();
testNode.setComponentProperties(testProps);
}
use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.
the class TalendEditorComponentCreationAssist method canCreateAt.
public boolean canCreateAt(Object node, Point location) {
if (node == null || location == null) {
MessageDialog.openWarning(graphicControl.getShell(), "Failed", "Component can't be created here");
return false;
}
if (process instanceof Process && node instanceof Node) {
NodeContainer nc = ((Process) process).loadNodeContainer((Node) node, false);
boolean canExecute = new CreateNodeContainerCommand((Process) process, nc, location).canExecute();
if (!canExecute) {
MessageDialog.openWarning(graphicControl.getShell(), "Failed", "Component can't be created here");
}
return canExecute;
}
return true;
}
use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.
the class ProcessConvertServiceImpl method getProcessFromItem.
@Override
public IProcess getProcessFromItem(Item item, boolean loadScreenshots) {
if (ProcessItemImpl.class == item.getClass()) {
Process process = null;
process = new Process(item.getProperty());
process.loadXmlFile(loadScreenshots);
return process;
}
return null;
}
use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.
the class DesignerCoreService method getProcessContextFromItem.
/*
* (non-Javadoc)
*
* @see
* org.talend.designer.core.IDesignerCoreService#getProcessContextFromItem(org.talend.core.model.properties.Item)
*/
@Override
public IContextManager getProcessContextFromItem(Item item) {
try {
Process process = new Process(item.getProperty());
process.loadContexts();
return process.getContextManager();
} catch (Exception e) {
ExceptionHandler.process(e);
}
return null;
}
use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.
the class Problems method addErrorMark.
public static void addErrorMark() {
nodeList.clear();
String befor = "Error in the component's properties:";
for (IProcess process : openJobs) {
if (((Process) process).isActivate()) {
for (INode inode : ((Process) process).getGraphicalNodes()) {
if (inode instanceof Node) {
Node node = (Node) inode;
if (problemList.getProblemList().size() > 0) {
for (int i = 0; i < problemList.getProblemList().size(); i++) {
Problem problem = problemList.getProblemList().get(i);
if (node.isActivate()) {
if (problem.getStatus().equals(ProblemStatus.ERROR)) {
if (problem instanceof TalendProblem) {
TalendProblem tProblem = (TalendProblem) problem;
if (!tProblem.getJavaUnitName().equals(node.getProcess().getName())) {
continue;
}
if (tProblem.getVersion() != null) {
if (!tProblem.getVersion().equals(node.getProcess().getVersion())) {
continue;
}
}
if (tProblem.getUnitName() != null && tProblem.getUnitName().equals(node.getUniqueName())) {
// nodeList.add(node);
if (nodeList.get(node) != null) {
nodeList.get(node).append("\r\n");
nodeList.get(node).append(tProblem.getDescription());
} else {
nodeList.put(node, new StringBuffer(tProblem.getDescription()));
}
} else {
if (node.isErrorFlag() == true) {
node.setErrorFlag(false);
node.setCompareFlag(false);
node.setErrorInfo(befor + tProblem.getDescription());
//$NON-NLS-1$
node.getNodeError().updateState("UPDATE_STATUS", false);
//$NON-NLS-1$
node.setErrorInfoChange("ERRORINFO", false);
} else {
continue;
}
}
}
} else {
if (node.isErrorFlag() == true) {
node.setErrorFlag(false);
node.setCompareFlag(false);
//$NON-NLS-1$
node.setErrorInfoChange("ERRORINFO", false);
} else {
continue;
}
}
} else {
continue;
}
}
} else {
if (node.isErrorFlag() == true) {
node.setErrorFlag(false);
node.setCompareFlag(false);
node.setErrorInfo(null);
//$NON-NLS-1$
node.getNodeError().updateState("UPDATE_STATUS", false);
//$NON-NLS-1$
node.setErrorInfoChange("ERRORINFO", false);
} else {
continue;
}
}
}
}
} else {
continue;
}
}
Iterator<Entry<Node, StringBuffer>> set = nodeList.entrySet().iterator();
while (set.hasNext()) {
Entry<Node, StringBuffer> en = set.next();
Node node = en.getKey();
String des = en.getValue().toString();
if (node.isErrorFlag() == false) {
node.setErrorFlag(true);
node.setCompareFlag(false);
node.setErrorInfo(befor + des);
//$NON-NLS-1$
node.getNodeError().updateState("UPDATE_STATUS", false);
//$NON-NLS-1$
node.setErrorInfoChange("ERRORINFO", true);
}
}
}
Aggregations