Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
7d0ff25c
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,发现更多精彩内容 >>
提交
7d0ff25c
编写于
5月 27, 2018
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#3292 Procedure bodies compare
上级
33e80134
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
64 addition
and
38 deletion
+64
-38
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/compare/CompareObjectsExecutor.java
...g/jkiss/dbeaver/tools/compare/CompareObjectsExecutor.java
+19
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/compare/CompareObjectsPageSettings.java
...iss/dbeaver/tools/compare/CompareObjectsPageSettings.java
+9
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/compare/CompareObjectsSettings.java
...g/jkiss/dbeaver/tools/compare/CompareObjectsSettings.java
+31
-36
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/compare/CompareReportRenderer.java
...rg/jkiss/dbeaver/tools/compare/CompareReportRenderer.java
+3
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBConstants.java
...beaver.model/src/org/jkiss/dbeaver/model/DBConstants.java
+2
-0
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/compare/CompareObjectsExecutor.java
浏览文件 @
7d0ff25c
...
...
@@ -19,6 +19,7 @@ package org.jkiss.dbeaver.tools.compare;
import
org.eclipse.core.runtime.IStatus
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.DBConstants
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBPNamedObject
;
import
org.jkiss.dbeaver.model.DBPSystemObject
;
...
...
@@ -225,6 +226,7 @@ public class CompareObjectsExecutor {
break
;
}
}
boolean
compareScripts
=
compareLazyProperties
&&
settings
.
isCompareScripts
();
compareLazyProperties
=
compareLazyProperties
&&
settings
.
isCompareLazyProperties
();
// Load all properties
...
...
@@ -238,8 +240,24 @@ public class CompareObjectsExecutor {
nodeProperties
=
new
IdentityHashMap
<>();
propertyValues
.
put
(
databaseObject
,
nodeProperties
);
}
PropertyCollector
propertySource
=
new
PropertyCollector
(
databaseObject
,
compareLazyProperties
);
PropertyCollector
propertySource
=
new
PropertyCollector
(
databaseObject
,
compareLazyProperties
||
compareScripts
);
for
(
ObjectPropertyDescriptor
prop
:
properties
)
{
if
(
prop
.
isLazy
())
{
if
(!
compareLazyProperties
)
{
if
(
compareScripts
)
{
// Only DBPScriptObject methods
if
(!
prop
.
getId
().
equals
(
DBConstants
.
PARAM_OBJECT_DEFINITION_TEXT
)
&&
!
prop
.
getId
().
equals
(
DBConstants
.
PARAM_EXTENDED_DEFINITION_TEXT
))
{
continue
;
}
}
else
{
continue
;
}
}
}
else
{
if
(
prop
.
isHidden
())
{
continue
;
}
}
Object
propertyValue
=
propertySource
.
getPropertyValue
(
monitor
,
databaseObject
,
prop
);
synchronized
(
PROPS_LOCK
)
{
if
(
propertyValue
instanceof
DBPNamedObject
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/compare/CompareObjectsPageSettings.java
浏览文件 @
7d0ff25c
...
...
@@ -33,6 +33,7 @@ class CompareObjectsPageSettings extends ActiveWizardPage<CompareObjectsWizard>
private
Button
skipSystemObjects
;
private
Button
compareLazyProperties
;
private
Button
compareOnlyStructure
;
private
Button
compareScriptProperties
;
CompareObjectsPageSettings
()
{
super
(
"Compare objects"
);
...
...
@@ -105,6 +106,14 @@ class CompareObjectsPageSettings extends ActiveWizardPage<CompareObjectsWizard>
settings
.
setCompareOnlyStructure
(
compareOnlyStructure
.
getSelection
());
}
});
compareScriptProperties
=
UIUtils
.
createCheckbox
(
compareSettings
,
"Compare scripts/procedures"
,
settings
.
isCompareScripts
());
compareScriptProperties
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
settings
.
setCompareScripts
(
compareScriptProperties
.
getSelection
());
}
});
}
setControl
(
composite
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/compare/CompareObjectsSettings.java
浏览文件 @
7d0ff25c
...
...
@@ -32,13 +32,11 @@ public class CompareObjectsSettings {
FILE
(
"Save to file"
);
private
final
String
title
;
private
OutputType
(
String
title
)
{
private
OutputType
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getTitle
()
{
public
String
getTitle
()
{
return
title
;
}
}
...
...
@@ -47,82 +45,76 @@ public class CompareObjectsSettings {
private
boolean
skipSystemObjects
=
true
;
private
boolean
compareLazyProperties
=
false
;
private
boolean
compareOnlyStructure
=
false
;
private
boolean
compareScripts
=
false
;
private
boolean
showOnlyDifferences
=
false
;
private
OutputType
outputType
=
OutputType
.
BROWSER
;
private
String
outputFolder
=
DialogUtils
.
getCurDialogFolder
();
public
CompareObjectsSettings
(
List
<
DBNDatabaseNode
>
nodes
)
{
public
CompareObjectsSettings
(
List
<
DBNDatabaseNode
>
nodes
)
{
this
.
nodes
=
nodes
;
}
public
List
<
DBNDatabaseNode
>
getNodes
()
{
public
List
<
DBNDatabaseNode
>
getNodes
()
{
return
nodes
;
}
public
boolean
isSkipSystemObjects
()
{
public
boolean
isSkipSystemObjects
()
{
return
skipSystemObjects
;
}
public
void
setSkipSystemObjects
(
boolean
skipSystemObjects
)
{
public
void
setSkipSystemObjects
(
boolean
skipSystemObjects
)
{
this
.
skipSystemObjects
=
skipSystemObjects
;
}
public
boolean
isCompareLazyProperties
()
{
public
boolean
isCompareLazyProperties
()
{
return
compareLazyProperties
;
}
public
void
setCompareLazyProperties
(
boolean
compareLazyProperties
)
{
public
void
setCompareLazyProperties
(
boolean
compareLazyProperties
)
{
this
.
compareLazyProperties
=
compareLazyProperties
;
}
public
boolean
isCompareOnlyStructure
()
{
public
boolean
isCompareOnlyStructure
()
{
return
compareOnlyStructure
;
}
public
void
setCompareOnlyStructure
(
boolean
compareOnlyStructure
)
{
public
void
setCompareOnlyStructure
(
boolean
compareOnlyStructure
)
{
this
.
compareOnlyStructure
=
compareOnlyStructure
;
}
public
boolean
isShowOnlyDifferences
()
{
public
boolean
isCompareScripts
()
{
return
compareScripts
;
}
public
void
setCompareScripts
(
boolean
compareScripts
)
{
this
.
compareScripts
=
compareScripts
;
}
public
boolean
isShowOnlyDifferences
()
{
return
showOnlyDifferences
;
}
public
void
setShowOnlyDifferences
(
boolean
showOnlyDifferences
)
{
public
void
setShowOnlyDifferences
(
boolean
showOnlyDifferences
)
{
this
.
showOnlyDifferences
=
showOnlyDifferences
;
}
public
OutputType
getOutputType
()
{
public
OutputType
getOutputType
()
{
return
outputType
;
}
public
void
setOutputType
(
OutputType
outputType
)
{
public
void
setOutputType
(
OutputType
outputType
)
{
this
.
outputType
=
outputType
;
}
public
String
getOutputFolder
()
{
public
String
getOutputFolder
()
{
return
outputFolder
;
}
public
void
setOutputFolder
(
String
outputFolder
)
{
public
void
setOutputFolder
(
String
outputFolder
)
{
this
.
outputFolder
=
outputFolder
;
}
void
loadFrom
(
IDialogSettings
dialogSettings
)
{
void
loadFrom
(
IDialogSettings
dialogSettings
)
{
if
(
dialogSettings
.
get
(
"skipSystem"
)
!=
null
)
{
skipSystemObjects
=
dialogSettings
.
getBoolean
(
"skipSystem"
);
}
...
...
@@ -135,6 +127,9 @@ public class CompareObjectsSettings {
if
(
dialogSettings
.
get
(
"showDifference"
)
!=
null
)
{
showOnlyDifferences
=
dialogSettings
.
getBoolean
(
"showDifference"
);
}
if
(
dialogSettings
.
get
(
"compareScripts"
)
!=
null
)
{
compareScripts
=
dialogSettings
.
getBoolean
(
"compareScripts"
);
}
if
(
dialogSettings
.
get
(
"outputType"
)
!=
null
)
{
outputType
=
OutputType
.
valueOf
(
dialogSettings
.
get
(
"outputType"
));
}
...
...
@@ -143,11 +138,11 @@ public class CompareObjectsSettings {
}
}
void
saveTo
(
IDialogSettings
dialogSettings
)
{
void
saveTo
(
IDialogSettings
dialogSettings
)
{
dialogSettings
.
put
(
"skipSystem"
,
skipSystemObjects
);
dialogSettings
.
put
(
"compareLazy"
,
compareLazyProperties
);
dialogSettings
.
put
(
"compareStructure"
,
compareOnlyStructure
);
dialogSettings
.
put
(
"compareScripts"
,
compareScripts
);
dialogSettings
.
put
(
"showDifference"
,
showOnlyDifferences
);
dialogSettings
.
put
(
"outputType"
,
outputType
.
name
());
dialogSettings
.
put
(
"outputFolder"
,
outputFolder
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/compare/CompareReportRenderer.java
浏览文件 @
7d0ff25c
...
...
@@ -108,7 +108,7 @@ public class CompareReportRenderer {
styles
.
append
(
"table {font-family:\"Lucida Sans Unicode\", \"Lucida Grande\", Sans-Serif;font-size:12px;text-align:left;} "
);
styles
.
append
(
".missing {color:red;} .differs {color:red;} "
);
styles
.
append
(
".object td,th {border-top:solid 1px; border-right:solid 1px; border-color: black; white-space:nowrap;} "
);
styles
.
append
(
".property td,th {border-right:solid 1px; border-color: black; white-space:pre; } "
);
styles
.
append
(
".property td,th {border-
top:dashed 1px; border-
right:solid 1px; border-color: black; white-space:pre; } "
);
styles
.
append
(
".struct {border-top:none; !important } "
);
// styles.append(".object:first-child {border:none; } ");
// styles.append(".property:first-child {border:none; } ");
...
...
@@ -152,6 +152,7 @@ public class CompareReportRenderer {
xml
.
startElement
(
"tr"
);
xml
.
addAttribute
(
"class"
,
"object level"
+
line
.
depth
);
xml
.
addAttribute
(
"valign"
,
"top"
);
xml
.
startElement
(
"td"
);
xml
.
addText
(
line
.
structure
.
getNodeType
());
xml
.
endElement
();
...
...
@@ -206,6 +207,7 @@ public class CompareReportRenderer {
}
xml
.
startElement
(
"tr"
);
xml
.
addAttribute
(
"class"
,
"property level"
+
(
line
.
depth
+
1
)
+
(
differs
?
" differs"
:
""
));
xml
.
addAttribute
(
"valign"
,
"top"
);
xml
.
startElement
(
"td"
);
xml
.
addText
(
reportProperty
.
property
.
getDisplayName
());
xml
.
endElement
();
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBConstants.java
浏览文件 @
7d0ff25c
...
...
@@ -46,6 +46,8 @@ public class DBConstants {
public
static
final
String
PROP_ID_MAX_LENGTH
=
"maxLength"
;
//NON-NLS-1
public
static
final
String
PROP_ID_NOT_NULL
=
"notNull"
;
//NON-NLS-1
public
static
final
String
PARAM_INIT_ON_TEST
=
"initOnTest"
;
//NON-NLS-1
public
static
final
String
PARAM_OBJECT_DEFINITION_TEXT
=
"objectDefinitionText"
;
//NON-NLS-1
public
static
final
String
PARAM_EXTENDED_DEFINITION_TEXT
=
"extendedDefinitionText"
;
//NON-NLS-1
// Internal properties prefix. This is a legacy properties marker (used to divide driver properties from provider properties)
// Left for backward compatibility. Do not use it for new provider property names
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录