return getElementType().isVirtualObject();
}
public void navigate(boolean requestFocus) {
if (isValid()) {
OpenFileDescriptor descriptor = (OpenFileDescriptor) EditSourceUtil.getDescriptor(this);
if (descriptor != null) {
VirtualFile virtualFile = getFile().getVirtualFile();
FileEditorManager editorManager = FileEditorManager.getInstance(getProject());
if (virtualFile != null) {
if (virtualFile instanceof SourceCodeFile) {
SourceCodeFile sourceCodeFile = (SourceCodeFile) virtualFile;
DatabaseEditableObjectFile databaseFile = sourceCodeFile.getDatabaseFile();
if (!editorManager.isFileOpen(databaseFile)) {
editorManager.openFile(databaseFile, requestFocus);
}
BasicTextEditor textEditor = EditorUtil.getFileEditor(databaseFile, virtualFile);
descriptor.navigateIn(textEditor.getEditor());
return;
}
Editor editor = editorManager.getSelectedTextEditor();
if (editor != null && virtualFile == DocumentUtil.getVirtualFile(editor)) {
super.navigate(requestFocus);
return;
}
FileEditor[] fileEditors = editorManager.getSelectedEditors();
for (FileEditor fileEditor : fileEditors) {
if (fileEditor instanceof DDLFileEditor) {
DDLFileEditor textEditor = (DDLFileEditor) fileEditor;
if (textEditor.getVirtualFile() == virtualFile) {
descriptor.navigateIn(textEditor.getEditor());
return;
}
}
}