use of org.talend.designer.core.ui.editor.AbstractTalendEditor in project tdi-studio-se by Talend.
the class DesignerColorsPreferencePage method switchToCurrentColor.
/**
* zli Comment method "switchToCurrentColor".
*/
private void switchToCurrentColor() {
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (activeWorkbenchWindow != null) {
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
if (activePage != null) {
for (IEditorReference ref : activePage.getEditorReferences()) {
IEditorPart editor = ref.getEditor(true);
if (editor instanceof AbstractMultiPageTalendEditor) {
AbstractMultiPageTalendEditor pageEditor = (AbstractMultiPageTalendEditor) editor;
AbstractTalendEditor talendEditor = pageEditor.getTalendEditor();
ProcessPart processPart = talendEditor.getProcessPart();
processPart.ajustReadOnly();
changeMRGroupColor(processPart);
}
}
}
}
}
use of org.talend.designer.core.ui.editor.AbstractTalendEditor in project tdi-studio-se by Talend.
the class StatsAndLogsView method createStatsAndLogsView.
/**
* ftang Comment method "createStatsAndLogsView".
*
*/
public void createStatsAndLogsView() {
IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
AbstractTalendEditor talendEditor = ((AbstractMultiPageTalendEditor) activeEditor).getTalendEditor();
createFullPartControl(this.parent, (Process) talendEditor.getProcess());
}
use of org.talend.designer.core.ui.editor.AbstractTalendEditor in project tdi-studio-se by Talend.
the class StatsAndLogsView method getCurrentJob.
/**
* Gets current opened job.
*/
private void getCurrentJob() {
final IEditorPart activeEditor = getSite().getPage().getActiveEditor();
if (activeEditor != null && activeEditor instanceof AbstractMultiPageTalendEditor) {
AbstractTalendEditor talendEditor = ((AbstractMultiPageTalendEditor) activeEditor).getTalendEditor();
Process process = (Process) talendEditor.getProcess();
if (process != null) {
this.process = process;
this.title = talendEditor.getTitle();
}
}
}
use of org.talend.designer.core.ui.editor.AbstractTalendEditor in project tdi-studio-se by Talend.
the class DynamicTabbedPropertySection method getCommandStack.
/**
* Get the command stack of the Gef editor.
*
* @return
*/
protected CommandStack getCommandStack() {
AbstractTalendEditor talendEditor = part.getTalendEditor();
Object adapter = talendEditor.getAdapter(CommandStack.class);
return (CommandStack) adapter;
}
use of org.talend.designer.core.ui.editor.AbstractTalendEditor in project tdi-studio-se by Talend.
the class ComponentListController method updateComponentList.
protected static void updateComponentList(Collection<INode> nodeList, INode currentNode, IElementParameter param, boolean isSelectDefaultItem) {
final Collection<String> componentDisplayNames = new ArrayList<String>();
final Collection<String> componentUniqueNames = new ArrayList<String>();
for (INode node : nodeList) {
if (node.getJobletNode() != null) {
node = node.getJobletNode();
}
final String uniqueName = node.getUniqueName();
if (uniqueName.equals(currentNode.getUniqueName())) {
continue;
}
//$NON-NLS-1$
String displayName = (String) node.getElementParameter("LABEL").getValue();
if (displayName == null) {
displayName = uniqueName;
}
if (displayName.indexOf("__UNIQUE_NAME__") != -1) {
//$NON-NLS-1$
//$NON-NLS-1$
displayName = displayName.replaceAll("__UNIQUE_NAME__", uniqueName);
}
if (!displayName.equals(uniqueName)) {
//$NON-NLS-1$
displayName = uniqueName + " - " + displayName;
}
componentUniqueNames.add(uniqueName);
componentDisplayNames.add(displayName);
}
param.setListItemsDisplayName(componentDisplayNames.toArray(new String[0]));
final String[] componentValueList = componentUniqueNames.toArray(new String[0]);
param.setListItemsValue(componentValueList);
Object value = param.getValue();
if (!componentUniqueNames.contains(value) && isSelectDefaultItem) {
String newValue = null;
if (!param.isDynamicSettings()) {
if (!componentUniqueNames.isEmpty()) {
if (value == null || value.equals("")) {
//$NON-NLS-1$
currentNode.setPropertyValue(getParameterName(param), componentValueList[0]);
if (currentNode instanceof IGraphicalNode) {
IGraphicalNode node = (IGraphicalNode) currentNode;
node.checkAndRefreshNode();
((IProcess2) node.getProcess()).setProcessModified(true);
} else if (currentNode instanceof IConnection) {
((IProcess2) ((IConnection) currentNode).getSource().getProcess()).setProcessModified(true);
}
} else {
newValue = componentValueList[0];
}
} else {
// removed the old value.
//$NON-NLS-1$
newValue = "";
}
}
if (!("".equals(newValue)) && newValue != null) {
//$NON-NLS-1$
IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (part instanceof AbstractMultiPageTalendEditor) {
AbstractTalendEditor te = ((AbstractMultiPageTalendEditor) part).getTalendEditor();
CommandStack cmdStack = (CommandStack) te.getAdapter(CommandStack.class);
cmdStack.execute(new PropertyChangeCommand(currentNode, getParameterName(param), ""));
}
}
}
}
Aggregations