Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
efbdc64a
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,发现更多精彩内容 >>
提交
efbdc64a
编写于
8月 14, 2019
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ERD: edit embedded diagrams
上级
d1d999c3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
72 addition
and
36 deletion
+72
-36
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/editor/ERDEditorEmbedded.java
...c/org/jkiss/dbeaver/ext/erd/editor/ERDEditorEmbedded.java
+4
-1
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/model/DiagramLoader.java
...rd/src/org/jkiss/dbeaver/ext/erd/model/DiagramLoader.java
+27
-23
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/content/ContentEditor.java
...c/org/jkiss/dbeaver/ui/editors/content/ContentEditor.java
+2
-2
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/data/AbstractDataEditor.java
...org/jkiss/dbeaver/ui/editors/data/AbstractDataEditor.java
+2
-2
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/EntityEditor.java
...src/org/jkiss/dbeaver/ui/editors/entity/EntityEditor.java
+1
-1
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/IEntityDataEditor.java
...rg/jkiss/dbeaver/ui/editors/entity/IEntityDataEditor.java
+1
-1
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/IEntityStructureEditor.java
...iss/dbeaver/ui/editors/entity/IEntityStructureEditor.java
+26
-0
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/properties/ObjectPropertiesEditor.java
.../ui/editors/entity/properties/ObjectPropertiesEditor.java
+9
-6
未找到文件。
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/editor/ERDEditorEmbedded.java
浏览文件 @
efbdc64a
...
@@ -40,6 +40,7 @@ import org.jkiss.dbeaver.ui.IActiveWorkbenchPart;
...
@@ -40,6 +40,7 @@ import org.jkiss.dbeaver.ui.IActiveWorkbenchPart;
import
org.jkiss.dbeaver.ui.LoadingJob
;
import
org.jkiss.dbeaver.ui.LoadingJob
;
import
org.jkiss.dbeaver.ui.editors.IDatabaseEditor
;
import
org.jkiss.dbeaver.ui.editors.IDatabaseEditor
;
import
org.jkiss.dbeaver.ui.editors.IDatabaseEditorInput
;
import
org.jkiss.dbeaver.ui.editors.IDatabaseEditorInput
;
import
org.jkiss.dbeaver.ui.editors.entity.IEntityStructureEditor
;
import
org.jkiss.dbeaver.utils.RuntimeUtils
;
import
org.jkiss.dbeaver.utils.RuntimeUtils
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.InvocationTargetException
;
...
@@ -48,7 +49,7 @@ import java.util.*;
...
@@ -48,7 +49,7 @@ import java.util.*;
/**
/**
* Embedded ERD editor
* Embedded ERD editor
*/
*/
public
class
ERDEditorEmbedded
extends
ERDEditorPart
implements
IDatabaseEditor
,
IActiveWorkbenchPart
{
public
class
ERDEditorEmbedded
extends
ERDEditorPart
implements
IDatabaseEditor
,
I
EntityStructureEditor
,
I
ActiveWorkbenchPart
{
private
static
final
Log
log
=
Log
.
getLog
(
ERDEditorEmbedded
.
class
);
private
static
final
Log
log
=
Log
.
getLog
(
ERDEditorEmbedded
.
class
);
...
@@ -331,6 +332,8 @@ public class ERDEditorEmbedded extends ERDEditorPart implements IDatabaseEditor,
...
@@ -331,6 +332,8 @@ public class ERDEditorEmbedded extends ERDEditorPart implements IDatabaseEditor,
String
diagramState
=
DiagramLoader
.
serializeDiagram
(
RuntimeUtils
.
makeMonitor
(
monitor
),
getDiagramPart
(),
getDiagram
(),
false
,
true
);
String
diagramState
=
DiagramLoader
.
serializeDiagram
(
RuntimeUtils
.
makeMonitor
(
monitor
),
getDiagramPart
(),
getDiagram
(),
false
,
true
);
diagramStateMap
.
put
(
PROPS_DIAGRAM_SERIALIZED
,
diagramState
);
diagramStateMap
.
put
(
PROPS_DIAGRAM_SERIALIZED
,
diagramState
);
vEntity
.
persistConfiguration
();
getCommandStack
().
markSaveLocation
();
getCommandStack
().
markSaveLocation
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"Error saving diagram"
,
e
);
log
.
error
(
"Error saving diagram"
,
e
);
...
...
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/model/DiagramLoader.java
浏览文件 @
efbdc64a
...
@@ -443,7 +443,7 @@ public class DiagramLoader
...
@@ -443,7 +443,7 @@ public class DiagramLoader
// Save as XML
// Save as XML
StringWriter
out
=
new
StringWriter
(
1000
);
StringWriter
out
=
new
StringWriter
(
1000
);
XMLBuilder
xml
=
new
XMLBuilder
(
out
,
GeneralUtils
.
UTF8_ENCODING
);
XMLBuilder
xml
=
new
XMLBuilder
(
out
,
GeneralUtils
.
UTF8_ENCODING
,
!
compact
);
xml
.
setButify
(!
compact
);
xml
.
setButify
(!
compact
);
if
(
verbose
)
{
if
(
verbose
)
{
xml
.
addContent
(
xml
.
addContent
(
...
@@ -473,7 +473,9 @@ public class DiagramLoader
...
@@ -473,7 +473,9 @@ public class DiagramLoader
if
(
diagram
!=
null
)
{
if
(
diagram
!=
null
)
{
xml
.
addAttribute
(
ATTR_NAME
,
diagram
.
getName
());
xml
.
addAttribute
(
ATTR_NAME
,
diagram
.
getName
());
}
}
xml
.
addAttribute
(
ATTR_TIME
,
RuntimeUtils
.
getCurrentTimeStamp
());
if
(
compact
)
{
xml
.
addAttribute
(
ATTR_TIME
,
RuntimeUtils
.
getCurrentTimeStamp
());
}
if
(
diagram
!=
null
)
{
if
(
diagram
!=
null
)
{
xml
.
startElement
(
TAG_ENTITIES
);
xml
.
startElement
(
TAG_ENTITIES
);
...
@@ -527,31 +529,33 @@ public class DiagramLoader
...
@@ -527,31 +529,33 @@ public class DiagramLoader
}
}
xml
.
endElement
();
xml
.
endElement
();
// Notes
if
(!
CommonUtils
.
isEmpty
(
diagram
.
getNotes
()))
{
xml
.
startElement
(
TAG_NOTES
);
// Notes
for
(
ERDNote
note
:
diagram
.
getNotes
())
{
xml
.
startElement
(
TAG_NOTES
);
NotePart
notePart
=
diagramPart
==
null
?
null
:
diagramPart
.
getNotePart
(
note
);
for
(
ERDNote
note
:
diagram
.
getNotes
())
{
NotePart
notePart
=
diagramPart
==
null
?
null
:
diagramPart
.
getNotePart
(
note
);
xml
.
startElement
(
TAG_NOTE
);
if
(
notePart
!=
null
)
{
xml
.
startElement
(
TAG_NOTE
);
ElementSaveInfo
info
=
new
ElementSaveInfo
(
note
,
notePart
,
elementCounter
++);
if
(
notePart
!=
null
)
{
elementInfoMap
.
put
(
note
,
info
);
ElementSaveInfo
info
=
new
ElementSaveInfo
(
note
,
notePart
,
elementCounter
++);
xml
.
addAttribute
(
ATTR_ID
,
info
.
objectId
);
elementInfoMap
.
put
(
note
,
info
);
xml
.
addAttribute
(
ATTR_ID
,
info
.
objectId
);
saveColorAndOrder
(
allNodeFigures
,
xml
,
notePart
);
saveColorAndOrder
(
allNodeFigures
,
xml
,
notePart
);
Rectangle
noteBounds
=
notePart
.
getBounds
();
if
(
noteBounds
!=
null
)
{
Rectangle
noteBounds
=
notePart
.
getBounds
();
xml
.
addAttribute
(
ATTR_X
,
noteBounds
.
x
);
if
(
noteBounds
!=
null
)
{
xml
.
addAttribute
(
ATTR_Y
,
noteBounds
.
y
);
xml
.
addAttribute
(
ATTR_X
,
noteBounds
.
x
);
xml
.
addAttribute
(
ATTR_W
,
noteBounds
.
width
);
xml
.
addAttribute
(
ATTR_Y
,
noteBounds
.
y
);
xml
.
addAttribute
(
ATTR_H
,
noteBounds
.
height
);
xml
.
addAttribute
(
ATTR_W
,
noteBounds
.
width
);
xml
.
addAttribute
(
ATTR_H
,
noteBounds
.
height
);
}
}
}
xml
.
addText
(
note
.
getObject
());
xml
.
endElement
();
}
}
xml
.
addText
(
note
.
getObject
());
xml
.
endElement
();
xml
.
endElement
();
}
}
xml
.
endElement
();
// Relations
// Relations
xml
.
startElement
(
TAG_RELATIONS
);
xml
.
startElement
(
TAG_RELATIONS
);
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/content/ContentEditor.java
浏览文件 @
efbdc64a
...
@@ -51,7 +51,7 @@ import org.jkiss.dbeaver.ui.data.registry.ValueManagerRegistry;
...
@@ -51,7 +51,7 @@ import org.jkiss.dbeaver.ui.data.registry.ValueManagerRegistry;
import
org.jkiss.dbeaver.ui.dialogs.DialogUtils
;
import
org.jkiss.dbeaver.ui.dialogs.DialogUtils
;
import
org.jkiss.dbeaver.ui.editors.MultiPageAbstractEditor
;
import
org.jkiss.dbeaver.ui.editors.MultiPageAbstractEditor
;
import
org.jkiss.dbeaver.ui.editors.entity.EntityEditor
;
import
org.jkiss.dbeaver.ui.editors.entity.EntityEditor
;
import
org.jkiss.dbeaver.ui.editors.entity.IEntityData
Containe
r
;
import
org.jkiss.dbeaver.ui.editors.entity.IEntityData
Edito
r
;
import
java.io.File
;
import
java.io.File
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.InvocationTargetException
;
...
@@ -265,7 +265,7 @@ public class ContentEditor extends MultiPageAbstractEditor implements IValueEdit
...
@@ -265,7 +265,7 @@ public class ContentEditor extends MultiPageAbstractEditor implements IValueEdit
if
(
parentEditorSite
instanceof
MultiPageEditorSite
)
{
if
(
parentEditorSite
instanceof
MultiPageEditorSite
)
{
parentEditor
=
((
MultiPageEditorSite
)
parentEditorSite
).
getMultiPageEditor
();
parentEditor
=
((
MultiPageEditorSite
)
parentEditorSite
).
getMultiPageEditor
();
if
(
parentEditor
instanceof
EntityEditor
)
{
if
(
parentEditor
instanceof
EntityEditor
)
{
((
EntityEditor
)
parentEditor
).
setActiveEditor
(
IEntityData
Containe
r
.
class
);
((
EntityEditor
)
parentEditor
).
setActiveEditor
(
IEntityData
Edito
r
.
class
);
}
}
}
else
{
}
else
{
parentEditor
=
parentEditorSite
.
getPart
();
parentEditor
=
parentEditorSite
.
getPart
();
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/data/AbstractDataEditor.java
浏览文件 @
efbdc64a
...
@@ -35,7 +35,7 @@ import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
...
@@ -35,7 +35,7 @@ import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import
org.jkiss.dbeaver.model.struct.DBSDataContainer
;
import
org.jkiss.dbeaver.model.struct.DBSDataContainer
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.editors.entity.IEntityData
Containe
r
;
import
org.jkiss.dbeaver.ui.editors.entity.IEntityData
Edito
r
;
import
org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectOpen
;
import
org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectOpen
;
import
org.jkiss.dbeaver.ui.controls.resultset.*
;
import
org.jkiss.dbeaver.ui.controls.resultset.*
;
import
org.jkiss.dbeaver.ui.editors.AbstractDatabaseObjectEditor
;
import
org.jkiss.dbeaver.ui.editors.AbstractDatabaseObjectEditor
;
...
@@ -47,7 +47,7 @@ import java.util.Collections;
...
@@ -47,7 +47,7 @@ import java.util.Collections;
* AbstractDataEditor
* AbstractDataEditor
*/
*/
public
abstract
class
AbstractDataEditor
<
OBJECT_TYPE
extends
DBSObject
>
extends
AbstractDatabaseObjectEditor
<
OBJECT_TYPE
>
public
abstract
class
AbstractDataEditor
<
OBJECT_TYPE
extends
DBSObject
>
extends
AbstractDatabaseObjectEditor
<
OBJECT_TYPE
>
implements
IResultSetContainer
,
IResultSetListener
,
IEntityData
Containe
r
implements
IResultSetContainer
,
IResultSetListener
,
IEntityData
Edito
r
{
{
private
static
final
Log
log
=
Log
.
getLog
(
AbstractDataEditor
.
class
);
private
static
final
Log
log
=
Log
.
getLog
(
AbstractDataEditor
.
class
);
...
...
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/EntityEditor.java
浏览文件 @
efbdc64a
...
@@ -238,7 +238,7 @@ public class EntityEditor extends MultiPageDatabaseEditor
...
@@ -238,7 +238,7 @@ public class EntityEditor extends MultiPageDatabaseEditor
// Flush all nested object editors and result containers
// Flush all nested object editors and result containers
for
(
IEditorPart
editor
:
editorMap
.
values
())
{
for
(
IEditorPart
editor
:
editorMap
.
values
())
{
if
(
editor
instanceof
ObjectPropertiesEditor
||
editor
instanceof
IEntityDataContaine
r
)
{
if
(
editor
instanceof
IEntityStructureEditor
||
editor
instanceof
IEntityDataEdito
r
)
{
if
(
editor
.
isDirty
())
{
if
(
editor
.
isDirty
())
{
editor
.
doSave
(
monitor
);
editor
.
doSave
(
monitor
);
}
}
...
...
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/IEntityData
Containe
r.java
→
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/IEntityData
Edito
r.java
浏览文件 @
efbdc64a
...
@@ -21,6 +21,6 @@ package org.jkiss.dbeaver.ui.editors.entity;
...
@@ -21,6 +21,6 @@ package org.jkiss.dbeaver.ui.editors.entity;
* Entity data container.
* Entity data container.
* Implementors are EntityEditor sub-editors which contain soem data which must be saved before context save.
* Implementors are EntityEditor sub-editors which contain soem data which must be saved before context save.
*/
*/
public
interface
IEntityData
Containe
r
{
public
interface
IEntityData
Edito
r
{
}
}
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/IEntityStructureEditor.java
0 → 100644
浏览文件 @
efbdc64a
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ui.editors.entity
;
/**
* Entity structure editor.
* Implementors are EntityEditor sub-editors which contain soem data which must be saved before context save.
*/
public
interface
IEntityStructureEditor
{
}
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/properties/ObjectPropertiesEditor.java
浏览文件 @
efbdc64a
...
@@ -33,8 +33,7 @@ import org.jkiss.dbeaver.DBException;
...
@@ -33,8 +33,7 @@ import org.jkiss.dbeaver.DBException;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.navigator.*
;
import
org.jkiss.dbeaver.model.navigator.*
;
import
org.jkiss.dbeaver.ui.editors.*
;
import
org.jkiss.dbeaver.ui.editors.*
;
import
org.jkiss.dbeaver.ui.editors.entity.EntityEditorDescriptor
;
import
org.jkiss.dbeaver.ui.editors.entity.*
;
import
org.jkiss.dbeaver.ui.editors.entity.EntityEditorsRegistry
;
import
org.jkiss.dbeaver.ui.internal.UINavigatorMessages
;
import
org.jkiss.dbeaver.ui.internal.UINavigatorMessages
;
import
org.jkiss.dbeaver.model.DBIcon
;
import
org.jkiss.dbeaver.model.DBIcon
;
import
org.jkiss.dbeaver.model.navigator.meta.DBXTreeItem
;
import
org.jkiss.dbeaver.model.navigator.meta.DBXTreeItem
;
...
@@ -55,8 +54,6 @@ import org.jkiss.dbeaver.ui.controls.ProgressPageControl;
...
@@ -55,8 +54,6 @@ import org.jkiss.dbeaver.ui.controls.ProgressPageControl;
import
org.jkiss.dbeaver.ui.controls.folders.*
;
import
org.jkiss.dbeaver.ui.controls.folders.*
;
import
org.jkiss.dbeaver.ui.css.CSSUtils
;
import
org.jkiss.dbeaver.ui.css.CSSUtils
;
import
org.jkiss.dbeaver.ui.css.DBStyles
;
import
org.jkiss.dbeaver.ui.css.DBStyles
;
import
org.jkiss.dbeaver.ui.editors.entity.GlobalContributorManager
;
import
org.jkiss.dbeaver.ui.editors.entity.IEntityEditorContext
;
import
org.jkiss.dbeaver.ui.navigator.INavigatorModelView
;
import
org.jkiss.dbeaver.ui.navigator.INavigatorModelView
;
import
org.jkiss.dbeaver.ui.navigator.NavigatorPreferences
;
import
org.jkiss.dbeaver.ui.navigator.NavigatorPreferences
;
import
org.jkiss.utils.CommonUtils
;
import
org.jkiss.utils.CommonUtils
;
...
@@ -70,8 +67,14 @@ import java.util.Map;
...
@@ -70,8 +67,14 @@ import java.util.Map;
/**
/**
* ObjectPropertiesEditor
* ObjectPropertiesEditor
*/
*/
public
class
ObjectPropertiesEditor
extends
AbstractDatabaseObjectEditor
<
DBSObject
>
public
class
ObjectPropertiesEditor
extends
AbstractDatabaseObjectEditor
<
DBSObject
>
implements
IEntityStructureEditor
,
implements
IRefreshablePart
,
IProgressControlProvider
,
ITabbedFolderContainer
,
ISearchContextProvider
,
INavigatorModelView
,
IEntityEditorContext
,
IDatabasePostSaveProcessor
IRefreshablePart
,
IProgressControlProvider
,
ITabbedFolderContainer
,
ISearchContextProvider
,
INavigatorModelView
,
IEntityEditorContext
,
IDatabasePostSaveProcessor
{
{
private
static
final
Log
log
=
Log
.
getLog
(
ObjectPropertiesEditor
.
class
);
private
static
final
Log
log
=
Log
.
getLog
(
ObjectPropertiesEditor
.
class
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录