use of org.talend.core.views.IComponentSettingsView in project tdi-studio-se by Talend.
the class AbstractMultiPageTalendEditor method turnToCodePage.
protected void turnToCodePage(int newPageIndex) {
// TDI-25866:In case select a component and switch to the code page,need clean its componentSetting view
IComponentSettingsView viewer = (IComponentSettingsView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IComponentSettingsView.ID);
if (viewer != null) {
viewer.cleanDisplay();
}
if (codeEditor instanceof ISyntaxCheckableEditor) {
moveCursorToSelectedComponent();
/*
* Belowing method had been called at line 331 within the generateCode method, as soon as code generated.
*/
// ((ISyntaxCheckableEditor) codeEditor).validateSyntax();
}
codeSync();
// updateCodeEditorContent();
changeContextsViewStatus(true);
}
use of org.talend.core.views.IComponentSettingsView in project tdi-studio-se by Talend.
the class AbstractTalendEditor method setFocus.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.ui.parts.GraphicalEditor#setFocus()
*/
@Override
public void setFocus() {
IComponentSettingsView viewer = (IComponentSettingsView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IComponentSettingsView.ID);
if (viewer != null) {
IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
if (selection.size() == 1 && (selection.getFirstElement() instanceof NodePart || selection.getFirstElement() instanceof ConnectionPart || selection.getFirstElement() instanceof SubjobContainerPart || selection.getFirstElement() instanceof ConnLabelEditPart)) {
viewer.setElement((Element) ((AbstractEditPart) selection.getFirstElement()).getModel());
} else {
viewer.cleanDisplay();
}
}
JobSettings.switchToCurJobSettingsView();
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
ITestContainerProviderService testContainerService = (ITestContainerProviderService) GlobalServiceRegister.getDefault().getService(ITestContainerProviderService.class);
if (testContainerService != null) {
testContainerService.switchToCurTestContainerView();
}
}
super.setFocus();
if (!readOnly) {
// When gain focus, check read-only to disable read-only mode if process has been restore while opened :
// 1. Enabled/disabled components :
// process.checkReadOnly();
// 2. Set backgroung color :
List children = getViewer().getRootEditPart().getChildren();
if (!children.isEmpty()) {
ProcessPart rep = (ProcessPart) children.get(0);
rep.ajustReadOnly();
}
}
}
use of org.talend.core.views.IComponentSettingsView in project tdi-studio-se by Talend.
the class CodeGeneratorService method refreshTemplates.
/*
* (non-Javadoc)
*
* @see org.talend.designer.codegen.ICodeGeneratorService#refreshTemplates()
*/
@Override
public Job refreshTemplates() {
Element oldComponent = null;
IComponentSettingsView viewer = null;
if (!CommonUIPlugin.isFullyHeadless()) {
// TDI-25866:In case select a component and sctrl+shift+f3,need clean its componentSetting view
IWorkbenchWindow wwindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (wwindow != null && wwindow.getActivePage() != null) {
viewer = (IComponentSettingsView) wwindow.getActivePage().findView(IComponentSettingsView.ID);
if (viewer != null) {
oldComponent = viewer.getElement();
viewer.cleanDisplay();
}
}
}
ComponentCompilations.deleteMarkers();
ComponentsFactoryProvider.getInstance().resetCache();
ILibraryManagerService librairesManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
librairesManagerService.clearCache();
CorePlugin.getDefault().getLibrariesService().syncLibraries();
Job job = CodeGeneratorEmittersPoolFactory.initialize();
// achen modify to record ctrl+shift+f3 is pressed to fix bug 0006107
IDesignerCoreService designerCoreService = (IDesignerCoreService) GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
designerCoreService.getLastGeneratedJobsDateMap().clear();
if (oldComponent != null && viewer != null) {
viewer.setElement(oldComponent);
}
if (!CommonUIPlugin.isFullyHeadless()) {
CorePlugin.getDefault().getDesignerCoreService().synchronizeDesignerUI(new PropertyChangeEvent(this, IComponentConstants.NORMAL, null, null));
}
return job;
}
Aggregations