use of com.amalto.workbench.editors.XObjectBrowser in project tmdm-studio-se by Talend.
the class ImportItemsWizard method closeOpenEditors.
private void closeOpenEditors() {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
int length = page.getEditors().length;
String tabEndpointAddress = Messages.ImportItemsWizard_3;
String unserName = null;
int j = 0;
for (int i = 0; i < length; i++) {
IEditorPart part = page.getEditors()[i - j];
if (part instanceof XObjectBrowser) {
TreeObject obj = (TreeObject) ((XObjectBrowserInput) part.getEditorInput()).getModel();
if (obj != null) {
tabEndpointAddress = obj.getEndpointAddress();
unserName = obj.getUsername();
}
} else if (part instanceof XObjectEditor) {
TreeObject obj = (TreeObject) ((XObjectEditorInput) part.getEditorInput()).getModel();
if (obj != null) {
tabEndpointAddress = obj.getEndpointAddress();
unserName = obj.getUsername();
}
}
if (serverRoot != null) {
if (serverRoot.getEndpointAddress().equals(tabEndpointAddress) && serverRoot.getUsername().equals(unserName)) {
if (part.isDirty() && isSaveModifiedEditor(part.getTitle())) {
part.doSave(new NullProgressMonitor());
}
page.closeEditor(part, false);
j++;
}
}
}
}
Aggregations