Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
09a7a1a5
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
09a7a1a5
编写于
6月 21, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Error editor input fixed.
上级
ae85993a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
61 addition
and
29 deletion
+61
-29
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/jobs/ConnectJob.java
...r.core/src/org/jkiss/dbeaver/runtime/jobs/ConnectJob.java
+14
-6
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceConnectHandler.java
...eaver/ui/actions/datasource/DataSourceConnectHandler.java
+6
-8
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorInput.java
...src/org/jkiss/dbeaver/ui/editors/DatabaseEditorInput.java
+23
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorUtils.java
...src/org/jkiss/dbeaver/ui/editors/DatabaseEditorUtils.java
+3
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/IDatabaseEditorInput.java
...rc/org/jkiss/dbeaver/ui/editors/IDatabaseEditorInput.java
+2
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/entity/EntityEditor.java
...src/org/jkiss/dbeaver/ui/editors/entity/EntityEditor.java
+5
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/entity/EntityEditorPropertyTester.java
...dbeaver/ui/editors/entity/EntityEditorPropertyTester.java
+8
-6
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/jobs/ConnectJob.java
浏览文件 @
09a7a1a5
...
...
@@ -27,7 +27,7 @@ import org.jkiss.dbeaver.model.DBPConnectionEventType;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.registry.DataSourceDescriptor
;
import
org.jkiss.dbeaver.runtime.AbstractJob
;
import
org.jkiss.dbeaver.
ui.UI
Utils
;
import
org.jkiss.dbeaver.
runtime.Runtime
Utils
;
/**
* Connect job
...
...
@@ -36,6 +36,7 @@ public class ConnectJob extends EventProcessorJob
{
private
volatile
Thread
connectThread
;
private
boolean
reflect
=
true
;
private
IStatus
connectStatus
;
public
ConnectJob
(
DataSourceDescriptor
container
)
...
...
@@ -45,6 +46,10 @@ public class ConnectJob extends EventProcessorJob
setProperty
(
IProgressConstants
.
ICON_PROPERTY
,
ImageDescriptor
.
createFromImage
(
container
.
getDriver
().
getIcon
()));
}
public
IStatus
getConnectStatus
()
{
return
connectStatus
;
}
@Override
protected
IStatus
run
(
DBRProgressMonitor
monitor
)
{
...
...
@@ -67,13 +72,16 @@ public class ConnectJob extends EventProcessorJob
}
processEvents
(
DBPConnectionEventType
.
AFTER_CONNECT
);
connectStatus
=
Status
.
OK_STATUS
;
}
catch
(
Throwable
ex
)
{
UIUtils
.
showErrorDialog
(
null
,
NLS
.
bind
(
CoreMessages
.
runtime_jobs_connect_status_error
,
container
.
getName
()),
null
,
ex
);
connectStatus
=
RuntimeUtils
.
makeExceptionStatus
(
ex
);
// UIUtils.showErrorDialog(
// null,
// NLS.bind(CoreMessages.runtime_jobs_connect_status_error, container.getName()),
// null,
// ex);
}
return
Status
.
OK_STATUS
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceConnectHandler.java
浏览文件 @
09a7a1a5
...
...
@@ -98,24 +98,22 @@ public class DataSourceConnectHandler extends DataSourceHandler
}
};
if
(
monitor
!=
null
)
{
final
IStatus
result
=
connectJob
.
runSync
(
monitor
);
connectJob
.
runSync
(
monitor
);
final
IStatus
result
=
connectJob
.
getConnectStatus
();
jobChangeAdapter
.
done
(
new
IJobChangeEvent
()
{
@Override
public
long
getDelay
()
{
public
long
getDelay
()
{
return
0
;
}
@Override
public
Job
getJob
()
{
public
Job
getJob
()
{
return
connectJob
;
}
@Override
public
IStatus
getResult
()
{
return
result
;
public
IStatus
getResult
()
{
return
connectJob
.
getConnectStatus
();
}
});
if
(!
result
.
isOK
())
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorInput.java
浏览文件 @
09a7a1a5
...
...
@@ -22,13 +22,16 @@ import org.eclipse.ui.IMemento;
import
org.eclipse.ui.IPersistableElement
;
import
org.eclipse.ui.model.IWorkbenchAdapter
;
import
org.eclipse.ui.model.WorkbenchAdapter
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBeaverPreferences
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBPPropertySource
;
import
org.jkiss.dbeaver.model.IDataSourceContainerProvider
;
import
org.jkiss.dbeaver.model.edit.DBECommandContext
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.edit.DBECommandContextImpl
;
import
org.jkiss.dbeaver.model.navigator.DBNDataSource
;
import
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode
;
import
org.jkiss.dbeaver.model.struct.DBSDataSourceContainer
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
...
...
@@ -57,12 +60,18 @@ public abstract class DatabaseEditorInput<NODE extends DBNDatabaseNode> implemen
protected
DatabaseEditorInput
(
NODE
node
,
DBECommandContext
commandContext
)
{
this
.
node
=
node
;
this
.
executionContext
=
node
.
getDataSource
().
getDefaultContext
(
false
);
this
.
commandContext
=
commandContext
!=
null
?
commandContext
:
new
DBECommandContextImpl
(
this
.
executionContext
,
false
);
DBPDataSource
dataSource
=
node
.
getDataSource
();
if
(
dataSource
!=
null
)
{
this
.
executionContext
=
dataSource
.
getDefaultContext
(
false
);
this
.
commandContext
=
commandContext
!=
null
?
commandContext
:
new
DBECommandContextImpl
(
this
.
executionContext
,
false
);
}
else
{
this
.
executionContext
=
null
;
this
.
commandContext
=
null
;
}
}
@Override
...
...
@@ -125,7 +134,13 @@ public abstract class DatabaseEditorInput<NODE extends DBNDatabaseNode> implemen
@Override
public
DBSDataSourceContainer
getDataSourceContainer
()
{
return
executionContext
.
getDataSource
().
getContainer
();
if
(
executionContext
!=
null
)
{
return
executionContext
.
getDataSource
().
getContainer
();
}
else
if
(
node
instanceof
DBNDataSource
)
{
return
node
.
getDataSourceContainer
();
}
else
{
return
null
;
}
}
@Override
...
...
@@ -157,6 +172,7 @@ public abstract class DatabaseEditorInput<NODE extends DBNDatabaseNode> implemen
return
defaultFolderId
;
}
@Nullable
@Override
public
DBECommandContext
getCommandContext
()
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorUtils.java
浏览文件 @
09a7a1a5
...
...
@@ -53,7 +53,9 @@ public class DatabaseEditorUtils {
}
}
else
if
(
editor
instanceof
DBPContextProvider
)
{
DBCExecutionContext
context
=
((
DBPContextProvider
)
editor
).
getExecutionContext
();
bgColor
=
context
.
getDataSource
().
getContainer
().
getConnectionInfo
().
getColor
();
if
(
context
!=
null
)
{
bgColor
=
context
.
getDataSource
().
getContainer
().
getConnectionInfo
().
getColor
();
}
}
if
(
bgColor
==
null
)
{
rootComposite
.
setBackground
(
null
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/IDatabaseEditorInput.java
浏览文件 @
09a7a1a5
...
...
@@ -20,6 +20,7 @@ package org.jkiss.dbeaver.ui.editors;
import
org.eclipse.ui.IEditorInput
;
import
org.eclipse.ui.views.properties.IPropertySource2
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.DBPContextProvider
;
import
org.jkiss.dbeaver.model.DBPPropertySource
;
import
org.jkiss.dbeaver.model.edit.DBECommandContext
;
...
...
@@ -53,6 +54,7 @@ public interface IDatabaseEditorInput extends IEditorInput, DBPContextProvider {
* Command context
* @return command context
*/
@Nullable
DBECommandContext
getCommandContext
();
/**
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/entity/EntityEditor.java
浏览文件 @
09a7a1a5
...
...
@@ -140,6 +140,7 @@ public class EntityEditor extends MultiPageDatabaseEditor
return
getEditorInput
().
getDatabaseObject
();
}
@Nullable
public
DBECommandContext
getCommandContext
()
{
return
getEditorInput
().
getCommandContext
();
...
...
@@ -390,7 +391,10 @@ public class EntityEditor extends MultiPageDatabaseEditor
firePropertyChange
(
IEditorPart
.
PROP_DIRTY
);
}
};
getCommandContext
().
addCommandListener
(
commandListener
);
DBECommandContext
commandContext
=
getCommandContext
();
if
(
commandContext
!=
null
)
{
commandContext
.
addCommandListener
(
commandListener
);
}
// Property listener
addPropertyListener
(
new
IPropertyListener
()
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/entity/EntityEditorPropertyTester.java
浏览文件 @
09a7a1a5
...
...
@@ -45,12 +45,14 @@ public class EntityEditorPropertyTester extends PropertyTester
}
EntityEditor
editor
=
(
EntityEditor
)
receiver
;
DBECommandContext
commandContext
=
editor
.
getEditorInput
().
getCommandContext
();
if
(
property
.
equals
(
PROP_CAN_UNDO
))
{
return
commandContext
.
getUndoCommand
()
!=
null
;
}
else
if
(
property
.
equals
(
PROP_CAN_REDO
))
{
return
commandContext
.
getRedoCommand
()
!=
null
;
}
else
if
(
property
.
equals
(
PROP_DIRTY
))
{
return
commandContext
.
isDirty
();
if
(
commandContext
!=
null
)
{
if
(
property
.
equals
(
PROP_CAN_UNDO
))
{
return
commandContext
.
getUndoCommand
()
!=
null
;
}
else
if
(
property
.
equals
(
PROP_CAN_REDO
))
{
return
commandContext
.
getRedoCommand
()
!=
null
;
}
else
if
(
property
.
equals
(
PROP_DIRTY
))
{
return
commandContext
.
isDirty
();
}
}
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录