use of org.talend.core.model.process.IProcess in project tdi-studio-se by Talend.
the class MapperManager method removeSelectedOutputTable.
public void removeSelectedOutputTable() {
OutputDataMapTableView currentSelectedDataMapTableView = uiManager.getCurrentSelectedOutputTableView();
if (currentSelectedDataMapTableView != null) {
OutputTable outputTable = (OutputTable) currentSelectedDataMapTableView.getDataMapTable();
String tableTitle = ((AbstractDataMapTable) currentSelectedDataMapTableView.getDataMapTable()).getTitle();
if (MessageDialog.openConfirm(currentSelectedDataMapTableView.getShell(), //$NON-NLS-1$
Messages.getString("MapperManager.removeOutputTableTitle"), Messages.getString("MapperManager.removeOutputTableTitleMessage", new Object[] { tableTitle }))) {
//$NON-NLS-1$
IProcess process = mapperComponent.getProcess();
uiManager.removeOutputTableView(currentSelectedDataMapTableView);
uiManager.updateToolbarButtonsStates(Zone.OUTPUTS);
process.removeUniqueConnectionName(outputTable.getUniqueName());
uiManager.refreshSqlExpression();
}
}
}
use of org.talend.core.model.process.IProcess in project tdi-studio-se by Talend.
the class DesignerCoreService method refreshComponentView.
@Override
public void refreshComponentView(Item item) {
try {
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
IEditorReference[] editors = activePage.getEditorReferences();
for (IEditorReference er : editors) {
IEditorPart part = er.getEditor(false);
if (part instanceof AbstractMultiPageTalendEditor) {
AbstractMultiPageTalendEditor editor = (AbstractMultiPageTalendEditor) part;
CommandStack stack = (CommandStack) editor.getTalendEditor().getAdapter(CommandStack.class);
if (stack != null) {
IProcess process = editor.getProcess();
for (final INode processNode : process.getGraphicalNodes()) {
if (processNode instanceof Node) {
checkRepository((Node) processNode, item, stack);
}
}
}
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
use of org.talend.core.model.process.IProcess in project tdi-studio-se by Talend.
the class UpdateNodeParameterCommand method execute.
@Override
public void execute() {
if (result == null) {
return;
}
Object updateObject = result.getUpdateObject();
if (updateObject == null || (!(updateObject instanceof Node)) || (!(result.getJob() instanceof IProcess))) {
return;
}
// instance of node before might not be good (loaded while check updates needed)
// so get the instance of the node of the current job in this object.
IProcess process = (IProcess) result.getJob();
for (INode node : process.getGraphicalNodes()) {
if (node.getUniqueName().equals(((Node) updateObject).getUniqueName())) {
updateObject = node;
result.setUpdateObject(updateObject);
break;
}
}
IUpdateItemType updateType = result.getUpdateType();
if (updateType instanceof EUpdateItemType) {
switch((EUpdateItemType) updateType) {
case NODE_PROPERTY:
updateProperty();
break;
case NODE_SCHEMA:
updateSchema();
break;
case NODE_QUERY:
updateQuery();
break;
case NODE_SAP_FUNCTION:
updateSAPParameters();
break;
case NODE_SAP_IDOC:
updateSAPIDocParameters();
break;
case NODE_VALIDATION_RULE:
updateValidationRule();
break;
default:
return;
}
}
// else { // for extension
Node node = (Node) updateObject;
if (node.getProcess() instanceof IProcess2) {
PropertyChangeCommand pcc = new PropertyChangeCommand(node, EParameterName.UPDATE_COMPONENTS.getName(), Boolean.TRUE);
boolean executed = false;
if (process instanceof IGEFProcess) {
IDesignerCoreUIService designerCoreUIService = CoreUIPlugin.getDefault().getDesignerCoreUIService();
if (designerCoreUIService != null) {
executed = designerCoreUIService.executeCommand((IGEFProcess) process, pcc);
}
}
if (!executed) {
pcc.execute();
}
}
}
use of org.talend.core.model.process.IProcess in project tdi-studio-se by Talend.
the class DbGenerationManager method getContextList.
protected List<String> getContextList(DbMapComponent component) {
List<String> contextList = new ArrayList<String>();
IProcess process = component.getProcess();
IContext context = process.getContextManager().getDefaultContext();
List<IContextParameter> paraList = context.getContextParameterList();
for (IContextParameter para : paraList) {
contextList.add(ContextParameterUtils.JAVA_NEW_CONTEXT_PREFIX + para.getName());
}
return contextList;
}
use of org.talend.core.model.process.IProcess in project tdi-studio-se by Talend.
the class MapperManager method removeRejectOutput.
public void removeRejectOutput() {
List<DataMapTableView> outputsTablesView = uiManager.getOutputsTablesView();
Iterator<DataMapTableView> iterator = outputsTablesView.iterator();
DataMapTableView outputTable = null;
DataMapTableView toRemove = null;
while (iterator.hasNext()) {
outputTable = iterator.next();
if (outputTable.getDataMapTable() instanceof OutputTable && ((OutputTable) outputTable.getDataMapTable()).isErrorRejectTable()) {
toRemove = outputTable;
iterator.remove();
break;
}
}
if (toRemove != null) {
uiManager.removeOutputTableView(toRemove);
uiManager.updateToolbarButtonsStates(Zone.OUTPUTS);
IProcess process = getAbstractMapComponent().getProcess();
process.removeUniqueConnectionName(toRemove.getDataMapTable().getName());
}
}
Aggregations