use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class DesignerCoreService method refreshComponentView.
@Override
public void refreshComponentView() {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart view = page.findView(ComponentSettingsView.ID);
if (view == null) {
// don't do anything. before it made the view appear for nothing even in other product like DQ.
return;
}
if (view != null && view instanceof ComponentSettingsView) {
ComponentSettingsView settingView = (ComponentSettingsView) view;
Element element = settingView.getElement();
if (element != null) {
settingView.cleanDisplay();
settingView.setElement(element);
}
}
List<ComponentSettingsView> otherViews = JobTemplateViewsAndProcessUtil.getInstance().getAllViews();
if (otherViews == null || otherViews.isEmpty()) {
return;
}
for (ComponentSettingsView v : otherViews) {
if (v.getParent() != null && !v.getParent().isDisposed()) {
Element elem = v.getElement();
if (elem != null) {
v.cleanDisplay();
v.setElement(elem);
}
}
}
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class ShowDesignerPageAction method run.
@Override
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
IEditorPart editorPart = page.getActiveEditor();
if (editorPart instanceof MultiPageTalendEditor) {
((MultiPageTalendEditor) editorPart).showDesignerPage();
}
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class ShowEditorPageAction method run.
@Override
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
IEditorPart editorPart = page.getActiveEditor();
if (editorPart instanceof MultiPageTalendEditor) {
((MultiPageTalendEditor) editorPart).showCodePage();
}
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class ShowJobSettingsViewAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
page.showView(getViewId());
JobSettingsView view = (JobSettingsView) page.findView(getViewId());
IDiagramModelService service = CorePlugin.getDefault().getDiagramModelService();
ISelection selection = service.getBusinessEditorSelection(page.getActiveEditor());
if (selection instanceof IStructuredSelection) {
Object firstElement = ((IStructuredSelection) selection).getFirstElement();
if (firstElement != null) {
BusinessType type = service.getBusinessModelType(firstElement);
if (type == BusinessType.CONNECTION || type == BusinessType.NOTE || type == BusinessType.SHAP) {
view.refresh(false, firstElement);
} else if (type == BusinessType.PROCESS || service.isInstanceOfCompartmentEditPart(firstElement)) {
view.refresh(false, PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor());
}
}
}
} catch (PartInitException e) {
// e.printStackTrace();
ExceptionHandler.process(e);
}
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class JobletUtil method needReadOnlyJoblet.
public boolean needReadOnlyJoblet(JobletProcessItem jobletItem) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart[] editors = page.getEditors();
for (IEditorPart editor : editors) {
if (editor instanceof AbstractMultiPageTalendEditor) {
List<? extends INode> nodeList = ((AbstractMultiPageTalendEditor) editor).getProcess().getGraphicalNodes();
for (INode node : nodeList) {
if (((Node) node).isJoblet() && jobletItem.getProperty() != null) {
if (jobletItem.getProperty().getId().equals(node.getComponent().getProcess().getId())) {
boolean haveLock = jobletItem.getState().isLocked();
boolean isSvn = false;
ISVNProviderService service = null;
if (PluginChecker.isSVNProviderPluginLoaded()) {
service = (ISVNProviderService) GlobalServiceRegister.getDefault().getService(ISVNProviderService.class);
}
if (service != null && service.isProjectInSvnMode()) {
isSvn = service.isProjectInSvnMode();
}
if (isSvn) {
IProxyRepositoryService proxyService = (IProxyRepositoryService) GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
IProxyRepositoryFactory factory = proxyService.getProxyRepositoryFactory();
ERepositoryStatus repositoryStatus = factory.getStatus(jobletItem);
if (repositoryStatus == ERepositoryStatus.LOCK_BY_USER) {
haveLock = true;
}
}
if (haveLock) {
return true;
}
}
}
}
}
}
return false;
}
Aggregations